Skip to content

Commit

Permalink
Fixes memory leak in CIVET valgrind tests
Browse files Browse the repository at this point in the history
  This fixes the memory leak in NEML causing these errors and
  corrects the original NEML driver to reflect the new API names
  for internal variables.

  closes idaholab#310
  • Loading branch information
reverendbedford authored and vprithiv committed Dec 14, 2022
1 parent 6dd198b commit b4c9f15
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion contrib/neml
12 changes: 6 additions & 6 deletions src/materials/NEMLStressBase.C
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ NEMLStressBase::computeQpStress()
double T_np1 = _temperature[_qp];
double T_n = _temperature_old[_qp];

mooseAssert(_model->nhist() == _hist[_qp].size(), "History data storage size mismatch");
double * const h_np1 = (_model->nhist() > 0 ? _hist[_qp].data() : nullptr);
mooseAssert(_model->nhist() == _hist_old[_qp].size(), "History data storage size mismatch");
const double * const h_n = (_model->nhist() > 0 ? _hist_old[_qp].data() : nullptr);
mooseAssert(_model->nstore() == _hist[_qp].size(), "History data storage size mismatch");
double * const h_np1 = (_model->nstore() > 0 ? _hist[_qp].data() : nullptr);
mooseAssert(_model->nstore() == _hist_old[_qp].size(), "History data storage size mismatch");
const double * const h_n = (_model->nstore() > 0 ? _hist_old[_qp].data() : nullptr);

double A_np1[36];

Expand Down Expand Up @@ -198,9 +198,9 @@ NEMLStressBase::initQpStatefulProperties()
ComputeStressBase::initQpStatefulProperties();

// Figure out initial history
_hist[_qp].resize(_model->nhist());
_hist[_qp].resize(_model->nstore());

if (_model->nhist() > 0)
if (_model->nstore() > 0)
{
try
{
Expand Down

0 comments on commit b4c9f15

Please sign in to comment.