SAnsell / CombLayer

MCNP(X) project builder using C++
GNU General Public License v3.0
13 stars 13 forks source link

mcnpx #74

Closed kbat closed 6 years ago

kbat commented 6 years ago

Current master branch can't generate MCNPX output:

./ess -r -mcnp 10 a =Finished beamlines=
Physics Model == CEM03
SET RND
EXCEPTION FAILURE :: InContainerError<>::
Key(long int)
key== SEED ==
Code Stack:
::main
MainProcess[F]::buildFullSimulation
SimProcess[F]::writeIndexSim
nameCard::getItem

kbat commented 6 years ago

still the same problem in the current master branch...

kbat commented 6 years ago

Thank you Stuart!

SAnsell commented 6 years ago

Just to note - the problem was caused by the reset to the physics list that occurs at each model construction. In MCNPX there is no RND SEED card and it is not reset if MCNPX has been selected as the output at that time. However, later code needs to update the random number value and that calls both dbcn and the RND SEED card [call is initiated from MainProcess::writeSim] which then fails because there is not key SEED in the RND card.

This has been fixed by a simple if statement -- this should be kept in mind because if we end up in a situation that there are many different versions of MCNP or PHITS etc then we should implement a possible / required / not-applicable flag into the nameItem setup to avoid having to remember ifs at each point they are used.