mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
move allocation of mech data into MechContainer
This commit is contained in:
parent
7481f2a8e1
commit
2fe36caa08
@ -992,93 +992,7 @@ doAllocBuffers(const unsigned bufferSize,
|
|||||||
rstKeywords["PRESSURE"] = 0;
|
rstKeywords["PRESSURE"] = 0;
|
||||||
|
|
||||||
if (enableMech_ && eclState_.runspec().mech()) {
|
if (enableMech_ && eclState_.runspec().mech()) {
|
||||||
this->mech_.potentialForce_.resize(bufferSize,0.0);
|
this->mech_.allocate(bufferSize, rstKeywords);
|
||||||
rstKeywords["MECHPOTF"] = 0;
|
|
||||||
this->mech_.potentialTempForce_.resize(bufferSize,0.0);
|
|
||||||
rstKeywords["TEMPPOTF"] = 0;
|
|
||||||
this->mech_.potentialPressForce_.resize(bufferSize,0.0);
|
|
||||||
rstKeywords["PRESPOTF"] = 0;
|
|
||||||
|
|
||||||
this->mech_.dispX_.resize(bufferSize,0.0);
|
|
||||||
rstKeywords["DISPX"] = 0;
|
|
||||||
this->mech_.dispY_.resize(bufferSize,0.0);
|
|
||||||
rstKeywords["DISPY"] = 0;
|
|
||||||
this->mech_.dispZ_.resize(bufferSize,0.0);
|
|
||||||
rstKeywords["DISPZ"] = 0;
|
|
||||||
this->mech_.stressXX_.resize(bufferSize,0.0);
|
|
||||||
rstKeywords["STRESSXX"] = 0;
|
|
||||||
this->mech_.stressYY_.resize(bufferSize,0.0);
|
|
||||||
rstKeywords["STRESSYY"] = 0;
|
|
||||||
this->mech_.stressZZ_.resize(bufferSize,0.0);
|
|
||||||
rstKeywords["STRESSZZ"] = 0;
|
|
||||||
this->mech_.stressXY_.resize(bufferSize,0.0);
|
|
||||||
rstKeywords["STRESSXY"] = 0;
|
|
||||||
this->mech_.stressXZ_.resize(bufferSize,0.0);
|
|
||||||
rstKeywords["STRESSXZ"] = 0;
|
|
||||||
this->mech_.stressXY_.resize(bufferSize,0.0);
|
|
||||||
rstKeywords["STRESSXY"] = 0;
|
|
||||||
this->mech_.stressYZ_.resize(bufferSize,0.0);
|
|
||||||
rstKeywords["STRESSYZ"] = 0;
|
|
||||||
|
|
||||||
this->mech_.strainXX_.resize(bufferSize,0.0);
|
|
||||||
rstKeywords["STRAINXX"] = 0;
|
|
||||||
this->mech_.strainYY_.resize(bufferSize,0.0);
|
|
||||||
rstKeywords["STRAINYY"] = 0;
|
|
||||||
this->mech_.strainZZ_.resize(bufferSize,0.0);
|
|
||||||
rstKeywords["STRAINZZ"] = 0;
|
|
||||||
this->mech_.strainXY_.resize(bufferSize,0.0);
|
|
||||||
rstKeywords["STRAINXY"] = 0;
|
|
||||||
this->mech_.strainXZ_.resize(bufferSize,0.0);
|
|
||||||
rstKeywords["STRAINXZ"] = 0;
|
|
||||||
this->mech_.strainXY_.resize(bufferSize,0.0);
|
|
||||||
rstKeywords["STRAINXY"] = 0;
|
|
||||||
this->mech_.strainYZ_.resize(bufferSize,0.0);
|
|
||||||
rstKeywords["STRAINYZ"] = 0;
|
|
||||||
|
|
||||||
this->mech_.delstressXX_.resize(bufferSize,0.0);
|
|
||||||
rstKeywords["DELSTRXX"] = 0;
|
|
||||||
this->mech_.delstressYY_.resize(bufferSize,0.0);
|
|
||||||
rstKeywords["DELSTRYY"] = 0;
|
|
||||||
this->mech_.delstressZZ_.resize(bufferSize,0.0);
|
|
||||||
rstKeywords["DELSTRZZ"] = 0;
|
|
||||||
this->mech_.delstressXY_.resize(bufferSize,0.0);
|
|
||||||
rstKeywords["DELSTRXY"] = 0;
|
|
||||||
this->mech_.delstressXZ_.resize(bufferSize,0.0);
|
|
||||||
rstKeywords["DELSTRXZ"] = 0;
|
|
||||||
this->mech_.delstressXY_.resize(bufferSize,0.0);
|
|
||||||
rstKeywords["DELSTRXY"] = 0;
|
|
||||||
this->mech_.delstressYZ_.resize(bufferSize,0.0);
|
|
||||||
rstKeywords["DELSTRYZ"] = 0;
|
|
||||||
|
|
||||||
this->mech_.fracstressXX_.resize(bufferSize,0.0);
|
|
||||||
rstKeywords["FRCSTRXX"] = 0;
|
|
||||||
this->mech_.fracstressYY_.resize(bufferSize,0.0);
|
|
||||||
rstKeywords["FRCSTRYY"] = 0;
|
|
||||||
this->mech_.fracstressZZ_.resize(bufferSize,0.0);
|
|
||||||
rstKeywords["FRCSTRZZ"] = 0;
|
|
||||||
this->mech_.fracstressXY_.resize(bufferSize,0.0);
|
|
||||||
rstKeywords["FRCSTRXY"] = 0;
|
|
||||||
this->mech_.fracstressXZ_.resize(bufferSize,0.0);
|
|
||||||
rstKeywords["FRCSTRXZ"] = 0;
|
|
||||||
this->mech_.fracstressXY_.resize(bufferSize,0.0);
|
|
||||||
rstKeywords["FRCSTRXY"] = 0;
|
|
||||||
this->mech_.fracstressYZ_.resize(bufferSize,0.0);
|
|
||||||
rstKeywords["FRCSTRYZ"] = 0;
|
|
||||||
|
|
||||||
this->mech_.linstressXX_.resize(bufferSize,0.0);
|
|
||||||
rstKeywords["LINSTRXX"] = 0;
|
|
||||||
this->mech_.linstressYY_.resize(bufferSize,0.0);
|
|
||||||
rstKeywords["LINSTRYY"] = 0;
|
|
||||||
this->mech_.linstressZZ_.resize(bufferSize,0.0);
|
|
||||||
rstKeywords["LINSTRZZ"] = 0;
|
|
||||||
this->mech_.linstressXY_.resize(bufferSize,0.0);
|
|
||||||
rstKeywords["LINSTRXY"] = 0;
|
|
||||||
this->mech_.linstressXZ_.resize(bufferSize,0.0);
|
|
||||||
rstKeywords["LINSTRXZ"] = 0;
|
|
||||||
this->mech_.linstressXY_.resize(bufferSize,0.0);
|
|
||||||
rstKeywords["LINSTRXY"] = 0;
|
|
||||||
this->mech_.linstressYZ_.resize(bufferSize,0.0);
|
|
||||||
rstKeywords["LINSTRYZ"] = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If TEMP is set in RPTRST we output temperature even if THERMAL
|
// If TEMP is set in RPTRST we output temperature even if THERMAL
|
||||||
|
@ -25,5 +25,96 @@
|
|||||||
|
|
||||||
namespace Opm {
|
namespace Opm {
|
||||||
|
|
||||||
|
template<class Scalar>
|
||||||
|
void MechContainer<Scalar>::
|
||||||
|
allocate(const std::size_t bufferSize,
|
||||||
|
std::map<std::string, int>& rstKeywords)
|
||||||
|
{
|
||||||
|
this->potentialForce_.resize(bufferSize, 0.0);
|
||||||
|
rstKeywords["MECHPOTF"] = 0;
|
||||||
|
this->potentialTempForce_.resize(bufferSize, 0.0);
|
||||||
|
rstKeywords["TEMPPOTF"] = 0;
|
||||||
|
this->potentialPressForce_.resize(bufferSize, 0.0);
|
||||||
|
rstKeywords["PRESPOTF"] = 0;
|
||||||
|
|
||||||
|
this->dispX_.resize(bufferSize, 0.0);
|
||||||
|
rstKeywords["DISPX"] = 0;
|
||||||
|
this->dispY_.resize(bufferSize, 0.0);
|
||||||
|
rstKeywords["DISPY"] = 0;
|
||||||
|
this->dispZ_.resize(bufferSize, 0.0);
|
||||||
|
rstKeywords["DISPZ"] = 0;
|
||||||
|
this->stressXX_.resize(bufferSize, 0.0);
|
||||||
|
rstKeywords["STRESSXX"] = 0;
|
||||||
|
this->stressYY_.resize(bufferSize, 0.0);
|
||||||
|
rstKeywords["STRESSYY"] = 0;
|
||||||
|
this->stressZZ_.resize(bufferSize, 0.0);
|
||||||
|
rstKeywords["STRESSZZ"] = 0;
|
||||||
|
this->stressXY_.resize(bufferSize, 0.0);
|
||||||
|
rstKeywords["STRESSXY"] = 0;
|
||||||
|
this->stressXZ_.resize(bufferSize, 0.0);
|
||||||
|
rstKeywords["STRESSXZ"] = 0;
|
||||||
|
this->stressYZ_.resize(bufferSize, 0.0);
|
||||||
|
rstKeywords["STRESSYZ"] = 0;
|
||||||
|
|
||||||
|
this->strainXX_.resize(bufferSize, 0.0);
|
||||||
|
rstKeywords["STRAINXX"] = 0;
|
||||||
|
this->strainYY_.resize(bufferSize, 0.0);
|
||||||
|
rstKeywords["STRAINYY"] = 0;
|
||||||
|
this->strainZZ_.resize(bufferSize, 0.0);
|
||||||
|
rstKeywords["STRAINZZ"] = 0;
|
||||||
|
this->strainXY_.resize(bufferSize, 0.0);
|
||||||
|
rstKeywords["STRAINXY"] = 0;
|
||||||
|
this->strainXZ_.resize(bufferSize, 0.0);
|
||||||
|
rstKeywords["STRAINXZ"] = 0;
|
||||||
|
this->strainYZ_.resize(bufferSize, 0.0);
|
||||||
|
rstKeywords["STRAINYZ"] = 0;
|
||||||
|
|
||||||
|
this->delstressXX_.resize(bufferSize, 0.0);
|
||||||
|
rstKeywords["DELSTRXX"] = 0;
|
||||||
|
this->delstressYY_.resize(bufferSize, 0.0);
|
||||||
|
rstKeywords["DELSTRYY"] = 0;
|
||||||
|
this->delstressZZ_.resize(bufferSize, 0.0);
|
||||||
|
rstKeywords["DELSTRZZ"] = 0;
|
||||||
|
this->delstressXY_.resize(bufferSize, 0.0);
|
||||||
|
rstKeywords["DELSTRXY"] = 0;
|
||||||
|
this->delstressXZ_.resize(bufferSize, 0.0);
|
||||||
|
rstKeywords["DELSTRXZ"] = 0;
|
||||||
|
this->delstressYZ_.resize(bufferSize, 0.0);
|
||||||
|
rstKeywords["DELSTRYZ"] = 0;
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
this->linstressXX_.resize(bufferSize,0.0);
|
||||||
|
rstKeywords["LINSTRXX"] = 0;
|
||||||
|
this->linstressYY_.resize(bufferSize,0.0);
|
||||||
|
rstKeywords["LINSTRYY"] = 0;
|
||||||
|
this->linstressZZ_.resize(bufferSize,0.0);
|
||||||
|
rstKeywords["LINSTRZZ"] = 0;
|
||||||
|
this->linstressXY_.resize(bufferSize,0.0);
|
||||||
|
rstKeywords["LINSTRXY"] = 0;
|
||||||
|
this->linstressXZ_.resize(bufferSize,0.0);
|
||||||
|
rstKeywords["LINSTRXZ"] = 0;
|
||||||
|
this->linstressYZ_.resize(bufferSize,0.0);
|
||||||
|
rstKeywords["LINSTRYZ"] = 0;
|
||||||
|
|
||||||
|
allocated_ = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
template class MechContainer<double>;
|
||||||
|
|
||||||
|
#if FLOW_INSTANTIATE_FLOAT
|
||||||
|
template class MechContainer<float>;
|
||||||
|
#endif
|
||||||
|
|
||||||
} // namespace Opm
|
} // namespace Opm
|
||||||
|
@ -26,6 +26,9 @@
|
|||||||
#ifndef OPM_MECH_CONTAINER_HPP
|
#ifndef OPM_MECH_CONTAINER_HPP
|
||||||
#define OPM_MECH_CONTAINER_HPP
|
#define OPM_MECH_CONTAINER_HPP
|
||||||
|
|
||||||
|
#include <cstddef>
|
||||||
|
#include <map>
|
||||||
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace Opm {
|
namespace Opm {
|
||||||
@ -36,6 +39,13 @@ class MechContainer
|
|||||||
using ScalarBuffer = std::vector<Scalar>;
|
using ScalarBuffer = std::vector<Scalar>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
void allocate(const std::size_t bufferSize,
|
||||||
|
std::map<std::string, int>& rstKeywords);
|
||||||
|
|
||||||
|
bool allocated() const
|
||||||
|
{ return allocated_; }
|
||||||
|
|
||||||
|
bool allocated_ = false;
|
||||||
ScalarBuffer potentialForce_;
|
ScalarBuffer potentialForce_;
|
||||||
ScalarBuffer potentialPressForce_;
|
ScalarBuffer potentialPressForce_;
|
||||||
ScalarBuffer potentialTempForce_;
|
ScalarBuffer potentialTempForce_;
|
||||||
|
@ -196,7 +196,7 @@ public:
|
|||||||
void processElementMech(const ElementContext& elemCtx)
|
void processElementMech(const ElementContext& elemCtx)
|
||||||
{
|
{
|
||||||
if constexpr (getPropValue<TypeTag, Properties::EnableMech>()) {
|
if constexpr (getPropValue<TypeTag, Properties::EnableMech>()) {
|
||||||
if (this->mech_.potentialForce_.empty()) {
|
if (!this->mech_.allocated()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user