Commit 060cafb9 authored by albajacas_a's avatar albajacas_a
Browse files

Merge branch...

Merge branch '558-particles-get-wrong-charge-if-input-file-has-different-number-of-particles' into 'master'

Resolve "Particles get wrong charge if input file has different number of particles"

Closes #558

See merge request !389
parents 26aa0ff8 2b5a78f1
...@@ -856,21 +856,18 @@ void Distribution::checkParticleNumber(size_t &numberOfParticles) { ...@@ -856,21 +856,18 @@ void Distribution::checkParticleNumber(size_t &numberOfParticles) {
} }
if (numberOfDistParticles != numberOfParticles) { if (numberOfDistParticles != numberOfParticles) {
*gmsg << "\n--------------------------------------------------" << endl throw OpalException("Distribution::checkParticleNumber",
<< "Warning!! The number of particles in the initial" << endl "The number of particles in the initial\n"
<< "distribution is " << numberOfDistParticles << "." << endl << endl "distribution " +
<< "This is different from the number of particles" << endl std::to_string(numberOfDistParticles) + "\n"
<< "defined by the BEAM command: " << numberOfParticles << endl << endl "is different from the number of particles\n"
<< "This is often happens when using a FROMFILE type" << endl "defined by the BEAM command " +
<< "distribution and not matching the number of" << endl std::to_string(numberOfParticles) + ".\n"
<< "particles in the particles file(s) with the number" << endl "This often happens when using a FROMFILE type\n"
<< "given in the BEAM command." << endl << endl "distribution and not matching the number of\n"
<< "The number of particles in the initial distribution" << endl "particles in the input distribution file(s) with\n"
<< "(" << numberOfDistParticles << ") " "the number given in the BEAM command.");
<< "will take precedence." << endl
<< "---------------------------------------------------\n" << endl;
} }
numberOfParticles = numberOfDistParticles;
} }
void Distribution::chooseInputMomentumUnits(InputMomentumUnitsT::InputMomentumUnitsT inputMoUnits) { void Distribution::chooseInputMomentumUnits(InputMomentumUnitsT::InputMomentumUnitsT inputMoUnits) {
......
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