mcnptools icon indicating copy to clipboard operation
mcnptools copied to clipboard

Segfault With Single Energy Bin

Open tjlaboss opened this issue 1 year ago • 1 comments

MCNPTools experiences a Segmentation Fault when processing a meshtal file with only a single energy bin. A MWE will be posted.

MCNPTools attempts to compare to the "Total" bin, regardless of whether it exists. This occurs both in meshtal2vtk...

std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare (this=0x0, __s=0x47379d "Total")

...and the Python API:

import mcnptools
>>> mt = mcnptools.Meshtal("example.mesht")
>>> mt.GetTally(4)
Segmentation fault (core dumped)

Temporary workaround: Use emesh=0,1 instead of emesh=1.

tjlaboss avatar Mar 23 '23 22:03 tjlaboss