diff --git a/opm/simulators/flow/MechContainer.cpp b/opm/simulators/flow/MechContainer.cpp index ab15f481c..6f4e817bb 100644 --- a/opm/simulators/flow/MechContainer.cpp +++ b/opm/simulators/flow/MechContainer.cpp @@ -117,6 +117,18 @@ allocate(const std::size_t bufferSize, allocated_ = true; } +template +void MechContainer:: +assignPotentialForces(const unsigned globalDofIdx, + const Scalar force, + const Scalar pressForce, + const Scalar tempForce) +{ + potentialForce_[globalDofIdx] = force; + potentialPressForce_[globalDofIdx] = pressForce; + potentialTempForce_[globalDofIdx] = tempForce; +} + template void MechContainer:: outputRestart(data::Solution& sol) const diff --git a/opm/simulators/flow/MechContainer.hpp b/opm/simulators/flow/MechContainer.hpp index bd9196b39..964618a8b 100644 --- a/opm/simulators/flow/MechContainer.hpp +++ b/opm/simulators/flow/MechContainer.hpp @@ -44,6 +44,11 @@ public: void allocate(const std::size_t bufferSize, std::map& rstKeywords); + void assignPotentialForces(const unsigned globalDofIdx, + const Scalar force, + const Scalar pressForce, + const Scalar tempForce); + void outputRestart(data::Solution& sol) const; bool allocated() const diff --git a/opm/simulators/flow/OutputBlackoilModule.hpp b/opm/simulators/flow/OutputBlackoilModule.hpp index fb655fc37..39f205354 100644 --- a/opm/simulators/flow/OutputBlackoilModule.hpp +++ b/opm/simulators/flow/OutputBlackoilModule.hpp @@ -209,9 +209,10 @@ public: const unsigned globalDofIdx = elemCtx.globalSpaceIndex(dofIdx, /*timeIdx=*/0); // Assume all mechanical things should be written - this->mech_.potentialForce_[globalDofIdx] = model.mechPotentialForce(globalDofIdx); - this->mech_.potentialPressForce_[globalDofIdx] = model.mechPotentialPressForce(globalDofIdx); - this->mech_.potentialTempForce_[globalDofIdx] = model.mechPotentialTempForce(globalDofIdx); + this->mech_.assignPotentialForces(globalDofIdx, + model.mechPotentialForce(globalDofIdx), + model.mechPotentialPressForce(globalDofIdx), + model.mechPotentialTempForce(globalDofIdx)); const auto disp = model.disp(globalDofIdx, /*include_fracture*/true); this->mech_.dispX_[globalDofIdx] = disp[Voigt::XX];