29 PetscOptionsBegin(PETSC_COMM_WORLD,
"stvenant_",
"",
"none");
30 CHKERR PetscOptionsScalar(
"-young_modulus",
"Young modulus",
"",
E, &
E,
32 CHKERR PetscOptionsScalar(
"-poisson_ratio",
"poisson ratio",
"",
nu, &
nu,
36 std::string block_name =
"MAT_STVENANTKIRCHHOFF";
43 std::regex((boost::format(
"%s(.*)") % block_name).str()))
47 std::vector<double> block_data;
48 CHKERR m->getAttributes(block_data);
49 auto get_block_ents = [&]() {
52 m->meshset, ents,
true),
53 "can not get block entities");
58 m->getMeshsetId(), get_block_ents(),
65 "Command line StVenantKirchhoff parameters")
66 <<
"E = " <<
E <<
" nu = " <<
nu;
74 const Range &block_entities,
75 const std::vector<double> &block_data)
override {
78 if (block_data.size() < 2) {
80 "StVenantKirchhoff block %s has %d attributes; expected E "
82 block_name.c_str(),
static_cast<int>(block_data.size()));
84 std::vector<double> params = {block_data[0], block_data[1]};
89 << block_name <<
" E = " << params[0] <<
" nu = " << params[1];
98 if (std::find(range.begin(), range.end(), ent) != range.end()) {
99 set_param_vec(
A::tAg, param_vec.size(), param_vec.data());
110 "StVenantKirchhoff material parameters not found for entity %lu",
111 static_cast<unsigned long>(ent));
129 auto t_F = getFTensor2FromPtr<DIM, DIM>(
131 auto t_P = getFTensor2FromPtr<DIM, DIM>(
152 auto p_E = mkparam(
E);
153 auto p_nu = mkparam(
nu);
159 ((1. + nu_value) * (1. - 2. * nu_value));
168 auto lambda = calc_lambda(p_E, p_nu);
169 auto mu = calc_mu(p_E, p_nu);
171 ta_F(
i,
J) <<= t_F(
i,
J);
177 ta_C(
I,
J) = ta_F(
i,
I) * ta_F(
i,
J);
184 ta_P(
i,
J) = ta_F(
i,
I) * ta_S(
I,
J);
186 ta_P(
i,
I) >>= t_P(
i,
I);
200boost::shared_ptr<PhysicalEquations>
202 boost::shared_ptr<MatOpsData> mat_ops_data_ptr,
int tag) {
203 return boost::make_shared<MatStVenantKirchhoff<3>>(mat_ops_data_ptr, tag);
207boost::shared_ptr<PhysicalEquations>
210 boost::shared_ptr<MatOpsData> mat_ops_data_ptr,
int tag) {
211 return boost::make_shared<MatStVenantKirchhoff<2>>(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
FTensor::Index< 'm', 3 > m
static bool useDeformationGradient
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.
double young_modulus
Young modulus.
double poisson_ratio
Poisson ratio.