njoy / ENDFtk

Toolkit for reading and interacting with ENDF-6 formatted files
Other
34 stars 5 forks source link

Rework/tree #137

Closed whaeck closed 3 years ago

whaeck commented 3 years ago

The reworked ENDF tree components: each Section now owns its buffer to allow for easy insertion and deletion of sections, files, materials, etc.

The tree components are no longer templated, only some of the constructors are.

The tree File and Material now have functions to remove, insert and replace tree Section and File instances. The tree Section also has an NC function to return the number of lines (required to reconstitute a new index for a material).

Tests for the Material, File and Section were refactored and tests were simplified (due to the introduction of the new Section constructor).

There is a slight reduction in parsing performance when parsing a material in its entirety. The new tree implementation takes about 10% longer. For example: parsing 556 incident neutron files now takes about 13.3 seconds while it used to take 12 seconds. There's some room for optimisation there.

There's a few more things that could have been implemented, but there's more than enough already to merit this pull request. The outstanding work is as follows:

UPDATE July 15, 2021: