store strain as a VoigtArray in MechContainer

This commit is contained in:
Arne Morten Kvarving 2025-02-05 11:30:20 +01:00
parent 83f99a5fe4
commit dd36273cb6
2 changed files with 4 additions and 31 deletions

View File

@ -66,21 +66,9 @@ allocate(const std::size_t bufferSize,
} }
}; };
resizeAndRegister(strain_, "STRAIN");
resizeAndRegister(stress_, "STRESS"); resizeAndRegister(stress_, "STRESS");
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); this->delstressXX_.resize(bufferSize, 0.0);
rstKeywords["DELSTRXX"] = 0; rstKeywords["DELSTRXX"] = 0;
this->delstressYY_.resize(bufferSize, 0.0); this->delstressYY_.resize(bufferSize, 0.0);
@ -150,12 +138,7 @@ void MechContainer<Scalar>::
assignStrain(const unsigned globalDofIdx, assignStrain(const unsigned globalDofIdx,
const Dune::FieldVector<Scalar,6>& strain) const Dune::FieldVector<Scalar,6>& strain)
{ {
this->strainXX_[globalDofIdx] = strain[0]; this->strain_.assign(globalDofIdx, VoigtContainer<Scalar>(strain));
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>
@ -210,12 +193,7 @@ outputRestart(data::Solution& sol) const
DataEntry{"LINSTRYZ", UnitSystem::measure::pressure, &linstressYZ_}, DataEntry{"LINSTRYZ", UnitSystem::measure::pressure, &linstressYZ_},
DataEntry{"MECHPOTF", UnitSystem::measure::pressure, &potentialForce_}, DataEntry{"MECHPOTF", UnitSystem::measure::pressure, &potentialForce_},
DataEntry{"PRESPOTF", UnitSystem::measure::pressure, &potentialPressForce_}, DataEntry{"PRESPOTF", UnitSystem::measure::pressure, &potentialPressForce_},
DataEntry{"STRAINXX", UnitSystem::measure::identity, &strainXX_}, DataEntry{"STRAIN", UnitSystem::measure::identity, &strain_},
DataEntry{"STRAINYY", UnitSystem::measure::identity, &strainYY_},
DataEntry{"STRAINZZ", UnitSystem::measure::identity, &strainZZ_},
DataEntry{"STRAINXY", UnitSystem::measure::identity, &strainXY_},
DataEntry{"STRAINXZ", UnitSystem::measure::identity, &strainXZ_},
DataEntry{"STRAINYZ", UnitSystem::measure::identity, &strainYZ_},
DataEntry{"STRESS", UnitSystem::measure::length, &stress_}, DataEntry{"STRESS", UnitSystem::measure::length, &stress_},
DataEntry{"TEMPPOTF", UnitSystem::measure::pressure, &potentialTempForce_}, DataEntry{"TEMPPOTF", UnitSystem::measure::pressure, &potentialTempForce_},
}; };

View File

@ -74,6 +74,7 @@ public:
ScalarBuffer potentialTempForce_; ScalarBuffer potentialTempForce_;
std::array<ScalarBuffer,3> disp_; std::array<ScalarBuffer,3> disp_;
VoigtArray<Scalar> strain_;
VoigtArray<Scalar> stress_; VoigtArray<Scalar> stress_;
ScalarBuffer delstressXX_; ScalarBuffer delstressXX_;
ScalarBuffer delstressYY_; ScalarBuffer delstressYY_;
@ -81,12 +82,6 @@ public:
ScalarBuffer delstressXY_; ScalarBuffer delstressXY_;
ScalarBuffer delstressXZ_; ScalarBuffer delstressXZ_;
ScalarBuffer delstressYZ_; ScalarBuffer delstressYZ_;
ScalarBuffer strainXX_;
ScalarBuffer strainYY_;
ScalarBuffer strainZZ_;
ScalarBuffer strainXY_;
ScalarBuffer strainXZ_;
ScalarBuffer strainYZ_;
ScalarBuffer linstressXX_; ScalarBuffer linstressXX_;
ScalarBuffer linstressYY_; ScalarBuffer linstressYY_;
ScalarBuffer linstressZZ_; ScalarBuffer linstressZZ_;