Merge branch 'mcpl_output_dev' of github.com:ebknudsen/openmc into mcpl_output_dev

This commit is contained in:
Erik B Knudsen 2022-10-11 16:52:20 +02:00
commit 4623cb4c9c

View file

@ -343,11 +343,13 @@ FileSource::FileSource(mcpl_file_t mcpl_file)
const mcpl_particle_t *mcpl_particle;
//extract particle from mcpl-file
mcpl_particle=mcpl_read(mcpl_file);
// check if it is a neutron or a photon. otherwise skip
while ( mcpl_particle->pdgcode!=2112 && mcpl_particle->pdgcode!=22 ) {
// check if it is a neutron, photon, electron, or positron. Otherwise skip.
int pdg=mcpl_particle->pdgcode;
while ( pdg!=2112 && pdg!=22 && pdg!=11 && pdg!=-11) {
mcpl_particle=mcpl_read(mcpl_file);
//should check for file exhaustion This could happen if particles are other than
//neutrons or photons
pdg=mcpl_particle->pdgcode;
//should check for file exhaustion. This could happen if particles are other than
//neutrons, photons, electrons, or positrons.
}
switch(pdg){
@ -445,6 +447,7 @@ CustomSourceWrapper::~CustomSourceWrapper()
#endif
}
//==============================================================================
// Non-member functions
//==============================================================================