Commit ad7e3f9c authored by frey_m's avatar frey_m
Browse files

AMR: fix with guards

parent 2b6e0805
......@@ -907,11 +907,18 @@ void TrackRun::setupFieldsolver() {
Beam *beam = Beam::find(Attributes::getString(itsAttr[BEAM]));
size_t numParticles = beam->getNumberOfParticles();
if (!Options::amr && !opal->inRestartRun() && numParticles < numGridPoints)
if (!opal->inRestartRun() && numParticles < numGridPoints
#ifdef ENABLE_AMR
&& !Options::amr)
#else
)
#endif
{
throw OpalException("TrackRun::setupFieldsolver()",
"The number of simulation particles (" + std::to_string(numParticles) + ") \n" +
"is smaller than the number of gridpoints (" + std::to_string(numGridPoints) + ").\n" +
"Please increase the number of particles or reduce the size of the mesh.\n");
}
OpalData::getInstance()->addProblemCharacteristicValue("MX", fs->getMX());
OpalData::getInstance()->addProblemCharacteristicValue("MY", fs->getMY());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment