v0.16.0
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::UserDataOperatorcreateOp (boost::shared_ptr< PhysicalEquations > physical_ptr, bool eval_stress, bool eval_tangent, bool update) override
 
ForcesAndSourcesCore::UserDataOperatorcreateOp (boost::shared_ptr< PhysicalEquations > physical_ptr, bool eval_stress, bool eval_tangent, bool update)
 
ForcesAndSourcesCore::UserDataOperatorcreateOp (boost::shared_ptr< PhysicalEquations > physical_ptr, bool eval_stress, bool eval_tangent, bool update)
 
- Public Member Functions inherited from MatOps::MatElastic
 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< MatOpsDatamatOpsDataPtr
 
- Static Public Attributes inherited from MatOps::MatElastic
static bool useDeformationGradient
 
- Protected Attributes inherited from MatOps::MatNeohookeanGeneric< MatElasticImpl< DIM > >
double C10
 
double K
 
std::vector< doubledefaultMaterialParameters
 
std::vector< doublecommandLineParameters
 

Detailed Description

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

Definition at line 167 of file MatNeohookean.cpp.

Member Typedef Documentation

◆ A

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

Definition at line 168 of file MatNeohookean.cpp.

Member Function Documentation

◆ recordTape()

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

Implements MatOps::PhysicalEquations.

Definition at line 191 of file MatNeohookean.cpp.

191 {
193
194 A::matOpsDataPtr->insertCommonData("grad", MatrixDouble());
195 A::matOpsDataPtr->insertCommonData("P", MatrixDouble());
196 A::matOpsDataPtr->insertCommonData("P_dF", MatrixDouble());
197
198 A::matOpsDataPtr->insertActiveData("F", MatrixDouble());
199 A::matOpsDataPtr->insertDependentData("P", MatrixDouble());
200 A::matOpsDataPtr->insertDependentDerivativesData("P_dF", MatrixDouble());
201
202 A::matOpsDataPtr->getActiveDataPtr("F")->resize(DIM, DIM, false);
203 A::matOpsDataPtr->getDependentDataPtr("P")->resize(DIM, DIM, false);
204
205 auto t_F = getFTensor2FromPtr<DIM, DIM>(
206 A::matOpsDataPtr->getActiveDataPtr("F")->data().data());
207 auto t_P = getFTensor2FromPtr<DIM, DIM>(
208 A::matOpsDataPtr->getDependentDataPtr("P")->data().data());
209
211
212 FTENSOR_INDEX(DIM, i);
213 FTENSOR_INDEX(DIM, j);
214 FTENSOR_INDEX(DIM, I);
215 FTENSOR_INDEX(DIM, J);
216
217 t_F(i, J) = 0;
218
221
222 adouble det_aF, I1;
224
225 trace_on(A::tAg);
226 auto p_c10 = mkparam(this->C10);
227 auto p_K = mkparam(this->K);
228
229 ta_F(i, J) <<= t_F(i, J);
230 // assume that gradient from approximated displacement, that why we add diagonal
232 ta_F(i, J) += t_kd(i, J);
233 }
234
235 det_aF = determinantTensor(ta_F);
236 I1 = ta_F(i, I) * ta_F(i, I);
237 if constexpr (DIM == 2) {
238 // Abaqus plane strain uses the three-dimensional potential with F33=1.
239 I1 += 1.;
240 }
241 CHKERR invertTensor(ta_F, det_aF, ta_invF);
242
243 // Abaqus compressible Neo-Hookean potential (reduced polynomial N=1):
244 //
245 // W = C10 * (I1_bar - 3) + (1 / D1) * (J - 1)^2,
246 // I1_bar = J^(-2/3) * I1, mu0 = 2*C10, D1 = 2/K0.
247 //
248 // Its first Piola stress is
249 //
250 // P = 2*C10*J^(-2/3)*(F - I1/3*F^(-T))
251 // + K0*J*(J - 1)*F^(-T).
252 const auto jacobian_to_minus_two_thirds = pow(det_aF, -2. / 3.);
253 ta_P(i, I) =
254 2. * p_c10 * jacobian_to_minus_two_thirds *
255 (ta_F(i, I) - (I1 / 3.) * ta_invF(I, i)) +
256 p_K * det_aF * (det_aF - 1.) * ta_invF(I, i);
257
258 ta_P(i, I) >>= t_P(i, I);
259
260 trace_off();
261
263 }
#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
boost::shared_ptr< MatOpsData > matOpsDataPtr
Definition MatOps.hpp:164

◆ setParams()

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

Implements MatOps::PhysicalEquations.

Definition at line 171 of file MatNeohookean.cpp.

171 {
172 (void)gg;
173 const auto ent = fe_ptr->getFEEntityHandle();
174 for (auto &[range, param_vec] : A::paramVecByRange) {
175 if (std::find(range.begin(), range.end(), ent) != range.end()) {
176 set_param_vec(A::tAg, param_vec.size(), param_vec.data());
177 return 0;
178 }
179 }
180 // command line overrides block parameters
181 if (!this->commandLineParameters.empty()) {
182 set_param_vec(A::tAg, this->commandLineParameters.size(),
183 this->commandLineParameters.data());
184 return 0;
185 }
186 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
187 "Neohookean material parameters not found for entity %lu",
188 static_cast<unsigned long>(ent));
189 }
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
MatNeohookeanGeneric< MatElasticImpl< DIM > > A
std::vector< std::pair< Range, std::vector< double > > > paramVecByRange
Definition MatOps.hpp:162

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