28 PetscOptionsBegin(PETSC_COMM_WORLD,
"stvenant_",
"",
"none");
29 CHKERR PetscOptionsScalar(
"-young_modulus",
"Young modulus",
"",
E, &
E,
31 CHKERR PetscOptionsScalar(
"-poisson_ratio",
"poisson ratio",
"",
nu, &
nu,
35 std::string block_name =
"MAT_STVENANTKIRCHHOFF";
42 std::regex((boost::format(
"%s(.*)") % block_name).str()))
46 std::vector<double> block_data;
47 CHKERR m->getAttributes(block_data);
48 auto get_block_ents = [&]() {
51 m->meshset, ents,
true),
52 "can not get block entities");
57 get_block_ents(), block_data);
63 "Command line StVenantKirchhoff parameters")
64 <<
"E = " <<
E <<
" nu = " <<
nu;
72 const Range &block_entities,
73 const std::vector<double> &block_data)
override {
76 if (block_data.size() < 2) {
78 "StVenantKirchhoff block %s has %d attributes; expected E "
80 block_name.c_str(),
static_cast<int>(block_data.size()));
82 std::vector<double> params = {block_data[0], block_data[1]};
87 << block_name <<
" E = " << params[0] <<
" nu = " << params[1];
96 if (std::find(range.begin(), range.end(), ent) != range.end()) {
97 set_param_vec(
A::tAg, param_vec.size(), param_vec.data());
108 "StVenantKirchhoff material parameters not found for entity %lu",
109 static_cast<unsigned long>(ent));
130 ->resize(1, DIM * DIM,
false);
132 auto t_F = getFTensor2FromPtr<DIM, DIM>(
134 auto t_P = getFTensor2FromPtr<DIM, DIM>(
156 auto p_E = mkparam(
E);
157 auto p_nu = mkparam(
nu);
163 ((1. + nu_value) * (1. - 2. * nu_value));
172 auto lambda = calc_lambda(p_E, p_nu);
173 auto mu = calc_mu(p_E, p_nu);
175 ta_F(
i,
J) <<= t_F(
i,
J);
181 ta_C(
I,
J) = ta_F(
i,
I) * ta_F(
i,
J);
188 ta_P(
i,
J) = ta_F(
i,
I) * ta_S(
I,
J);
189 ta_energy =
mu * (ta_E(
I,
J) * ta_E(
I,
J)) + 0.5 *
lambda * trE * trE;
191 ta_P(
i,
I) >>= t_P(
i,
I);
192 ta_energy >>= (*energy_ptr)(0, 0);
206boost::shared_ptr<PhysicalEquations>
208 boost::shared_ptr<MatOpsData> mat_ops_data_ptr,
int tag) {
209 return boost::make_shared<MatStVenantKirchhoff<3>>(mat_ops_data_ptr, tag);
213boost::shared_ptr<PhysicalEquations>
216 boost::shared_ptr<MatOpsData> mat_ops_data_ptr,
int tag) {
217 return boost::make_shared<MatStVenantKirchhoff<2>>(mat_ops_data_ptr, tag);
221boost::shared_ptr<PhysicalEquations>
224 boost::shared_ptr<MatOpsData> mat_ops_data_ptr,
int tag) {
225 return boost::make_shared<MatStVenantKirchhoff<3>>(mat_ops_data_ptr, tag);
#define MOFEM_TAG_AND_LOG(channel, severity, tag)
Tag and log in channel.
#define FTENSOR_INDEX(DIM, I)
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#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
boost::shared_ptr< PhysicalEquations > createMatOpsPhysicalEquationsPtr< ELASTICITY::STVENANTKIRCHHOFF, 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
constexpr IntegrationType I
double young_modulus
Young modulus.
double poisson_ratio
Poisson ratio.
FTensor::Index< 'm', 3 > m
static bool useDeformationGradient
Otherwise the displacement gradient is supplied and I is added.
MoFEMErrorCode setParams(FEMethod *fe_ptr, int gg) override
MoFEMErrorCode addBlockParameters(MoFEM::Interface &, const std::string &block_name, int, const Range &block_entities, const std::vector< double > &block_data) override
MoFEMErrorCode recordTape() override
MoFEMErrorCode getOptions(MoFEM::Interface *m_field_ptr=nullptr) override
std::vector< double > commandLineParameters
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.