move assignment of strain into MechContainer

This commit is contained in:
Arne Morten Kvarving 2025-02-05 11:35:41 +01:00
parent b41e92e67f
commit 83f99a5fe4
3 changed files with 19 additions and 8 deletions

View File

@ -145,6 +145,19 @@ assignPotentialForces(const unsigned globalDofIdx,
potentialTempForce_[globalDofIdx] = tempForce; potentialTempForce_[globalDofIdx] = tempForce;
} }
template<class Scalar>
void MechContainer<Scalar>::
assignStrain(const unsigned globalDofIdx,
const Dune::FieldVector<Scalar,6>& strain)
{
this->strainXX_[globalDofIdx] = strain[0];
this->strainYY_[globalDofIdx] = strain[1];
this->strainZZ_[globalDofIdx] = strain[2];
this->strainYZ_[globalDofIdx] = strain[3];
this->strainXZ_[globalDofIdx] = strain[4];
this->strainXY_[globalDofIdx] = strain[5];
}
template<class Scalar> template<class Scalar>
void MechContainer<Scalar>:: void MechContainer<Scalar>::
assignStress(const unsigned globalDofIdx, assignStress(const unsigned globalDofIdx,

View File

@ -57,6 +57,9 @@ public:
const Scalar pressForce, const Scalar pressForce,
const Scalar tempForce); const Scalar tempForce);
void assignStrain(const unsigned globalDofIdx,
const Dune::FieldVector<Scalar,6>& strain);
void assignStress(const unsigned globalDofIdx, void assignStress(const unsigned globalDofIdx,
const Dune::FieldVector<Scalar,6>& stress); const Dune::FieldVector<Scalar,6>& stress);

View File

@ -217,18 +217,13 @@ public:
model.mechPotentialPressForce(globalDofIdx), model.mechPotentialPressForce(globalDofIdx),
model.mechPotentialTempForce(globalDofIdx)); model.mechPotentialTempForce(globalDofIdx));
this->mech_.assignStrain(globalDofIdx,
model.strain(globalDofIdx, /*include_fracture*/true));
// Total stress is not stored but calculated result is Voigt notation // Total stress is not stored but calculated result is Voigt notation
this->mech_.assignStress(globalDofIdx, this->mech_.assignStress(globalDofIdx,
model.stress(globalDofIdx, /*include_fracture*/true));; model.stress(globalDofIdx, /*include_fracture*/true));;
const auto strain = model.strain(globalDofIdx, /*include_fracture*/true);
this->mech_.strainXX_[globalDofIdx] = strain[Voigt::XX];
this->mech_.strainYY_[globalDofIdx] = strain[Voigt::YY];
this->mech_.strainZZ_[globalDofIdx] = strain[Voigt::ZZ];
this->mech_.strainXY_[globalDofIdx] = strain[Voigt::XY];
this->mech_.strainXZ_[globalDofIdx] = strain[Voigt::XZ];
this->mech_.strainYZ_[globalDofIdx] = strain[Voigt::YZ];
// Not including fracture // Not including fracture
const auto delstress = model.delstress(globalDofIdx); const auto delstress = model.delstress(globalDofIdx);
this->mech_.delstressXX_[globalDofIdx] = delstress[Voigt::XX]; this->mech_.delstressXX_[globalDofIdx] = delstress[Voigt::XX];