Skip to content

Commit

Permalink
Check number of particle worlds during restart.
Browse files Browse the repository at this point in the history
  • Loading branch information
gassmoeller committed Sep 20, 2024
1 parent 125f8cd commit 659e53b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions source/simulator/checkpoint_restart.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ namespace aspect
oa << parameters.names_of_compositional_fields;
oa << parameters.normalized_fields;
oa << parameters.mesh_deformation_enabled;
oa << parameters.n_particle_worlds;
}


Expand Down Expand Up @@ -260,6 +261,14 @@ namespace aspect
"These need to be the same during restarting "
"from a checkpoint."));

unsigned int n_particle_worlds;
ia >> n_particle_worlds;
AssertThrow (n_particle_worlds == parameters.n_particle_worlds,
ExcMessage ("The number of particle worlds that were stored "
"in the checkpoint file is not the same as the one "
"you currently set in your input file. "
"These need to be the same during restarting "
"from a checkpoint."));
}
}

Expand Down
2 changes: 1 addition & 1 deletion source/simulator/parameters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ namespace aspect
"Name of the world builder file. If empty, the world builder is not initialized.");

prm.declare_entry ("Number of particle worlds", "1",
Patterns::Integer(0,1),
Patterns::Integer(0),
"The number of particle worlds to be created. The maximum number of particle worlds "
"is set by the CMake variable `ASPECT_MAX_NUM_PARTICLE_WORLDS` and is by default 2.");

Expand Down

0 comments on commit 659e53b

Please sign in to comment.