12static auto G_eff(
double C10,
double tau) {
13 return 2.0 * C10 * std::exp(-2.0 * tau / 3.0);
16static auto E_eff(
double C10,
double K,
double tau) {
17 const double G = 2.0 * C10 * std::exp(-2.0 * tau / 3.0);
18 return G * (3.0 * K + 2.0 *
G) / (K +
G);
21static auto nu_eff(
double C10,
double K,
double tau) {
22 const double G = 2.0 * C10 * std::exp(-2.0 * tau / 3.0);
23 return K / (2.0 * (K +
G));
26static auto calc_c10(
double E,
double nu) {
return E / (4.0 * (1.0 + nu)); };
31 return E * nu / ((1.0 + nu) * (1.0 - 2.0 * nu));
47 double diagonal_strain) {
69 boost::shared_ptr<HMHHencky> hencky_ptr)
72 std::fill(&doEntities[MBVERTEX], &doEntities[MBMAXTYPE],
false);
73 doEntities[MBVERTEX] =
true;
77 EntitiesFieldData::EntData &data) {
94 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
95 boost::shared_ptr<PhysicalEquations> physics_ptr) {
97 auto henckyPtr = boost::dynamic_pointer_cast<HMHHencky>(physics_ptr);
101 "Can not get data from block");
104 for (
const auto &b : henckyPtr->blockData) {
108 <<
"Found non-homogeneous material block: " << b.blockName;
115 data_ptr, boost::dynamic_pointer_cast<HMHHencky>(physics_ptr)));
118 data_ptr, boost::dynamic_pointer_cast<HMHHencky>(physics_ptr)));
122 template <
int STRIDEMATD = 0>
126 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
127 const double alpha_u);
142 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
143 const double alpha_u) {
154 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
155 boost::shared_ptr<ExternalStrainVec> &external_strain_vec_ptr,
156 std::map<std::string, boost::shared_ptr<ScalingMethod>> smv);
167 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
168 boost::shared_ptr<ExternalStrainVec> external_strain_vec_ptr,
169 std::map<std::string, boost::shared_ptr<ScalingMethod>> smv) {
171 external_strain_vec_ptr, smv);
174 template <
int STRIDEMATD = 0>
178 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
192 std::string row_field, std::string col_field,
193 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
const double alpha) {
217 template <
int STRIDEMATD>
221 boost::shared_ptr<double> total_energy_ptr);
231 boost::shared_ptr<double> total_energy_ptr) {
240 template <
int STRIDEMATD = 0>
243 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
244 boost::shared_ptr<MatrixDouble> strain_ptr,
245 boost::shared_ptr<MatrixDouble> stress_ptr,
246 boost::shared_ptr<HMHHencky> hencky_ptr);
250 boost::shared_ptr<DataAtIntegrationPts>
258 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
259 boost::shared_ptr<PhysicalEquations> physics_ptr,
260 boost::shared_ptr<MatrixDouble> strain_ptr)
override {
261 auto henckyPtr = boost::dynamic_pointer_cast<HMHHencky>(physics_ptr);
265 "Can not get data from block");
268 for (
const auto &b : henckyPtr->blockData) {
272 <<
"Found non-homogeneous material block: " << b.blockName;
280 strain_ptr ? strain_ptr : data_ptr->getLogStretchTensorAtPts(),
281 data_ptr->getApproxPAtPts(),
282 boost::dynamic_pointer_cast<HMHHencky>(physics_ptr));
286 strain_ptr ? strain_ptr : data_ptr->getLogStretchTensorAtPts(),
287 data_ptr->getApproxPAtPts(),
288 boost::dynamic_pointer_cast<HMHHencky>(physics_ptr));
293 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
294 boost::shared_ptr<PhysicalEquations> physics_ptr) {
295 auto henckyPtr = boost::dynamic_pointer_cast<HMHHencky>(physics_ptr);
299 "Can not get data from block");
302 for (
const auto &b : henckyPtr->blockData) {
306 <<
"Found non-homogeneous material block: " << b.blockName;
313 data_ptr, data_ptr->getVarLogStreachPts(), data_ptr->getVarPiolaPts(),
314 boost::dynamic_pointer_cast<HMHHencky>(physics_ptr));
317 data_ptr, data_ptr->getVarLogStreachPts(), data_ptr->getVarPiolaPts(),
318 boost::dynamic_pointer_cast<HMHHencky>(physics_ptr));
322 MoFEMErrorCode
getOptions(boost::shared_ptr<DataAtIntegrationPts> data_ptr) {
324 PetscOptionsBegin(PETSC_COMM_WORLD,
"hencky_",
"",
"none");
326 CHKERR PetscOptionsScalar(
"-young_modulus",
"Young modulus",
"",
E, &
E,
328 CHKERR PetscOptionsScalar(
"-poisson_ratio",
"poisson ratio",
"",
nu, &
nu,
330 CHKERR PetscOptionsBool(
"-effective_neohookean_stiffness",
331 "Use effective Neo-Hookean stiffness",
"",
334 CHKERR PetscOptionsScalar(
"-effective_diagonal_strain",
335 "Diagonal logarithmic strain for effective "
336 "Neo-Hookean stiffness",
343 <<
"Hencky: E = " <<
E <<
" nu = " <<
nu
344 <<
" effective_neohookean_stiffness = "
359 (boost::format(
"(.*)%s(.*)") %
"_ELASTIC").str()
371 for (
auto m : meshset_vec_ptr) {
373 std::string block_name =
m->getName();
375 auto block_name_heterogeneous =
"(.*)HETEROGENEOUS_ELASTIC(.*)";
376 auto block_name_analytical =
"(.*)ANALYTICAL_ELASTIC(.*)";
377 std::regex reg_name_heterogeneous(block_name_heterogeneous);
378 std::regex reg_name_analytical(block_name_analytical);
379 const bool is_heterogeneous =
380 std::regex_match(block_name, reg_name_heterogeneous);
381 const bool is_analytical =
382 std::regex_match(block_name, reg_name_analytical);
384 std::vector<double> block_data;
385 CHKERR m->getAttributes(block_data);
386 if (block_data.size() < 2) {
388 "Expected that block has atleast two attributes");
390 auto get_block_ents = [&]() {
400 if (is_heterogeneous) {
402 }
else if (is_analytical) {
428 template <
int STRIDEMATD,
typename OP_PTR>
430 OP_PTR op_ptr, EntitiesFieldData::EntData &data,
431 boost::shared_ptr<DataAtIntegrationPts> dataAtGaussPts) {
434 auto getMaterialParams = [&](
double E,
double nu) {
446 auto fe_ent = op_ptr->getNumeredEntFiniteElementPtr()->getEnt();
447 int nb_integration_pts = op_ptr->getGaussPts().size2();
449 dataAtGaussPts->muAtPts.resize(nb_integration_pts,
false);
450 dataAtGaussPts->lambdaAtPts.resize(nb_integration_pts,
false);
451 dataAtGaussPts->muAtPts.clear();
452 dataAtGaussPts->lambdaAtPts.clear();
454 dataAtGaussPts->youngModulusAtPts.resize(nb_integration_pts,
false);
455 dataAtGaussPts->youngModulusAtPts.clear();
457 auto t_young_modulus =
458 getFTensor0FromVec(dataAtGaussPts->youngModulusAtPts);
459 auto t_mu = getFTensor0FromVec(dataAtGaussPts->muAtPts);
460 auto t_lambda = getFTensor0FromVec(dataAtGaussPts->lambdaAtPts);
463 GetFTensor4DdgFromMatType<SPACE_DIM, SPACE_DIM, STRIDEMATD, DL>,
464 DL>::size(dataAtGaussPts->matD, nb_integration_pts);
466 GetFTensor4DdgFromMatType<SPACE_DIM, SPACE_DIM, STRIDEMATD, DL>,
467 DL>::size(dataAtGaussPts->matAxiatorD, nb_integration_pts);
469 GetFTensor4DdgFromMatType<SPACE_DIM, SPACE_DIM, STRIDEMATD, DL>,
470 DL>::size(dataAtGaussPts->matDeviatorD, nb_integration_pts);
472 GetFTensor4DdgFromMatType<SPACE_DIM, SPACE_DIM, STRIDEMATD, DL>,
473 DL>::size(dataAtGaussPts->matInvD, nb_integration_pts);
475 dataAtGaussPts->matD.clear();
476 dataAtGaussPts->matAxiatorD.clear();
477 dataAtGaussPts->matDeviatorD.clear();
478 dataAtGaussPts->matInvD.clear();
486 auto t_D = getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, STRIDEMATD>(
487 dataAtGaussPts->matD);
488 auto t_axiator_D = getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, STRIDEMATD>(
489 dataAtGaussPts->matAxiatorD);
490 auto t_deviator_D = getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, STRIDEMATD>(
491 dataAtGaussPts->matDeviatorD);
492 auto t_inv_D = getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, STRIDEMATD>(
493 dataAtGaussPts->matInvD);
509 t_deviator_D(
i,
j,
k,
l) =
511 t_D(
i,
j,
k,
l) = t_axiator_D(
i,
j,
k,
l) + t_deviator_D(
i,
j,
k,
l);
520 t_inv_D(
i,
j,
k,
l) =
528 if (b.blockEnts.find(op_ptr->getFEEntityHandle()) != b.blockEnts.end()) {
531 VectorDouble analytical_elastic;
534 auto t_analytical_elastic = getFTensor0FromVec(analytical_elastic);
536 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
537 const auto material_params =
538 getMaterialParams(t_analytical_elastic, b.poissonRatio);
539 t_young_modulus = material_params.youngModulus;
540 t_mu = material_params.shearModulusG;
541 t_lambda = material_params.lambda;
543 CHKERR evalMatD(material_params.bulkModulusK,
544 material_params.shearModulusG);
545 CHKERR evalInvMatDPtr(material_params.bulkModulusK,
546 material_params.shearModulusG);
547 ++t_analytical_elastic;
552 Tag tag_heterogenous_mat;
553 CHKERR op_ptr->getPtrFE()->mField.get_moab().tag_get_handle(
555 tag_heterogenous_mat);
557 CHKERR op_ptr->getPtrFE()->mField.get_moab().tag_get_length(
558 tag_heterogenous_mat, tag_length);
559 if (tag_length != 1) {
561 "heterogeneous Young's modulus tag should be 1 but is %d",
566 double elem_young_mod = 0.0;
567 CHKERR op_ptr->getPtrFE()->mField.get_moab().tag_get_data(
568 tag_heterogenous_mat, &fe_ent, 1, &elem_young_mod);
570 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
571 const auto material_params =
572 getMaterialParams(elem_young_mod, b.poissonRatio);
573 t_young_modulus = material_params.youngModulus;
574 t_mu = material_params.shearModulusG;
575 t_lambda = material_params.lambda;
577 CHKERR evalMatD(material_params.bulkModulusK,
578 material_params.shearModulusG);
579 CHKERR evalInvMatDPtr(material_params.bulkModulusK,
580 material_params.shearModulusG);
585 const EntityHandle *vert_conn;
587 CHKERR op_ptr->getPtrFE()->mField.get_moab().get_connectivity(
588 fe_ent, vert_conn, vert_num,
true);
590 VectorDouble vert_young_mod(vert_num);
591 CHKERR op_ptr->getPtrFE()->mField.get_moab().tag_get_data(
592 tag_heterogenous_mat, vert_conn, vert_num, &vert_young_mod[0]);
594 auto t_shape_n = data.getFTensor0N();
595 int nb_shape_fn = data.getN(
NOBASE).size2();
597 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
599 auto t_vert_young_mod = getFTensor0FromVec(vert_young_mod);
600 for (
int bb = 0; bb != nb_shape_fn; ++bb) {
601 t_young_modulus += t_vert_young_mod * t_shape_n;
605 const auto material_params =
606 getMaterialParams(t_young_modulus, b.poissonRatio);
607 t_young_modulus = material_params.youngModulus;
608 t_mu = material_params.shearModulusG;
609 t_lambda = material_params.lambda;
611 CHKERR evalMatD(material_params.bulkModulusK,
612 material_params.shearModulusG);
613 CHKERR evalInvMatDPtr(material_params.bulkModulusK,
614 material_params.shearModulusG);
619 "Unsupported heterogeneous Young's modulus interpolation "
625 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
626 t_young_modulus = b.youngModulus;
627 t_mu = b.shearModulusG;
628 t_lambda = b.bulkModulusK - 2 * b.shearModulusG / 3;
630 CHKERR evalMatD(b.bulkModulusK, b.shearModulusG);
631 CHKERR evalInvMatDPtr(b.bulkModulusK, b.shearModulusG);
640 const auto material_params = getMaterialParams(this->E, this->
nu);
643 dataAtGaussPts->mu = material_params.shearModulusG;
644 dataAtGaussPts->lambda = material_params.lambda;
646 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
647 t_young_modulus = material_params.youngModulus;
648 t_mu = material_params.shearModulusG;
649 t_lambda = material_params.lambda;
650 CHKERR evalMatD(material_params.bulkModulusK,
651 material_params.shearModulusG);
652 CHKERR evalInvMatDPtr(material_params.bulkModulusK,
653 material_params.shearModulusG);
663 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
664 SmartPetscObj<Vec> assemble_vec,
665 boost::shared_ptr<TopologicalData> topo_ptr,
666 const double alpha_u,
667 boost::shared_ptr<double> J_ptr);
675 MoFEMErrorCode
assemble(
int row_side, EntityType row_type,
683 boost::shared_ptr<double>
JPtr;
689 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
690 SmartPetscObj<Vec> assemble_vec,
691 boost::shared_ptr<TopologicalData> topo_ptr,
692 const double alpha_u,
693 boost::shared_ptr<double> J_ptr)
override {
695 topo_ptr, alpha_u, J_ptr);
723template <
int STRIDEMATD>
726 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
const double alpha_u)
729 CHK_MOAB_THROW(PetscOptionsGetBool(PETSC_NULLPTR,
"",
"-poly_convex",
731 "get polyconvex option failed");
734template <
int STRIDEMATD>
740 "Polyconvex Hencky with heterogeneous material properties is not "
744 CHKERR integratePolyconvexHencky(data);
746 CHKERR integrateHencky(data);
751template <
int STRIDEMATD>
759 int nb_dofs = data.getIndices().size();
760 int nb_integration_pts = data.getN().size1();
761 auto v = getVolume();
762 auto t_w = getFTensor0IntegrationWeight();
763 auto t_approx_P_adjoint_log_du =
764 dataAtPts->getFTensorAdjointPdU(nb_integration_pts);
765 auto t_log_stretch_h1 =
766 dataAtPts->getFTensorLogStretchTotal(nb_integration_pts);
767 auto t_dot_log_u = dataAtPts->getFTensorLogStretchDot(nb_integration_pts);
769 auto t_D = getFTensor4DdgFromMat<3, 3, STRIDEMATD>(dataAtPts->matD);
775 auto get_ftensor2 = [](
auto &
v) {
777 &
v[0], &
v[1], &
v[2], &
v[3], &
v[4], &
v[5]);
780 int nb_base_functions = data.getN().size2();
781 auto t_row_base_fun = data.getFTensor0N();
783 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
785 auto t_nf = get_ftensor2(nF);
789 t_D(
i,
j,
k,
l) * (t_log_stretch_h1(
k,
l) + alphaU * t_dot_log_u(
k,
l));
792 a * (t_approx_P_adjoint_log_du(L) - t_L(
i,
j, L) * t_T(
i,
j));
795 for (; bb != nb_dofs / 6; ++bb) {
796 t_nf(L) -= t_row_base_fun * t_residual(L);
800 for (; bb != nb_base_functions; ++bb)
805 ++t_approx_P_adjoint_log_du;
813template <
int STRIDEMATD>
822 int nb_dofs = data.getIndices().size();
823 int nb_integration_pts = data.getN().size1();
824 auto v = getVolume();
825 auto t_w = getFTensor0IntegrationWeight();
826 auto t_approx_P_adjoint_log_du =
827 dataAtPts->getFTensorAdjointPdU(nb_integration_pts);
828 auto t_log_stretch_h1 =
829 dataAtPts->getFTensorLogStretchTotal(nb_integration_pts);
830 auto t_dot_log_u = dataAtPts->getFTensorLogStretchDot(nb_integration_pts);
832 auto t_D = getFTensor4DdgFromMat<3, 3, 0>(dataAtPts->matD);
838 auto get_ftensor2 = [](
auto &
v) {
840 &
v[0], &
v[1], &
v[2], &
v[3], &
v[4], &
v[5]);
843 constexpr double nohat_k = 1. / 4;
844 constexpr double hat_k = 1. / 8;
845 double mu = dataAtPts->mu;
846 double lambda = dataAtPts->lambda;
848 constexpr double third = boost::math::constants::third<double>();
852 int nb_base_functions = data.getN().size2();
853 auto t_row_base_fun = data.getFTensor0N();
854 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
856 auto t_nf = get_ftensor2(nF);
858 double log_det = t_log_stretch_h1(
i,
i);
859 double log_det2 = log_det * log_det;
862 double dev_norm2 = t_dev(
i,
j) * t_dev(
i,
j);
865 auto A = 2 *
mu * std::exp(nohat_k * dev_norm2);
866 auto B =
lambda * std::exp(hat_k * log_det2) * log_det;
869 A * (t_dev(
k,
l) * t_diff_deviator(
k,
l,
i,
j))
877 alphaU * t_D(
i,
j,
k,
l) * t_dot_log_u(
k,
l);
881 a * (t_approx_P_adjoint_log_du(L) - t_L(
i,
j, L) * t_T(
i,
j));
884 for (; bb != nb_dofs /
size_symm; ++bb) {
885 t_nf(L) -= t_row_base_fun * t_residual(L);
889 for (; bb != nb_base_functions; ++bb)
893 ++t_approx_P_adjoint_log_du;
900template <
int STRIDEMATD>
902 std::string row_field, std::string col_field,
903 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
const double alpha)
908 CHK_MOAB_THROW(PetscOptionsGetBool(PETSC_NULLPTR,
"",
"-poly_convex",
910 "get polyconvex option failed");
915 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
916 boost::shared_ptr<ExternalStrainVec> &external_strain_vec_ptr,
917 std::map<std::string, boost::shared_ptr<ScalingMethod>> smv)
919 externalStrainVecPtr(external_strain_vec_ptr), scalingMethodsMap(smv) {}
935 for (
auto &ext_strain_block : (*externalStrainVecPtr)) {
937 if (ext_strain_block.ents.find(fe_ent) != ext_strain_block.ents.end()) {
940 if (scalingMethodsMap.find(ext_strain_block.blockName) !=
941 scalingMethodsMap.end()) {
943 scalingMethodsMap.at(ext_strain_block.blockName)->getScale(time);
946 <<
"No scaling method found for " << ext_strain_block.blockName;
949 int nb_dofs = data.getIndices().size();
950 int nb_integration_pts = data.getN().size1();
951 auto v = getVolume();
952 auto t_w = getFTensor0IntegrationWeight();
955 double external_strain_val;
956 VectorDouble v_external_strain;
957 auto block_name =
"(.*)ANALYTICAL_EXTERNALSTRAIN(.*)";
958 std::regex reg_name(block_name);
959 if (std::regex_match(ext_strain_block.blockName, reg_name)) {
960 VectorDouble analytical_external_strain;
961 std::string block_name_tmp;
962 std::tie(block_name_tmp, v_external_strain) =
964 ext_strain_block.blockName);
967 external_strain_val =
scale * ext_strain_block.val;
969 v_external_strain.resize(nb_integration_pts);
970 std::fill(v_external_strain.begin(), v_external_strain.end(),
971 external_strain_val);
973 auto t_external_strain = getFTensor0FromVec(v_external_strain);
981 auto get_ftensor2 = [](
auto &
v) {
983 &
v[0], &
v[1], &
v[2], &
v[3], &
v[4], &
v[5]);
986 int nb_base_functions = data.getN().size2();
987 auto t_row_base_fun = data.getFTensor0N();
988 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
989 auto tr = 3.0 * t_external_strain;
991 auto t_nf = get_ftensor2(nF);
998 t_residual(L) =
a * (t_L(
i,
j, L) * t_T(
i,
j));
1001 for (; bb != nb_dofs / 6; ++bb) {
1002 t_nf(L) += t_row_base_fun * t_residual(L);
1006 for (; bb != nb_base_functions; ++bb)
1008 ++t_external_strain;
1017template <
int STRIDEMATD>
1024 "Polyconvex Hencky with heterogeneous material properties is not "
1028 CHKERR integratePolyconvexHencky(row_data, col_data);
1030 CHKERR integrateHencky(row_data, col_data);
1035template <
int STRIDEMATD>
1045 int nb_integration_pts = row_data.getN().size1();
1046 int row_nb_dofs = row_data.getIndices().size();
1047 int col_nb_dofs = col_data.getIndices().size();
1049 auto get_ftensor2 = [](MatrixDouble &
m,
const int r,
const int c) {
1053 &
m(r + 0,
c + 0), &
m(r + 0,
c + 1), &
m(r + 0,
c + 2), &
m(r + 0,
c + 3),
1054 &
m(r + 0,
c + 4), &
m(r + 0,
c + 5),
1056 &
m(r + 1,
c + 0), &
m(r + 1,
c + 1), &
m(r + 1,
c + 2), &
m(r + 1,
c + 3),
1057 &
m(r + 1,
c + 4), &
m(r + 1,
c + 5),
1059 &
m(r + 2,
c + 0), &
m(r + 2,
c + 1), &
m(r + 2,
c + 2), &
m(r + 2,
c + 3),
1060 &
m(r + 2,
c + 4), &
m(r + 2,
c + 5),
1062 &
m(r + 3,
c + 0), &
m(r + 3,
c + 1), &
m(r + 3,
c + 2), &
m(r + 3,
c + 3),
1063 &
m(r + 3,
c + 4), &
m(r + 3,
c + 5),
1065 &
m(r + 4,
c + 0), &
m(r + 4,
c + 1), &
m(r + 4,
c + 2), &
m(r + 4,
c + 3),
1066 &
m(r + 4,
c + 4), &
m(r + 4,
c + 5),
1068 &
m(r + 5,
c + 0), &
m(r + 5,
c + 1), &
m(r + 5,
c + 2), &
m(r + 5,
c + 3),
1069 &
m(r + 5,
c + 4), &
m(r + 5,
c + 5)
1076 auto v = getVolume();
1077 auto t_w = getFTensor0IntegrationWeight();
1079 auto t_approx_P_adjoint__dstretch =
1080 dataAtPts->getFTensorAdjointPdstretch(nb_integration_pts);
1081 auto t_eigen_vals = dataAtPts->getFTensorEigenVals(nb_integration_pts);
1082 auto t_eigen_vecs = dataAtPts->getFTensorEigenVecs(nb_integration_pts);
1084 int row_nb_base_functions = row_data.getN().size2();
1085 auto t_row_base_fun = row_data.getFTensor0N();
1087 auto get_dP = [&]() {
1090 DL>::size(dP, nb_integration_pts);
1091 auto ts_a = getTSa();
1093 auto t_D = getFTensor4DdgFromMat<3, 3, STRIDEMATD>(dataAtPts->matD);
1095 if constexpr (!STRIDEMATD) {
1096 t_dP_tmp(L,
J) = -(1 + alphaU * ts_a) *
1097 (t_L(
i,
j, L) * ((t_D(
i,
j,
m,
n) * t_diff(
m,
n,
k,
l)) *
1102 L_left(
i,
j, L) = t_L(
i,
j, L);
1104 L_right(
k,
l,
J) = t_L(
k,
l,
J);
1109 auto t_approx_P_adjoint__dstretch =
1110 dataAtPts->getFTensorAdjointPdstretch(nb_integration_pts);
1111 auto t_eigen_vals = dataAtPts->getFTensorEigenVals(nb_integration_pts);
1112 auto t_eigen_vecs = dataAtPts->getFTensorEigenVecs(nb_integration_pts);
1113 auto &nbUniq = dataAtPts->nbUniq;
1115 auto t_dP = get_stress();
1116 for (
auto gg = 0; gg != nb_integration_pts; ++gg) {
1117 if constexpr (STRIDEMATD) {
1121 -(1 + alphaU * ts_a) *
1130 t_sym(
i,
j) = (t_approx_P_adjoint__dstretch(
i,
j) ||
1131 t_approx_P_adjoint__dstretch(
j,
i));
1136 t_dP(L,
J) = t_L(
i,
j, L) *
1137 ((t_diff2_uP2(
i,
j,
k,
l) + t_diff2_uP2(
k,
l,
i,
j)) *
1143 ++t_approx_P_adjoint__dstretch;
1148 auto t_dP = get_stress();
1149 for (
auto gg = 0; gg != nb_integration_pts; ++gg) {
1150 if constexpr (STRIDEMATD) {
1154 -(1 + alphaU * ts_a) *
1159 t_dP(L,
J) = t_dP_tmp(L,
J);
1165 return get_stress();
1168 auto t_dP = get_dP();
1170 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1174 for (; rr != row_nb_dofs / 6; ++rr) {
1175 auto t_col_base_fun = col_data.getFTensor0N(gg, 0);
1176 auto t_m = get_ftensor2(K, 6 * rr, 0);
1177 for (
int cc = 0; cc != col_nb_dofs / 6; ++cc) {
1178 const double b =
a * t_row_base_fun * t_col_base_fun;
1179 t_m(L,
J) -= b * t_dP(L,
J);
1186 for (; rr != row_nb_base_functions; ++rr) {
1196template <
int STRIDEMATD>
1207 int nb_integration_pts = row_data.getN().size1();
1208 int row_nb_dofs = row_data.getIndices().size();
1209 int col_nb_dofs = col_data.getIndices().size();
1211 auto get_ftensor2 = [](MatrixDouble &
m,
const int r,
const int c) {
1215 &
m(r + 0,
c + 0), &
m(r + 0,
c + 1), &
m(r + 0,
c + 2), &
m(r + 0,
c + 3),
1216 &
m(r + 0,
c + 4), &
m(r + 0,
c + 5),
1218 &
m(r + 1,
c + 0), &
m(r + 1,
c + 1), &
m(r + 1,
c + 2), &
m(r + 1,
c + 3),
1219 &
m(r + 1,
c + 4), &
m(r + 1,
c + 5),
1221 &
m(r + 2,
c + 0), &
m(r + 2,
c + 1), &
m(r + 2,
c + 2), &
m(r + 2,
c + 3),
1222 &
m(r + 2,
c + 4), &
m(r + 2,
c + 5),
1224 &
m(r + 3,
c + 0), &
m(r + 3,
c + 1), &
m(r + 3,
c + 2), &
m(r + 3,
c + 3),
1225 &
m(r + 3,
c + 4), &
m(r + 3,
c + 5),
1227 &
m(r + 4,
c + 0), &
m(r + 4,
c + 1), &
m(r + 4,
c + 2), &
m(r + 4,
c + 3),
1228 &
m(r + 4,
c + 4), &
m(r + 4,
c + 5),
1230 &
m(r + 5,
c + 0), &
m(r + 5,
c + 1), &
m(r + 5,
c + 2), &
m(r + 5,
c + 3),
1231 &
m(r + 5,
c + 4), &
m(r + 5,
c + 5)
1242 auto v = getVolume();
1243 auto t_w = getFTensor0IntegrationWeight();
1245 int row_nb_base_functions = row_data.getN().size2();
1246 auto t_row_base_fun = row_data.getFTensor0N();
1248 auto get_dP = [&]() {
1251 DL>::size(dP, nb_integration_pts);
1252 auto ts_a = getTSa();
1254 auto t_D = getFTensor4DdgFromPtr<3, 3, 0>(&*dataAtPts->matD.data().begin());
1256 constexpr double nohat_k = 1. / 4;
1257 constexpr double hat_k = 1. / 8;
1258 double mu = dataAtPts->mu;
1259 double lambda = dataAtPts->lambda;
1261 constexpr double third = boost::math::constants::third<double>();
1265 auto t_approx_P_adjoint__dstretch =
1266 dataAtPts->getFTensorAdjointPdstretch(getGaussPts().size2());
1267 auto t_log_stretch_h1 =
1268 dataAtPts->getFTensorLogStretchTotal(getGaussPts().size2());
1269 auto t_eigen_vals = dataAtPts->getFTensorEigenVals(getGaussPts().size2());
1270 auto t_eigen_vecs = dataAtPts->getFTensorEigenVecs(getGaussPts().size2());
1271 auto &nbUniq = dataAtPts->nbUniq;
1273 auto t_dP = get_stress();
1274 for (
auto gg = 0; gg != nb_integration_pts; ++gg) {
1276 double log_det = t_log_stretch_h1(
i,
i);
1277 double log_det2 = log_det * log_det;
1279 t_dev(
i,
j) = t_log_stretch_h1(
i,
j) -
t_kd(
i,
j) * (
third * log_det);
1280 double dev_norm2 = t_dev(
i,
j) * t_dev(
i,
j);
1282 auto A = 2 *
mu * std::exp(nohat_k * dev_norm2);
1283 auto B =
lambda * std::exp(hat_k * log_det2) * log_det;
1287 (
A * 2 * nohat_k) * (t_dev(
k,
l) * t_diff_deviator(
k,
l,
i,
j));
1288 t_B_diff(
i,
j) = (
B * 2 * hat_k) * log_det *
t_kd(
i,
j) +
1292 t_A_diff(
i,
j) * (t_dev(
m,
n) * t_diff_deviator(
m,
n,
k,
l))
1296 A * t_diff_deviator(
m,
n,
i,
j) * t_diff_deviator(
m,
n,
k,
l)
1302 t_dP(L,
J) = -t_L(
i,
j, L) *
1309 (alphaU * ts_a) * (t_D(
i,
j,
m,
n) * t_diff(
m,
n,
k,
l)
1319 t_sym(
i,
j) = (t_approx_P_adjoint__dstretch(
i,
j) ||
1320 t_approx_P_adjoint__dstretch(
j,
i));
1325 t_dP(L,
J) += t_L(
i,
j, L) *
1326 ((t_diff2_uP2(
i,
j,
k,
l) + t_diff2_uP2(
k,
l,
i,
j)) *
1332 ++t_approx_P_adjoint__dstretch;
1338 return get_stress();
1341 auto t_dP = get_dP();
1342 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1346 for (; rr != row_nb_dofs / 6; ++rr) {
1347 auto t_col_base_fun = col_data.getFTensor0N(gg, 0);
1348 auto t_m = get_ftensor2(K, 6 * rr, 0);
1349 for (
int cc = 0; cc != col_nb_dofs / 6; ++cc) {
1350 const double b =
a * t_row_base_fun * t_col_base_fun;
1351 t_m(L,
J) -= b * t_dP(L,
J);
1358 for (; rr != row_nb_base_functions; ++rr) {
1368template <
int STRIDEMATD>
1370 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
1371 boost::shared_ptr<double> total_energy_ptr)
1373 totalEnergyPtr(total_energy_ptr) {
1377 "dataAtPts is not allocated. Please set it before "
1378 "using this operator.");
1382template <
int STRIDEMATD>
1393 int nb_integration_pts = getGaussPts().size2();
1394 auto t_log_u = dataAtPts->getFTensorLogStretchTotal(nb_integration_pts);
1397 auto &mat_d = dataAtPts->matD;
1400 "wrong matD size, number of columns should be %d but is %zu",
1403 if constexpr (STRIDEMATD != 0) {
1404 if (mat_d.size1() != nb_integration_pts) {
1406 "wrong matD size, number of rows should be %d but is %zu",
1407 nb_integration_pts, mat_d.size1());
1412 auto t_D = getFTensor4DdgFromMat<3, 3, STRIDEMATD>(dataAtPts->matD);
1414 dataAtPts->energyAtPts.resize(nb_integration_pts,
false);
1415 auto t_energy = getFTensor0FromVec(dataAtPts->energyAtPts);
1417 for (
auto gg = 0; gg != nb_integration_pts; ++gg) {
1419 t_energy = 0.5 * (t_log_u(
i,
j) * (t_D(
i,
j,
k,
l) * t_log_u(
k,
l)));
1426 if (totalEnergyPtr) {
1427 auto t_w = getFTensor0IntegrationWeight();
1428 auto t_energy = getFTensor0FromVec(dataAtPts->energyAtPts);
1429 double loc_energy = 0;
1430 for (
auto gg = 0; gg != nb_integration_pts; ++gg) {
1431 loc_energy += t_energy * t_w;
1435 *totalEnergyPtr += getMeasure() * loc_energy;
1441template <
int STRIDEMATD>
1444 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
1445 boost::shared_ptr<MatrixDouble> strain_ptr,
1446 boost::shared_ptr<MatrixDouble> stress_ptr,
1447 boost::shared_ptr<HMHHencky> hencky_ptr)
1449 strainPtr(strain_ptr), stressPtr(stress_ptr), henckyPtr(hencky_ptr) {
1450 std::fill(&doEntities[MBVERTEX], &doEntities[MBMAXTYPE],
false);
1451 doEntities[MBVERTEX] =
true;
1454template <
int STRIDEMATD>
1466 auto nb_integration_pts = stressPtr->size1();
1468 if (nb_integration_pts != getGaussPts().size2()) {
1470 "inconsistent number of integration points");
1474 CHKERR henckyPtr->computeMaterialParamsAtPts<STRIDEMATD>(
this, data,
1478 MatrixSizeHelper<GetFTensor2SymmetricFromMatType<3, -1,
DL>,
DL>::size(
1479 *strainPtr, nb_integration_pts);
1480 auto t_strain = get_strain();
1482 auto t_inv_D = getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, STRIDEMATD>(
1483 dataAtPts->matInvD);
1486 getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, STRIDEMATD>(dataAtPts->matD);
1493 for (
auto gg = 0; gg != nb_integration_pts; ++gg) {
1494 t_strain(
i,
j) = t_inv_D(
i,
j,
k,
l) * t_stress(
k,
l);
1498 t_stress_symm_debug(
i,
j) = (t_stress(
i,
j) || t_stress(
j,
i)) / 2;
1500 t_stress_symm_debug_diff(
i,
j) =
1501 t_D(
i,
j,
k,
l) * t_strain(
k,
l) - t_stress_symm_debug(
i,
j);
1503 t_stress_symm_debug_diff(
i,
j) * t_stress_symm_debug_diff(
i,
j);
1504 double nrm0 = t_stress_symm_debug(
i,
j) * t_stress_symm_debug(
i,
j) +
1505 std::numeric_limits<double>::epsilon();
1506 constexpr double eps = 1e-10;
1507 if (std::fabs(std::sqrt(nrm / nrm0)) >
eps) {
1509 <<
"Stress symmetry check failed: " << std::endl
1510 << t_stress_symm_debug_diff << std::endl
1513 "Norm is too big: " + std::to_string(nrm / nrm0));
1526template <
typename OP_PTR>
1527std::tuple<std::string, VectorDouble>
1529 const std::string block_name) {
1531 auto nb_gauss_pts = op_ptr->getGaussPts().size2();
1533 auto ts_time = op_ptr->getTStime();
1534 auto ts_time_step = op_ptr->getTStimeStep();
1540 MatrixDouble m_ref_coords = op_ptr->getCoordsAtGaussPts();
1543 ts_time_step, ts_time, nb_gauss_pts, m_ref_coords, block_name);
1546 if (v_analytical_expr.size() != nb_gauss_pts)
1548 "Wrong number of integration pts");
1551 return std::make_tuple(block_name, v_analytical_expr);
1554template <
typename OP_PTR>
1557 auto nb_gauss_pts = op_ptr->getGaussPts().size2();
1559 auto ts_time = op_ptr->getTStime();
1560 auto ts_time_step = op_ptr->getTStimeStep();
1567 MatrixDouble m_ref_coords = op_ptr->getCoordsAtGaussPts();
1570 ts_time_step, ts_time, nb_gauss_pts, m_ref_coords, block_name);
1573 if (v_analytical_expr.size() != nb_gauss_pts)
1575 "Wrong number of integration pts");
1578 return v_analytical_expr;
1585 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
1586 SmartPetscObj<Vec> assemble_vec,
1587 boost::shared_ptr<TopologicalData> topo_ptr,
const double alpha_u,
1588 boost::shared_ptr<double> J_ptr)
1590 JPtr(J_ptr), topoDataPtr(topo_ptr), assembleVec(assemble_vec) {
1592 CHK_MOAB_THROW(PetscOptionsGetBool(PETSC_NULLPTR,
"",
"-poly_convex",
1594 "get polyconvex option failed");
1600 CHKERR integratePolyconvexHencky(data);
1602 CHKERR integrateHencky(data);
1614 int nb_dofs = data.getIndices().size();
1615 int nb_integration_pts = data.getN().size1();
1616 auto v = getVolume();
1620 auto get_ftensor1 = [](
auto &
v) {
1622 &
v[0], &
v[1], &
v[2]);
1626 int nb_base_functions = data.getN().size2();
1628 auto integrate = [&](
auto t_D) {
1631 auto t_w = getFTensor0IntegrationWeight();
1632 auto t_det = topoDataPtr->getFTensorDetJacobian(nb_integration_pts);
1633 auto t_inv_jac = topoDataPtr->getFTensorInvJacobian(nb_integration_pts);
1635 auto t_var_log_u = dataAtPts->getFTensorVarLogStreach(nb_integration_pts);
1636 auto t_approx_P = dataAtPts->getFTensorApproxP(nb_integration_pts);
1637 auto t_approx_P_adjoint_log_du =
1638 dataAtPts->getFTensorAdjointPdU(nb_integration_pts);
1640 dataAtPts->getFTensorSmallHdLogStretch(nb_integration_pts);
1641 auto t_log_stretch_h1 =
1642 dataAtPts->getFTensorLogStretchTotal(nb_integration_pts);
1650 auto t_diff_base = data.getFTensor1DiffN<
SPACE_DIM>();
1651 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1652 const double a =
v * t_w;
1655 t_T(
i,
j) = t_D(
i,
j,
k,
l) *
1656 (t_log_stretch_h1(
k,
l) );
1659 t_stress_residual(L) = t_L(
i,
j, L) * t_T(
i,
j);
1662 t_residual(L) = t_approx_P_adjoint_log_du(L) - t_stress_residual(L);
1664 locJ -= (
a * t_det) * t_residual(L) * t_var_log_u(L);
1667 t_cof(
I,
J) = t_det * t_inv_jac(
J,
I);
1669 const double var_stress_residual = t_var_log_u(L) * t_stress_residual(L);
1674 t_approx_P_adjoint_log_du_dX;
1675 t_approx_P_adjoint_log_du_dX(L,
I,
J) =
1676 t_h_dlog_u(
i,
I, L) * t_approx_P(
i,
J);
1679 t_residual_dX(
I,
J) =
1680 t_var_log_u(L) * t_approx_P_adjoint_log_du_dX(L,
I,
J) -
1681 var_stress_residual * t_cof(
I,
J);
1683 auto t_nf = get_ftensor1(nF);
1685 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
1686 t_nf(
i) -=
a * t_residual_dX(
i,
j) * t_diff_base(
j);
1690 for (; bb != nb_base_functions; ++bb)
1698 ++t_approx_P_adjoint_log_du;
1709 getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, 0>(dataAtPts->matD));
1712 getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM>(dataAtPts->matD));
1722 "Polyconvex Hencky is not implemented yet");
1727 EntityType row_type,
1731 double *vec_ptr = nF.data().data();
1732 const int nb_dofs = data.getIndices().size();
1733 int *ind_ptr = data.getIndices().data().data();
1734 CHKERR VecSetValues(assembleVec, nb_dofs, ind_ptr, vec_ptr, ADD_VALUES);
1736 if (row_type == MBVERTEX) {
#define MOFEM_TAG_AND_LOG(channel, severity, tag)
Tag and log in channel.
#define FTENSOR_INDEXES(DIM,...)
#define FTENSOR_INDEX(DIM, I)
static PetscErrorCode ierr
Fourth-order differential deviator tensor.
Fourth-order differential tensor symmetric in both index pairs.
Kronecker Delta class symmetric.
Mapping from symmetric tensor indices to packed storage index.
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
#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 CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
#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, severity)
Log.
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
FTensor::Index< 'i', SPACE_DIM > i
const double c
speed of light (cm/ns)
const double v
phase velocity of light in medium (cm/ns)
const double n
refractive index of diffusive medium
FTensor::Index< 'J', DIM1 > J
constexpr IntegrationType G
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
auto getDiffDiffMat(A &&t_val, B &&t_vec, Fun< double > f, Fun< double > d_f, Fun< double > dd_f, C &&t_S, const int nb)
Get the Diff Diff Mat object.
VectorDouble analytical_externalstrain_function(double delta_t, double t, int nb_gauss_pts, MatrixDouble &m_ref_coords, const std::string block_name)
static auto nu_eff(double C10, double K, double tau)
static auto G_eff(double C10, double tau)
std::tuple< std::string, VectorDouble > getAnalyticalExternalStrain(OP_PTR op_ptr, VectorDouble &analytical_expr, const std::string block_name)
static auto E_eff(double C10, double K, double tau)
static auto calc_effective_elastic_params(double E, double nu, double diagonal_strain)
VectorDouble analytical_elastic_function(double delta_t, double t, int nb_gauss_pts, MatrixDouble &m_ref_coords, const std::string block_name)
EntitiesFieldData::EntData EntData
ForcesAndSourcesCore::UserDataOperator UserDataOperator
static auto calc_c10(double E, double nu)
VectorDouble getAnalyticalElastic(OP_PTR op_ptr, const std::string block_name)
static auto calc_bulk_modulus(double lambda, double shear_modulus_G)
static constexpr auto size_symm
static auto calc_K(double E, double nu)
constexpr IntegrationType I
constexpr auto field_name
FTensor::Index< 'm', 3 > m
void temp(int x, int y=10)
static enum StretchSelector stretchSelector
static enum RotSelector gradApproximator
static std::string heterogeneousYoungModTagName
static int physicalStepNumber
static PetscBool physicalTimeFlg
static double currentPhysicalTime
static boost::function< double(const double)> f
static bool hasNonHomogeneousMaterialBlock
static boost::function< double(const double)> dd_f
static boost::function< double(const double)> d_f
static int meshTransferInterpOrder
static constexpr int SizeSymm
Calculate energy density for Hencky material model.
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
boost::shared_ptr< double > totalEnergyPtr
OpCalculateEnergy(boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< double > total_energy_ptr)
OpCalculateStretchFromStress(boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< MatrixDouble > strain_ptr, boost::shared_ptr< MatrixDouble > stress_ptr, boost::shared_ptr< HMHHencky > hencky_ptr)
boost::shared_ptr< MatrixDouble > stressPtr
boost::shared_ptr< HMHHencky > henckyPtr
boost::shared_ptr< MatrixDouble > strainPtr
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
MoFEMErrorCode evaluateLhs(EntData &data)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
boost::shared_ptr< DataAtIntegrationPts > dataAtGaussPts
OpHenckyJacobian(boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< HMHHencky > hencky_ptr)
MoFEMErrorCode evaluateRhs(EntData &data)
boost::shared_ptr< HMHHencky > henckyPtr
std::map< std::string, boost::shared_ptr< ScalingMethod > > scalingMethodsMap
boost::shared_ptr< ExternalStrainVec > externalStrainVecPtr
OpSpatialPhysicalExternalStrain(const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< ExternalStrainVec > &external_strain_vec_ptr, std::map< std::string, boost::shared_ptr< ScalingMethod > > smv)
MoFEMErrorCode integrate(EntData &data)
MoFEMErrorCode integrate(EntData &row_data, EntData &col_data)
MoFEMErrorCode integratePolyconvexHencky(EntData &row_data, EntData &col_data)
MoFEMErrorCode integrateHencky(EntData &row_data, EntData &col_data)
OpSpatialPhysical_du_du(std::string row_field, std::string col_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const double alpha)
MoFEMErrorCode integrate(EntData &data)
MoFEMErrorCode integrateHencky(EntData &data)
MoFEMErrorCode integratePolyconvexHencky(EntData &data)
OpSpatialPhysical(const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const double alpha_u)
OpTopoSpatialPhysical(const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, SmartPetscObj< Vec > assemble_vec, boost::shared_ptr< TopologicalData > topo_ptr, const double alpha_u, boost::shared_ptr< double > J_ptr)
MoFEMErrorCode assemble(int row_side, EntityType row_type, EntData &data) override
SmartPetscObj< Vec > assembleVec
boost::shared_ptr< TopologicalData > topoDataPtr
MoFEMErrorCode integratePolyconvexHencky(EntData &data)
MoFEMErrorCode integrateHencky(EntData &data)
MoFEMErrorCode integrate(EntData &data)
boost::shared_ptr< double > JPtr
MoFEMErrorCode computeMaterialParamsAtPts(OP_PTR op_ptr, EntitiesFieldData::EntData &data, boost::shared_ptr< DataAtIntegrationPts > dataAtGaussPts)
virtual VolUserDataOperator * returnOpTopoSpatialPhysical(const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, SmartPetscObj< Vec > assemble_vec, boost::shared_ptr< TopologicalData > topo_ptr, const double alpha_u, boost::shared_ptr< double > J_ptr) override
PetscBool effectiveNehookeanStiffness
virtual VolUserDataOperator * returnOpSpatialPhysical(const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const double alpha_u)
MoFEMErrorCode extractBlockData(Sev sev)
Sev getOptionsSeverityLevels
std::vector< BlockData > blockData
static constexpr int StrideMatD
MoFEMErrorCode extractBlockData(std::vector< const CubitMeshSets * > meshset_vec_ptr, Sev sev)
HMHHencky(MoFEM::Interface &m_field, const double E, const double nu)
VolUserDataOperator * returnOpCalculateVarStretchFromStress(boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< PhysicalEquations > physics_ptr)
VolUserDataOperator * returnOpCalculateEnergy(boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< double > total_energy_ptr)
MoFEMErrorCode getOptions(boost::shared_ptr< DataAtIntegrationPts > data_ptr)
VolUserDataOperator * returnOpCalculateStretchFromStress(boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< PhysicalEquations > physics_ptr, boost::shared_ptr< MatrixDouble > strain_ptr) override
VolUserDataOperator * returnOpSpatialPhysical_du_du(std::string row_field, std::string col_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const double alpha)
double effectiveDiagonalStrain
MoFEM::Interface & mField
virtual VolUserDataOperator * returnOpSpatialPhysicalExternalStrain(const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< ExternalStrainVec > external_strain_vec_ptr, std::map< std::string, boost::shared_ptr< ScalingMethod > > smv)
virtual UserDataOperator * returnOpJacobian(const bool eval_rhs, const bool eval_lhs, boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< PhysicalEquations > physics_ptr)
virtual moab::Interface & get_moab()=0
bool sYmm
If true assume that matrix is symmetric structure.
Deprecated interface functions.
EntityHandle getFEEntityHandle() const
Return finite element entity handle.
const FEMethod * getFEMethod() const
Return raw pointer to Finite Element Method object.
PetscReal ts_t
Current time value.
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
double young_modulus
Young modulus.
double poisson_ratio
Poisson ratio.