Skip to content

Commit

Permalink
Merge pull request #1539 from mfem/navier-bookkeeping-fix
Browse files Browse the repository at this point in the history
Navier miniapp bookkeeping fix
  • Loading branch information
tzanio committed Jun 17, 2020
2 parents b8ab8fc + 395e75f commit 3c5dc27
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions miniapps/navier/navier_solver.hpp
Expand Up @@ -32,6 +32,16 @@ class VelDirichletBC_T
: attr(attr), coeff(coeff)
{}

VelDirichletBC_T(VelDirichletBC_T &&obj)
{
// Deep copy the attribute array
this->attr = obj.attr;

// Move the coefficient pointer
this->coeff = obj.coeff;
obj.coeff = nullptr;
}

~VelDirichletBC_T() { delete coeff; }

Array<int> attr;
Expand All @@ -46,6 +56,16 @@ class PresDirichletBC_T
: attr(attr), coeff(coeff)
{}

PresDirichletBC_T(PresDirichletBC_T &&obj)
{
// Deep copy the attribute array
this->attr = obj.attr;

// Move the coefficient pointer
this->coeff = obj.coeff;
obj.coeff = nullptr;
}

~PresDirichletBC_T() { delete coeff; }

Array<int> attr;
Expand All @@ -60,6 +80,16 @@ class AccelTerm_T
: attr(attr), coeff(coeff)
{}

AccelTerm_T(AccelTerm_T &&obj)
{
// Deep copy the attribute array
this->attr = obj.attr;

// Move the coefficient pointer
this->coeff = obj.coeff;
obj.coeff = nullptr;
}

~AccelTerm_T() { delete coeff; }

Array<int> attr;
Expand Down

0 comments on commit 3c5dc27

Please sign in to comment.