ORNL-CEES / thermochimica

Computational library for chemical thermodynamics and phase equilibrium calculation. Multiphysics and standalone estimations of chemical state and constitutive and transport properties.
BSD 3-Clause "New" or "Revised" License
43 stars 25 forks source link

Dynamic memory allocation in Levelling #143

Closed parikshitbajpai closed 1 year ago

parikshitbajpai commented 1 year ago

Describe the bug If ResetThermo gets called say in attempting to retry calculation upon failure, the variables needed in Leveling will get deallocated. dMolesPhase may then get reinitiated elsewhere leaving dIterHistory unallocated. This would not be tackled in https://github.com/ORNL-CEES/thermochimica/blob/3ca57bf5869444264c4fab90676477f570702764/src/setup/LevelingSolver.f90#L115-L133 and can lead to crash.

To Reproduce Encountered in MOOSE solves

Solution Check for each variable allocation separately.