Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write out full bgb data x make differences derivatives #786

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
9efb3f4
Merge remote-tracking branch 'markus/trans_map_amr_face_neighbors' in…
ykempf Sep 8, 2020
ddd7a52
Merge branch 'dev' of github.com:fmihpc/vlasiator into dev
ykempf Jun 23, 2021
f9d80c5
Merge branch 'dev' of github.com:fmihpc/vlasiator into dev
ykempf Sep 8, 2021
1c960a5
Merge branch 'dev' of github.com:fmihpc/vlasiator into dev
ykempf Dec 2, 2021
346bb42
Merge branch 'dev' of github.com:fmihpc/vlasiator into dev
ykempf Mar 7, 2023
42740ac
Initial commit, write all background B into a dedicated file on demand.
ykempf Mar 7, 2023
6e2edc5
Cleaned up indentation, added metadata to derivatives (which are diff…
ykempf Mar 7, 2023
3997edb
Set all weights to 1 instead of zero or LB will put them all on one t…
ykempf Mar 21, 2023
4ed08b1
Skip ionospheric metadata writing for full BGB IO as it crashes.
ykempf Mar 21, 2023
a772bf3
Merge branch 'dev' into write_out_full_bgb_data
ykempf Mar 21, 2023
bcfcbbb
Make in-code and DRO derivatives be actual derivatives and not differ…
ykempf Mar 21, 2023
d43106f
Fix a Real -> TReal conversion in fieldtracing.
ykempf Mar 21, 2023
9b55101
Two forgotten multiplications by DX in reconstruction coefficients.
ykempf Mar 22, 2023
ec91752
Protect \\rho backslash.
ykempf Mar 27, 2023
92cba4d
Fix divideIfNonZero for negative denominators and include a threshold…
ykempf Mar 28, 2023
aed73bd
Protect the whistler speed divisions in electric field solver.
ykempf Mar 28, 2023
7284087
Revert to differences in-code, but have actual derivatives in DROs.
ykempf Mar 30, 2023
7aa43f5
Replace divideIfNonZero with divideIfNonNegative in cpu_moments.cpp.
ykempf Mar 30, 2023
53d2212
Revert "Fix divideIfNonZero for negative denominators and include a t…
ykempf Apr 3, 2023
53cdafe
Revert "Protect the whistler speed divisions in electric field solver."
ykempf Apr 3, 2023
8cc50c9
Revert "Replace divideIfNonZero with divideIfNonNegative in cpu_momen…
ykempf Apr 3, 2023
bbbfe67
Fix the revert in ldz_electric_field.cpp to compile.
ykempf Apr 3, 2023
f92f178
Revert white-space changes to reduce clutter of diffs.
ykempf Apr 3, 2023
4796b79
Merge remote-tracking branch 'ykempf/make_differences_derivatives' in…
ykempf Jun 13, 2023
b7681d7
Output background bgb derivatives as derivatives too.
ykempf Jun 13, 2023
061c913
Write separate logfile for full BGB IO so as to not overwrite an
ykempf Jun 13, 2023
bb5983c
Removed writing of background derivatives with the fg_derivs DRO.
ykempf Jun 13, 2023
d4d753f
More metadata inconsistency fixes.
ykempf Jun 13, 2023
2ca8746
More consistency and metadata details.
ykempf Jun 13, 2023
e1a435b
Added some \\Deltas to the metadata.
ykempf Jun 15, 2023
f6ddb71
Merge branch 'dev' into write_out_full_bgb_data_X_make_differences_de…
ykempf Jun 19, 2023
1b81786
Fix merge blunder.
ykempf Jun 20, 2023
2e30fe1
Comments to explain better the full BGB writing procedure.
ykempf Jun 20, 2023
955d001
Setup ionosphere communicator for full BGB output including ionosphere
ykempf Jun 20, 2023
c10923a
Override output variable list when writing full BGB.
ykempf Jun 20, 2023
8cae6f1
Whitespace fix.
ykempf Jun 20, 2023
0a112d6
Fix order of phiprof calls upon early exit.
ykempf Jun 28, 2023
0dbbc85
Comments and fixes in the derivatives IO.
ykempf Jun 28, 2023
d7097b7
Fix volume background field derivatives integration loop to get dbidi…
ykempf Jun 29, 2023
f96b2bd
Derivative data reducers to subfolders.
ykempf Jun 29, 2023
a884a99
Merge remote-tracking branch 'ykempf/write_out_full_bgb_data_X_make_d…
ursg Sep 20, 2023
c9654e4
Merge branch 'dev' into write_out_full_bgb_data_X_make_differences_de…
ykempf Sep 21, 2023
de17a6f
Two continue not checking against writing all DROs now fixed.
ykempf Sep 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions backgroundfield/backgroundfield.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ void setBackgroundField(
int loopVolumeId {phiprof::initializeTimer("loop-volume-averages")};

// These are threaded now that the dipole field is threadsafe
#pragma omp parallel for collapse(3)
for (int x = 0; x < localSize[0]; ++x) {
#pragma omp parallel for collapse(2)
for (int z = 0; z < localSize[2]; ++z) {
for (int y = 0; y < localSize[1]; ++y) {
for (int z = 0; z < localSize[2]; ++z) {
for (int x = 0; x < localSize[0]; ++x) {
phiprof::Timer loopTopTimer {loopTopId};
std::array<double, 3> start = BgBGrid.getPhysicalCoords(x, y, z);
double dx[3];
Expand Down Expand Up @@ -120,22 +120,22 @@ void setBackgroundField(

phiprof::Timer loopVolumeTimer {loopVolumeId};
//Volume averages
for(unsigned int fComponent=0;fComponent<3;fComponent++){
for(uint fComponent=0;fComponent<3;fComponent++){
T3DFunction valueFunction = std::bind(bgFunction, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, (coordinate)fComponent, 0, (coordinate)0);
BgBGrid.get(x,y,z)->at(fsgrids::bgbfield::BGBXVOL+fComponent) += volumeAverage(valueFunction,accuracy,start.data(),end);

//Compute derivatives. Note that we scale by dx[] as the arrays are assumed to contain differences, not true derivatives!
T3DFunction derivFunction = std::bind(bgFunction, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, (coordinate)fComponent, 1, (coordinate)faceCoord1[fComponent]);
BgBGrid.get(x,y,z)->at(fsgrids::bgbfield::dBGBXVOLdy+2*fComponent) += dx[faceCoord1[fComponent]] * volumeAverage(derivFunction,accuracy,start.data(),end);
derivFunction = std::bind(bgFunction, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, (coordinate)fComponent, 1, (coordinate)faceCoord2[fComponent]);
BgBGrid.get(x,y,z)->at(fsgrids::bgbfield::dBGBXVOLdy+1+2*fComponent) += dx[faceCoord2[fComponent]] * volumeAverage(derivFunction,accuracy,start.data(),end);
//Compute derivatives. Note that we scale by dx[] as the arrays are assumed to contain differences, not true derivatives!
for(uint dComponent=0;dComponent<3;dComponent++){
T3DFunction derivFunction = std::bind(bgFunction, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, (coordinate)fComponent, 1, (coordinate)dComponent);
BgBGrid.get(x,y,z)->at(fsgrids::bgbfield::dBGBXVOLdx+3*fComponent+dComponent) += dx[dComponent] * volumeAverage(derivFunction,accuracy,start.data(),end);
}
}
loopVolumeTimer.stop();
}
}
}
//TODO
//COmpute divergence and curl of volume averaged field and check that both are zero.
//Compute divergence and curl of volume averaged field and check that both are zero.
}

void setBackgroundFieldToZero(
Expand Down
3 changes: 3 additions & 0 deletions common.h
Original file line number Diff line number Diff line change
Expand Up @@ -368,12 +368,15 @@ namespace fsgrids {
dBGBydz, /*!< Derivative of background face-averaged By in z-direction. */
dBGBzdx, /*!< Derivative of background face-averaged Bz in x-direction. */
dBGBzdy, /*!< Derivative of background face-averaged Bz in y-direction. */
dBGBXVOLdx, /*!< Derivative of background volume-averaged Bx in x-direction. */
dBGBXVOLdy, /*!< Derivative of background volume-averaged Bx in y-direction. */
dBGBXVOLdz, /*!< Derivative of background volume-averaged Bx in z-direction. */
dBGBYVOLdx, /*!< Derivative of background volume-averaged By in x-direction. */
dBGBYVOLdy, /*!< Derivative of background volume-averaged By in y-direction. */
dBGBYVOLdz, /*!< Derivative of background volume-averaged By in z-direction. */
dBGBZVOLdx, /*!< Derivative of background volume-averaged Bz in x-direction. */
dBGBZVOLdy, /*!< Derivative of background volume-averaged Bz in y-direction. */
dBGBZVOLdz, /*!< Derivative of background volume-averaged Bz in z-direction. */
N_BGB
};

Expand Down
977 changes: 600 additions & 377 deletions datareduction/datareducer.cpp

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions fieldsolver/derivatives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ void calculateDerivatives(
}

// pres_e = const * np.power(rho_e, index)
dMoments->at(fsgrids::dmoments::dPedx) = Peconst * limiter(pow(leftMoments->at(fsgrids::moments::RHOQ)/physicalconstants::CHARGE,Parameters::electronPTindex),pow(centMoments->at(fsgrids::moments::RHOQ)/physicalconstants::CHARGE,Parameters::electronPTindex),pow(rghtMoments->at(fsgrids::moments::RHOQ)/physicalconstants::CHARGE,Parameters::electronPTindex));
dMoments->at(fsgrids::dmoments::dPedx) = Peconst * limiter(pow(leftMoments->at(fsgrids::moments::RHOQ)/physicalconstants::CHARGE,Parameters::electronPTindex),pow(centMoments->at(fsgrids::moments::RHOQ)/physicalconstants::CHARGE,Parameters::electronPTindex),pow(rghtMoments->at(fsgrids::moments::RHOQ)/physicalconstants::CHARGE,Parameters::electronPTindex));

if (Parameters::ohmHallTerm < 2 || sysBoundaryLayer == 1) {
dPerB->at(fsgrids::dperb::dPERBydxx) = 0.0;
Expand Down Expand Up @@ -185,7 +185,7 @@ void calculateDerivatives(
}

// pres_e = const * np.power(rho_e, index)
dMoments->at(fsgrids::dmoments::dPedy) = Peconst * limiter(pow(leftMoments->at(fsgrids::moments::RHOQ)/physicalconstants::CHARGE,Parameters::electronPTindex),pow(centMoments->at(fsgrids::moments::RHOQ)/physicalconstants::CHARGE,Parameters::electronPTindex),pow(rghtMoments->at(fsgrids::moments::RHOQ)/physicalconstants::CHARGE,Parameters::electronPTindex));
dMoments->at(fsgrids::dmoments::dPedy) = Peconst * limiter(pow(leftMoments->at(fsgrids::moments::RHOQ)/physicalconstants::CHARGE,Parameters::electronPTindex),pow(centMoments->at(fsgrids::moments::RHOQ)/physicalconstants::CHARGE,Parameters::electronPTindex),pow(rghtMoments->at(fsgrids::moments::RHOQ)/physicalconstants::CHARGE,Parameters::electronPTindex));

if (Parameters::ohmHallTerm < 2 || sysBoundaryLayer == 1) {
dPerB->at(fsgrids::dperb::dPERBxdyy) = 0.0;
Expand Down Expand Up @@ -232,7 +232,7 @@ void calculateDerivatives(
}

// pres_e = const * np.power(rho_e, index)
dMoments->at(fsgrids::dmoments::dPedz) = Peconst * limiter(pow(leftMoments->at(fsgrids::moments::RHOQ)/physicalconstants::CHARGE,Parameters::electronPTindex),pow(centMoments->at(fsgrids::moments::RHOQ)/physicalconstants::CHARGE,Parameters::electronPTindex),pow(rghtMoments->at(fsgrids::moments::RHOQ)/physicalconstants::CHARGE,Parameters::electronPTindex));
dMoments->at(fsgrids::dmoments::dPedz) = Peconst * limiter(pow(leftMoments->at(fsgrids::moments::RHOQ)/physicalconstants::CHARGE,Parameters::electronPTindex),pow(centMoments->at(fsgrids::moments::RHOQ)/physicalconstants::CHARGE,Parameters::electronPTindex),pow(rghtMoments->at(fsgrids::moments::RHOQ)/physicalconstants::CHARGE,Parameters::electronPTindex));

if (Parameters::ohmHallTerm < 2 || sysBoundaryLayer == 1) {
dPerB->at(fsgrids::dperb::dPERBxdzz) = 0.0;
Expand Down
24 changes: 12 additions & 12 deletions fieldsolver/ldz_hall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -460,10 +460,10 @@ void calculateEdgeHallTermXComponents(
Bz = perBGrid.get(i,j,k)->at(fsgrids::bfield::PERBZ)+BgBGrid.get(i,j,k)->at(fsgrids::bgbfield::BGBZ);

hallRhoq = (momentsGrid.get(i,j,k)->at(fsgrids::moments::RHOQ) <= Parameters::hallMinimumRhoq ) ? Parameters::hallMinimumRhoq : momentsGrid.get(i,j,k)->at(fsgrids::moments::RHOQ) ;
EXHall = (Bz*((BgBGrid.get(i,j,k)->at(fsgrids::bgbfield::dBGBxdz)+dPerBGrid.get(i,j,k)->at(fsgrids::dperb::dPERBxdz))/technicalGrid.DZ -
(BgBGrid.get(i,j,k)->at(fsgrids::bgbfield::dBGBzdx)+dPerBGrid.get(i,j,k)->at(fsgrids::dperb::dPERBzdx))/technicalGrid.DX) -
By*((BgBGrid.get(i,j,k)->at(fsgrids::bgbfield::dBGBydx)+dPerBGrid.get(i,j,k)->at(fsgrids::dperb::dPERBydx))/technicalGrid.DX-
((BgBGrid.get(i,j,k)->at(fsgrids::bgbfield::dBGBxdy)+dPerBGrid.get(i,j,k)->at(fsgrids::dperb::dPERBxdy))/technicalGrid.DY)));
EXHall = Bz*((BgBGrid.get(i,j,k)->at(fsgrids::bgbfield::dBGBxdz)+dPerBGrid.get(i,j,k)->at(fsgrids::dperb::dPERBxdz)) / technicalGrid.DZ -
(BgBGrid.get(i,j,k)->at(fsgrids::bgbfield::dBGBzdx)+dPerBGrid.get(i,j,k)->at(fsgrids::dperb::dPERBzdx)) / technicalGrid.DX) -
By*((BgBGrid.get(i,j,k)->at(fsgrids::bgbfield::dBGBydx)+dPerBGrid.get(i,j,k)->at(fsgrids::dperb::dPERBydx)) / technicalGrid.DX -
(BgBGrid.get(i,j,k)->at(fsgrids::bgbfield::dBGBxdy)+dPerBGrid.get(i,j,k)->at(fsgrids::dperb::dPERBxdy)) / technicalGrid.DY);
EXHall /= physicalconstants::MU_0 * hallRhoq;

EHallGrid.get(i,j,k)->at(fsgrids::ehall::EXHALL_000_100) =
Expand Down Expand Up @@ -558,10 +558,10 @@ void calculateEdgeHallTermYComponents(
Bz = perBGrid.get(i,j,k)->at(fsgrids::bfield::PERBZ)+BgBGrid.get(i,j,k)->at(fsgrids::bgbfield::BGBZ);

hallRhoq = (momentsGrid.get(i,j,k)->at(fsgrids::moments::RHOQ) <= Parameters::hallMinimumRhoq ) ? Parameters::hallMinimumRhoq : momentsGrid.get(i,j,k)->at(fsgrids::moments::RHOQ) ;
EYHall = (Bx*((BgBGrid.get(i,j,k)->at(fsgrids::bgbfield::dBGBydx)+dPerBGrid.get(i,j,k)->at(fsgrids::dperb::dPERBydx))/technicalGrid.DX -
(BgBGrid.get(i,j,k)->at(fsgrids::bgbfield::dBGBxdy)+dPerBGrid.get(i,j,k)->at(fsgrids::dperb::dPERBxdy))/technicalGrid.DY) -
Bz*((BgBGrid.get(i,j,k)->at(fsgrids::bgbfield::dBGBzdy)+dPerBGrid.get(i,j,k)->at(fsgrids::dperb::dPERBzdy))/technicalGrid.DY -
((BgBGrid.get(i,j,k)->at(fsgrids::bgbfield::dBGBydz)+dPerBGrid.get(i,j,k)->at(fsgrids::dperb::dPERBydz))/technicalGrid.DZ )));
EYHall = Bx*((BgBGrid.get(i,j,k)->at(fsgrids::bgbfield::dBGBydx)+dPerBGrid.get(i,j,k)->at(fsgrids::dperb::dPERBydx)) / technicalGrid.DX -
(BgBGrid.get(i,j,k)->at(fsgrids::bgbfield::dBGBxdy)+dPerBGrid.get(i,j,k)->at(fsgrids::dperb::dPERBxdy)) / technicalGrid.DY) -
Bz*((BgBGrid.get(i,j,k)->at(fsgrids::bgbfield::dBGBzdy)+dPerBGrid.get(i,j,k)->at(fsgrids::dperb::dPERBzdy)) / technicalGrid.DY -
(BgBGrid.get(i,j,k)->at(fsgrids::bgbfield::dBGBydz)+dPerBGrid.get(i,j,k)->at(fsgrids::dperb::dPERBydz)) / technicalGrid.DZ);
EYHall /= physicalconstants::MU_0 * hallRhoq;

EHallGrid.get(i,j,k)->at(fsgrids::ehall::EYHALL_000_010) =
Expand Down Expand Up @@ -656,10 +656,10 @@ void calculateEdgeHallTermZComponents(
By = perBGrid.get(i,j,k)->at(fsgrids::bfield::PERBY)+BgBGrid.get(i,j,k)->at(fsgrids::bgbfield::BGBY);

hallRhoq = (momentsGrid.get(i,j,k)->at(fsgrids::moments::RHOQ) <= Parameters::hallMinimumRhoq ) ? Parameters::hallMinimumRhoq : momentsGrid.get(i,j,k)->at(fsgrids::moments::RHOQ) ;
EZHall = (By*((BgBGrid.get(i,j,k)->at(fsgrids::bgbfield::dBGBzdy)+dPerBGrid.get(i,j,k)->at(fsgrids::dperb::dPERBzdy))/technicalGrid.DY -
(BgBGrid.get(i,j,k)->at(fsgrids::bgbfield::dBGBydz)+dPerBGrid.get(i,j,k)->at(fsgrids::dperb::dPERBydz))/technicalGrid.DZ) -
Bx*((BgBGrid.get(i,j,k)->at(fsgrids::bgbfield::dBGBxdz)+dPerBGrid.get(i,j,k)->at(fsgrids::dperb::dPERBxdz))/technicalGrid.DZ -
((BgBGrid.get(i,j,k)->at(fsgrids::bgbfield::dBGBzdx)+dPerBGrid.get(i,j,k)->at(fsgrids::dperb::dPERBzdx))/technicalGrid.DX)));
EZHall = By*((BgBGrid.get(i,j,k)->at(fsgrids::bgbfield::dBGBzdy)+dPerBGrid.get(i,j,k)->at(fsgrids::dperb::dPERBzdy)) / technicalGrid.DY -
(BgBGrid.get(i,j,k)->at(fsgrids::bgbfield::dBGBydz)+dPerBGrid.get(i,j,k)->at(fsgrids::dperb::dPERBydz)) / technicalGrid.DZ) -
Bx*((BgBGrid.get(i,j,k)->at(fsgrids::bgbfield::dBGBxdz)+dPerBGrid.get(i,j,k)->at(fsgrids::dperb::dPERBxdz)) / technicalGrid.DZ -
(BgBGrid.get(i,j,k)->at(fsgrids::bgbfield::dBGBzdx)+dPerBGrid.get(i,j,k)->at(fsgrids::dperb::dPERBzdx)) / technicalGrid.DX);
EZHall /= physicalconstants::MU_0 * hallRhoq;

EHallGrid.get(i,j,k)->at(fsgrids::ehall::EZHALL_000_001) =
Expand Down
17 changes: 16 additions & 1 deletion grid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,10 @@ void initializeGrids(
// Update technicalGrid
technicalGrid.updateGhostCells(); // This needs to be done at some point

if (!P::isRestart) {
if (!P::isRestart && !P::writeFullBGB) {
// If we are starting a new regular simulation, we need to prepare all cells with their initial state.
// If we're only after writing out the full BGB we don't need all this shebang EXCEPT the weights!

//Initial state based on project, background field in all cells
//and other initial values in non-sysboundary cells
phiprof::Timer applyInitialTimer {"Apply initial state"};
Expand Down Expand Up @@ -329,8 +332,14 @@ void initializeGrids(
initMomentsTimer.stop();
*/

} else if (P::writeFullBGB) {
// If, instead of starting a regular simulation, we are only writing out the background field, it is enough to set a dummy load balance value of 1 here.
for (size_t i=0; i<cells.size(); ++i) {
mpiGrid[cells[i]]->parameters[CellParams::LBWEIGHTCOUNTER] = 1;
}
}


// Balance load before we transfer all data below
balanceLoad(mpiGrid, sysBoundaries);
// Function includes re-calculation of local cells cache
Expand Down Expand Up @@ -358,6 +367,12 @@ void initializeGrids(

setBTimer.stop();

// If we only want the full BGB for writeout, we have it now and we can return early.
if(P::writeFullBGB == true) {
phiprof::stop("Set initial state");
return;
}

if (P::isRestart == false) {
// Apply boundary conditions so that we get correct initial moments
sysBoundaries.applySysBoundaryVlasovConditions(mpiGrid,Parameters::t, true); // It doesn't matter here whether we put _R or _V moments
Expand Down
5 changes: 2 additions & 3 deletions iowrite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ bool writeDataReducer(const dccrg::Dccrg<SpatialCell,dccrg::Cartesian_Geometry>&
// Note that this is not an error (anymore), since fsgrid reducers will return false here.
}
}

if( success ) {

if( (writeAsFloat == true && dataType.compare("float") == 0) && dataSize == sizeof(double) ) {
Expand Down Expand Up @@ -1316,7 +1317,6 @@ bool writeGrid(
fname.fill('0');
fname << P::systemWrites.at(outputFileTypeIndex) << ".vlsv";


//Open the file with vlsvWriter:
Writer vlsvWriter;
const int masterProcessId = 0;
Expand Down Expand Up @@ -1370,7 +1370,6 @@ bool writeGrid(
ghost_cells = mpiGrid.get_remote_cells_on_process_boundary( NEAREST_NEIGHBORHOOD_ID );
}


//Make sure the local cells and ghost cells are fetched properly
if( local_cells.empty() ) {
if( !ghost_cells.empty() ) {
Expand Down Expand Up @@ -1422,7 +1421,7 @@ bool writeGrid(
if( writeFsGridMetadata( technicalGrid, vlsvWriter ) == false ) {
return false;
}

//Write Ionosphere Grid
if( writeIonosphereGridMetadata( vlsvWriter ) == false ) {
return false;
Expand Down
7 changes: 5 additions & 2 deletions parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ uint P::tstep_min = 0;
uint P::tstep_max = 0;
uint P::diagnosticInterval = numeric_limits<uint>::max();
bool P::writeInitialState = true;

bool P::writeFullBGB = false;

bool P::meshRepartitioned = true;
bool P::prepareForRebalance = false;
Expand Down Expand Up @@ -232,6 +232,8 @@ bool P::addParameters() {
RP::add("io.write_initial_state",
"Write initial state, not even the 0.5 dt propagation is done. Do not use for restarting. ", false);

RP::add("io.write_full_bgb_data", "Write a dedicated file containing all BGB components and first derivatives, then exit.", false);

RP::add("io.restart_walltime_interval",
"Save the complete simulation in given walltime intervals. Negative values disable writes.", -1.0);
RP::add("io.number_of_restarts", "Exit the simulation after certain number of walltime-based restarts.",
Expand Down Expand Up @@ -347,7 +349,7 @@ bool P::addParameters() {
string() +
"List of data reduction operators (DROs) to add to the grid file output. Each variable to be "
"added has to be on a new line output = XXX. Names are case insensitive. " +
"Available (20221221): " + "fg_b fg_b_background fg_b_perturbed fg_e " +
"Available (20230628): " + "fg_b fg_b_background fg_b_perturbed fg_b_background_vol fg_derivs_b_background fg_e " +
"vg_rhom vg_rhoq populations_vg_rho " + "fg_rhom fg_rhoq " + "vg_v fg_v populations_vg_v " +
"populations_vg_moments_thermal populations_vg_moments_nonthermal " +
"populations_vg_effectivesparsitythreshold populations_vg_rho_loss_adjust " +
Expand Down Expand Up @@ -482,6 +484,7 @@ void Parameters::getParameters() {
RP::get("io.system_write_fsgrid_variables", P::systemWriteFsGrid);
RP::get("io.system_write_all_data_reducers", P::systemWriteAllDROs);
RP::get("io.write_initial_state", P::writeInitialState);
RP::get("io.write_full_bgb_data", P::writeFullBGB);
RP::get("io.restart_walltime_interval", P::saveRestartWalltimeInterval);
RP::get("io.number_of_restarts", P::exitAfterRestarts);
RP::get("io.vlsv_buffer_size", P::vlsvBufferSize);
Expand Down
1 change: 1 addition & 0 deletions parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ struct Parameters {

static bool writeInitialState; /*!< If true, initial state is written. This is useful for debugging as the restarts
are always written out after propagation of 0.5dt in real space.*/
static bool writeFullBGB; /*!< If true, write full BGB components and derivatives in a dedicated file, then exit.*/
static Real saveRestartWalltimeInterval; /*!< Interval in walltime seconds for restart data*/
static uint exitAfterRestarts; /*!< Exit after this many restarts*/
static uint64_t vlsvBufferSize; /*!< Buffer size in bytes passed to VLSV writer. */
Expand Down
Loading