25 PetscOptionsBegin(PETSC_COMM_WORLD,
"mooneyrivlin_",
"",
"none");
28 CHKERR PetscOptionsScalar(
"-beta",
"Beta",
"",
beta, &
beta, PETSC_NULLPTR);
42 std::string block_name =
"MAT_MOONEY_RIVLIN";
49 std::regex((boost::format(
"%s(.*)") % block_name).str()))
53 std::vector<double> block_data;
54 CHKERR m->getAttributes(block_data);
55 auto get_block_ents = [&]() {
58 m->meshset, ents,
true),
59 "can not get block entities");
64 m->getMeshsetId(), get_block_ents(),
73 const Range &block_entities,
74 const std::vector<double> &block_data)
override {
77 if (block_data.size() < 4) {
79 "Expected that block has four attributes (alpha, "
80 "beta, lambda, epsilon), but given " +
81 std::to_string(block_data.size()));
83 std::vector<double> params = {block_data[0], block_data[1], block_data[2],
89 << block_name <<
" alpha = " << params[0] <<
" beta = " << params[1]
90 <<
" lambda = " << params[2] <<
" epsilon = " << params[3];
99 if (std::find(range.begin(), range.end(), ent) != range.end()) {
100 set_param_vec(
A::tAg, param_vec.size(), param_vec.data());
123 auto t_F = getFTensor2FromPtr<DIM, DIM>(
125 auto t_P = getFTensor2FromPtr<DIM, DIM>(
150 auto p_alpha = mkparam(
alpha);
151 auto p_beta = mkparam(
beta);
152 auto p_lambda = mkparam(
lambda);
153 auto p_epsilon = mkparam(
epsilon);
155 ta_F(
i,
J) <<= t_F(
i,
J);
164 ta_Cof(
i,
I) = det_aF * ta_invF(
I,
i);
166 A = ta_F(
k,
K) * ta_F(
k,
K);
167 B = ta_Cof(
k,
K) * ta_Cof(
k,
K);
170 ta_BCof(
i,
I) = 4 *
beta * (
B * ta_Cof(
i,
I));
171 ta_Bj = (-12 *
alpha - 24 *
beta) / det_aF +
175 ta_P(
i,
I) = ta_BF(
i,
I);
176 ta_P(
i,
I) += (levi_civita(
i,
j,
k) * ta_BCof(
j,
J)) *
177 (levi_civita(
I,
J,
K) * ta_F(
k,
K));
178 ta_P(
i,
I) += ta_Cof(
i,
I) * ta_Bj;
181 ta_P(
i,
I) >>= t_P(
i,
I);
198boost::shared_ptr<PhysicalEquations>
200 boost::shared_ptr<MatOpsData> mat_ops_data_ptr,
int tag) {
201 return boost::make_shared<MatMooneyRivlinWriggersEq63<3>>(mat_ops_data_ptr,
206boost::shared_ptr<PhysicalEquations>
209 boost::shared_ptr<MatOpsData> mat_ops_data_ptr,
int tag) {
210 return boost::make_shared<MatMooneyRivlinWriggersEq63<2>>(mat_ops_data_ptr,
#define MOFEM_TAG_AND_LOG(channel, severity, tag)
Tag and log in channel.
#define FTENSOR_INDEX(DIM, I)
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define CHK_MOAB_THROW(err, msg)
Check error code of MoAB function and throw MoFEM exception.
@ MOFEM_DATA_INCONSISTENCY
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'J', DIM1 > J
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
boost::shared_ptr< PhysicalEquations > createMatOpsPhysicalEquationsPtr< ELASTICITY::MOONEYRIVLINWRIGGERSEQ63, MODEL_3D >(boost::shared_ptr< MatOpsData > mat_ops_data_ptr, int tag)
boost::shared_ptr< PhysicalEquations > createMatOpsPhysicalEquationsPtr(boost::shared_ptr< MatOpsData > mat_ops_data_ptr, int tag)
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
UBlasMatrix< double > MatrixDouble
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
FTensor::Index< 'm', 3 > m
static bool useDeformationGradient
MoFEMErrorCode getOptions(MoFEM::Interface *m_field_ptr=nullptr) override
MoFEMErrorCode recordTape() override
MoFEMErrorCode setParams(FEMethod *fe_ptr, int gg) override
std::vector< double > defaultMaterialParameters
MoFEMErrorCode addBlockParameters(MoFEM::Interface &, const std::string &block_name, int, const Range &block_entities, const std::vector< double > &block_data) override
std::vector< std::pair< Range, std::vector< double > > > paramVecByRange
boost::shared_ptr< MatOpsData > matOpsDataPtr
Deprecated interface functions.
Structure for user loop methods on finite elements.
EntityHandle getFEEntityHandle() const
Get the entity handle of the current finite element.
Interface for managing meshsets containing materials and boundary conditions.