v0.16.3
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
MatOps::MatNeohookean< DIM > Struct Template Reference
Inheritance diagram for MatOps::MatNeohookean< DIM >:
[legend]
Collaboration diagram for MatOps::MatNeohookean< DIM >:
[legend]

Public Types

using A = MatNeohookeanGeneric< MatElasticImpl< DIM > >
 
- Public Types inherited from MatOps::MatNeohookeanGeneric< MatElasticImpl< DIM > >
using A = MatElasticImpl< DIM >
 
- Public Types inherited from MatOps::PhysicalEquations
using HookFunction = std::function< MoFEMErrorCode(boost::shared_ptr< MatOpsData >, int, EntityHandle, int)>
 

Public Member Functions

MoFEMErrorCode setParams (FEMethod *fe_ptr, int gg) override
 
MoFEMErrorCode recordTape () override
 
- Public Member Functions inherited from MatOps::MatNeohookeanGeneric< MatElasticImpl< DIM > >
MoFEMErrorCode getOptions (MoFEM::Interface *m_field_ptr=nullptr) override
 
MoFEMErrorCode addBlockParameters (MoFEM::Interface &m_field, const std::string &block_name, int block_id, const Range &block_entities, const std::vector< double > &block_data) override
 
- Public Member Functions inherited from MatOps::MatElasticImpl< DIM >
ForcesAndSourcesCore::UserDataOperator * createOp (boost::shared_ptr< PhysicalEquations > physical_ptr, bool eval_stress, bool eval_tangent, bool update) override
 
ForcesAndSourcesCore::UserDataOperator * createOp (boost::shared_ptr< PhysicalEquations > physical_ptr, bool eval_stress, bool eval_tangent, bool update)
 
ForcesAndSourcesCore::UserDataOperator * createOp (boost::shared_ptr< PhysicalEquations > physical_ptr, bool eval_stress, bool eval_tangent, bool update)
 
- Public Member Functions inherited from MatOps::MatElastic
MatOpsData::MatrixPtr getEnergyDensityPtr () const
 
- Public Member Functions inherited from MatOps::MatPiolaResponse
 PhysicalEquations ()=delete
 
 PhysicalEquations (boost::shared_ptr< MatOpsData > mat_ops_data_ptr, int tag, boost::shared_ptr< std::map< int, Range > > tag_vs_range_ptr=nullptr)
 
- Public Member Functions inherited from MatOps::PhysicalEquations
 PhysicalEquations ()=delete
 
 PhysicalEquations (boost::shared_ptr< MatOpsData > mat_ops_data_ptr, int tag, boost::shared_ptr< std::map< int, Range > > tag_vs_range_ptr=nullptr)
 
virtual ~PhysicalEquations ()=default
 
virtual MoFEMErrorCode evaluateVariable (int tag, EntityHandle entity, int gg)
 
virtual MoFEMErrorCode evaluateDerivatives (int tag, EntityHandle entity, int gg)
 
virtual MoFEMErrorCode updateState (int tag, EntityHandle entity, int gg)
 

Additional Inherited Members

- Static Public Member Functions inherited from MatOps::MatNeohookeanGeneric< MatElasticImpl< DIM > >
static double getShearModulus (const double c10)
 
static double getAbaqusD1 (const double K)
 
static MoFEMErrorCode validateMaterialParameters (const double c10, const double K, const char *source)
 
- Public Attributes inherited from MatOps::PhysicalEquations
HookFunction hookEvaluateVariable = AdolCEvaluation::evaluateVariable
 
HookFunction hookEvaluateDerivatives = AdolCEvaluation::evaluateDerivatives
 
HookFunction hookUpdateState = AdolCEvaluation::evaluateVariable
 
int tAg
 
boost::shared_ptr< std::map< int, Range > > tagVsRangePtr
 
std::vector< std::pair< Range, std::vector< double > > > paramVecByRange
 
boost::shared_ptr< MatOpsData > matOpsDataPtr
 
- Static Public Attributes inherited from MatOps::MatElastic
static constexpr auto energyDensityDataName = "energy"
 
- Static Public Attributes inherited from MatOps::MatPiolaResponse
static bool useDeformationGradient
 Otherwise the displacement gradient is supplied and I is added.
 
- Protected Attributes inherited from MatOps::MatNeohookeanGeneric< MatElasticImpl< DIM > >
double C10
 
double K
 
std::vector< double > defaultMaterialParameters
 
std::vector< double > commandLineParameters
 

Detailed Description

template<int DIM>
struct MatOps::MatNeohookean< DIM >

Definition at line 147 of file MatNeohookean.cpp.

Member Typedef Documentation

◆ A

template<int DIM>
using MatOps::MatNeohookean< DIM >::A = MatNeohookeanGeneric<MatElasticImpl<DIM> >

Definition at line 148 of file MatNeohookean.cpp.

Member Function Documentation

◆ recordTape()

template<int DIM>
MoFEMErrorCode MatOps::MatNeohookean< DIM >::recordTape ( )
inlineoverridevirtual

Implements MatOps::PhysicalEquations.

Definition at line 171 of file MatNeohookean.cpp.

171 {
173
174 A::matOpsDataPtr->insertCommonData("grad", MatrixDouble());
175 A::matOpsDataPtr->insertCommonData("P", MatrixDouble());
176 A::matOpsDataPtr->insertCommonData("P_dF", MatrixDouble());
177
178 A::matOpsDataPtr->insertActiveData("F", MatrixDouble());
179 A::matOpsDataPtr->insertDependentData("P", MatrixDouble());
180 A::matOpsDataPtr->insertDependentData("energy", MatrixDouble());
181 A::matOpsDataPtr->insertDependentDerivativesData("P_dF", MatrixDouble());
182 A::matOpsDataPtr->insertDependentDerivativesData("energy_dF",
183 MatrixDouble());
184
185 A::matOpsDataPtr->getActiveDataPtr("F")->resize(DIM, DIM, false);
186 A::matOpsDataPtr->getDependentDataPtr("P")->resize(DIM, DIM, false);
187 A::matOpsDataPtr->getDependentDataPtr("energy")->resize(1, 1, false);
188 A::matOpsDataPtr->getDependentDerivativesDataPtr("energy_dF")
189 ->resize(1, DIM * DIM, false);
190
191 auto t_F = getFTensor2FromPtr<DIM, DIM>(
192 A::matOpsDataPtr->getActiveDataPtr("F")->data().data());
193 auto t_P = getFTensor2FromPtr<DIM, DIM>(
194 A::matOpsDataPtr->getDependentDataPtr("P")->data().data());
195 auto energy_ptr = A::matOpsDataPtr->getDependentDataPtr("energy");
196
198
199 FTENSOR_INDEX(DIM, i);
200 FTENSOR_INDEX(DIM, j);
201 FTENSOR_INDEX(DIM, I);
202 FTENSOR_INDEX(DIM, J);
203
204 t_F(i, J) = 0;
205
208
209 adouble det_aF, I1, ta_energy;
211
212 trace_on(A::tAg);
213 auto p_c10 = mkparam(this->C10);
214 auto p_K = mkparam(this->K);
215
216 ta_F(i, J) <<= t_F(i, J);
217 // assume that gradient from approximated displacement, that why we add diagonal
219 ta_F(i, J) += t_kd(i, J);
220 }
221
222 det_aF = determinantTensor(ta_F);
223 I1 = ta_F(i, I) * ta_F(i, I);
224 if constexpr (DIM == 2) {
225 // Abaqus plane strain uses the three-dimensional potential with F33=1.
226 I1 += 1.;
227 }
228 CHKERR invertTensor(ta_F, det_aF, ta_invF);
229
230 // Abaqus compressible Neo-Hookean potential (reduced polynomial N=1):
231 //
232 // W = C10 * (I1_bar - 3) + (1 / D1) * (J - 1)^2,
233 // I1_bar = J^(-2/3) * I1, mu0 = 2*C10, D1 = 2/K0.
234 //
235 // Its first Piola stress is
236 //
237 // P = 2*C10*J^(-2/3)*(F - I1/3*F^(-T))
238 // + K0*J*(J - 1)*F^(-T).
239 const auto jacobian_to_minus_two_thirds = pow(det_aF, -2. / 3.);
240 ta_P(i, I) = 2. * p_c10 * jacobian_to_minus_two_thirds *
241 (ta_F(i, I) - (I1 / 3.) * ta_invF(I, i)) +
242 p_K * det_aF * (det_aF - 1.) * ta_invF(I, i);
243
244 ta_energy = p_c10 * (jacobian_to_minus_two_thirds * I1 - 3.) +
245 0.5 * p_K * (det_aF - 1.) * (det_aF - 1.);
246
247 ta_P(i, I) >>= t_P(i, I);
248 ta_energy >>= (*energy_ptr)(0, 0);
249
250 trace_off();
251
253 }
#define FTENSOR_INDEX(DIM, I)
Kronecker Delta class.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
constexpr auto t_kd
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'J', DIM1 > J
Definition level_set.cpp:30
FTensor::Index< 'j', 3 > j
UBlasMatrix< double > MatrixDouble
Definition Types.hpp:77
static MoFEMErrorCode invertTensor(FTensor::Tensor2< T1, DIM, DIM > &t, T2 &det, FTensor::Tensor2< T3, DIM, DIM > &inv_t)
static auto determinantTensor(FTensor::Tensor2< T, DIM, DIM > &t)
Calculate the determinant of a tensor of rank DIM.
constexpr IntegrationType I
static bool useDeformationGradient
Otherwise the displacement gradient is supplied and I is added.
Definition MatOps.hpp:214
boost::shared_ptr< MatOpsData > matOpsDataPtr
Definition MatOps.hpp:201

◆ setParams()

template<int DIM>
MoFEMErrorCode MatOps::MatNeohookean< DIM >::setParams ( FEMethod *  fe_ptr,
int  gg 
)
inlineoverridevirtual

Implements MatOps::PhysicalEquations.

Definition at line 151 of file MatNeohookean.cpp.

151 {
152 (void)gg;
153 const auto ent = fe_ptr->getFEEntityHandle();
154 for (auto &[range, param_vec] : A::paramVecByRange) {
155 if (std::find(range.begin(), range.end(), ent) != range.end()) {
156 set_param_vec(A::tAg, param_vec.size(), param_vec.data());
157 return 0;
158 }
159 }
160 // command line overrides block parameters
161 if (!this->commandLineParameters.empty()) {
162 set_param_vec(A::tAg, this->commandLineParameters.size(),
163 this->commandLineParameters.data());
164 return 0;
165 }
166 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
167 "Neohookean material parameters not found for entity %lu",
168 static_cast<unsigned long>(ent));
169 }
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
MatNeohookeanGeneric< MatElasticImpl< DIM > > A
std::vector< std::pair< Range, std::vector< double > > > paramVecByRange
Definition MatOps.hpp:199

The documentation for this struct was generated from the following file: