From be0fbac68b82859ab66275d06b38f306101f4c4b Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 5 Feb 2025 11:30:20 +0100 Subject: [PATCH] store fracStress as a VoigtArray in MechContainer --- opm/simulators/flow/MechContainer.cpp | 28 +++------------------------ opm/simulators/flow/MechContainer.hpp | 7 +------ 2 files changed, 4 insertions(+), 31 deletions(-) diff --git a/opm/simulators/flow/MechContainer.cpp b/opm/simulators/flow/MechContainer.cpp index 557af4277..e3628b646 100644 --- a/opm/simulators/flow/MechContainer.cpp +++ b/opm/simulators/flow/MechContainer.cpp @@ -67,23 +67,11 @@ allocate(const std::size_t bufferSize, }; resizeAndRegister(delstress_, "DELSTR"); + resizeAndRegister(fracstress_, "FRCSTR"); resizeAndRegister(linstress_, "LINSTR"); resizeAndRegister(strain_, "STRAIN"); resizeAndRegister(stress_, "STRESS"); - this->fracstressXX_.resize(bufferSize,0.0); - rstKeywords["FRCSTRXX"] = 0; - this->fracstressYY_.resize(bufferSize,0.0); - rstKeywords["FRCSTRYY"] = 0; - this->fracstressZZ_.resize(bufferSize,0.0); - rstKeywords["FRCSTRZZ"] = 0; - this->fracstressXY_.resize(bufferSize,0.0); - rstKeywords["FRCSTRXY"] = 0; - this->fracstressXZ_.resize(bufferSize,0.0); - rstKeywords["FRCSTRXZ"] = 0; - this->fracstressYZ_.resize(bufferSize,0.0); - rstKeywords["FRCSTRYZ"] = 0; - allocated_ = true; } @@ -110,12 +98,7 @@ void MechContainer:: assignFracStress(const unsigned globalDofIdx, const Dune::FieldVector& fracStress) { - this->fracstressXX_[globalDofIdx] = fracStress[0]; - this->fracstressYY_[globalDofIdx] = fracStress[1]; - this->fracstressZZ_[globalDofIdx] = fracStress[2]; - this->fracstressYZ_[globalDofIdx] = fracStress[3]; - this->fracstressXZ_[globalDofIdx] = fracStress[4]; - this->fracstressXY_[globalDofIdx] = fracStress[5]; + this->fracstress_.assign(globalDofIdx, VoigtContainer(fracStress)); } template @@ -179,12 +162,7 @@ outputRestart(data::Solution& sol) const const auto solutionVectors = std::array{ DataEntry{"DELSTR", UnitSystem::measure::pressure, &delstress_}, DataEntry{"DISP", UnitSystem::measure::length, &disp_}, - DataEntry{"FRCSTRXX", UnitSystem::measure::pressure, &fracstressXX_}, - DataEntry{"FRCSTRYY", UnitSystem::measure::pressure, &fracstressYY_}, - DataEntry{"FRCSTRZZ", UnitSystem::measure::pressure, &fracstressZZ_}, - DataEntry{"FRCSTRXY", UnitSystem::measure::pressure, &fracstressXY_}, - DataEntry{"FRCSTRXZ", UnitSystem::measure::pressure, &fracstressXZ_}, - DataEntry{"FRCSTRYZ", UnitSystem::measure::pressure, &fracstressYZ_}, + DataEntry{"FRCSTR", UnitSystem::measure::pressure, &fracstress_}, DataEntry{"LINSTR", UnitSystem::measure::pressure, &linstress_}, DataEntry{"MECHPOTF", UnitSystem::measure::pressure, &potentialForce_}, DataEntry{"PRESPOTF", UnitSystem::measure::pressure, &potentialPressForce_}, diff --git a/opm/simulators/flow/MechContainer.hpp b/opm/simulators/flow/MechContainer.hpp index b7d4ffab1..db0faa3ce 100644 --- a/opm/simulators/flow/MechContainer.hpp +++ b/opm/simulators/flow/MechContainer.hpp @@ -84,15 +84,10 @@ public: std::array disp_; VoigtArray delstress_; + VoigtArray fracstress_; VoigtArray linstress_; VoigtArray strain_; VoigtArray stress_; - ScalarBuffer fracstressXX_; - ScalarBuffer fracstressYY_; - ScalarBuffer fracstressZZ_; - ScalarBuffer fracstressXY_; - ScalarBuffer fracstressXZ_; - ScalarBuffer fracstressYZ_; }; } // namespace Opm