Skip to content

Commit

Permalink
Merge pull request idaholab#317 from reverendbedford/neml_fix_again
Browse files Browse the repository at this point in the history
Fixes memory leak in CIVET valgrind tests
  • Loading branch information
bwspenc authored Nov 18, 2022
2 parents e4db2f9 + 40de927 commit 466892f
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 466892f

Please sign in to comment.