14 #include <boost/math/constants/constants.hpp>
18 #include <boost/python.hpp>
19 #include <boost/python/def.hpp>
20 #include <boost/python/numpy.hpp>
21 namespace bp = boost::python;
22 namespace np = boost::python::numpy;
24 #pragma message "With PYTHON_SDF"
28 #pragma message "Without PYTHON_SDF"
47 const std::string block_name) {
53 std::regex((boost::format(
"%s(.*)") % block_name).str())
60 bc->getMeshsetIdEntitiesByDimension(m_field.
get_moab(), 2, faces,
true),
78 return MatSetValues<AssemblyTypeSelector<SCHUR>>(
79 op_ptr->
getKSPB(), row_data, col_data,
m, ADD_VALUES);
88 double EshelbianCore::exponentBase = exp(1);
91 EshelbianCore::d_f_log;
93 EshelbianCore::dd_f_log;
94 boost::function<
double(
const double)> EshelbianCore::inv_f =
95 EshelbianCore::inv_f_log;
96 boost::function<
double(
const double)> EshelbianCore::inv_d_f =
97 EshelbianCore::inv_d_f_log;
98 boost::function<
double(
const double)> EshelbianCore::inv_dd_f =
99 EshelbianCore::inv_dd_f_log;
102 EshelbianCore::query_interface(boost::typeindex::type_index type_index,
121 : mField(m_field), piolaStress(
"P"), eshelbyStress(
"S"),
122 spatialL2Disp(
"wL2"), spatialH1Disp(
"wH1"), contactDisp(
"contactDisp"),
123 materialL2Disp(
"W"), stretchTensor(
"u"), rotAxis(
"omega"),
124 materialGradient(
"G"), tauField(
"TAU"), lambdaField(
"LAMBDA"),
125 bubbleField(
"BUBBLE"), elementVolumeName(
"EP"),
126 naturalBcElement(
"NATURAL_BC"), essentialBcElement(
"ESSENTIAL_BC"),
127 skinElement(
"SKIN_ELEMENT"), contactElement(
"CONTACT_ELEMENT") {
130 CHKERRABORT(PETSC_COMM_WORLD,
ierr);
137 const char *list_rots[] = {
"small",
"moderate",
"large"};
141 const char *list_stretches[] = {
"linear",
"log"};
144 CHKERR PetscOptionsBegin(PETSC_COMM_WORLD,
"",
"Eshelbian plasticity",
148 CHKERR PetscOptionsInt(
"-space_order",
"approximation oder for space",
"",
151 CHKERR PetscOptionsInt(
"-space_h1_order",
"approximation oder for space",
"",
155 CHKERR PetscOptionsInt(
"-material_order",
"approximation oder for material",
159 CHKERR PetscOptionsScalar(
"-viscosity_alpha_u",
"viscosity",
"",
alphaU,
163 CHKERR PetscOptionsScalar(
"-viscosity_alpha_w",
"viscosity",
"",
alphaW,
167 CHKERR PetscOptionsScalar(
"-density_alpha_rho",
"density",
"",
alphaRho,
171 CHKERR PetscOptionsScalar(
"-preconditioner_eps",
"preconditioner_eps",
"",
175 CHKERR PetscOptionsScalar(
"-preconditioner_eps_omega",
"preconditioner_eps",
178 CHKERR PetscOptionsScalar(
"-preconditioner_eps_w",
"preconditioner_eps",
"",
181 CHKERR PetscOptionsScalar(
"-preconditioner_eps_contact_disp",
185 CHKERR PetscOptionsEList(
"-rotations",
"rotations",
"", list_rots,
186 LARGE_ROT + 1, list_rots[choice_rot], &choice_rot,
188 CHKERR PetscOptionsEList(
"-grad",
"gradient of defamation approximate",
"",
189 list_rots,
LARGE_ROT + 1, list_rots[choice_grad],
190 &choice_grad, PETSC_NULL);
196 list_stretches[choice_stretch], &choice_stretch, PETSC_NULL);
198 ierr = PetscOptionsEnd();
241 MOFEM_LOG(
"EP", Sev::inform) <<
"Gradient of deformation "
247 MOFEM_LOG(
"EP", Sev::inform) <<
"Base exponent e";
248 MOFEM_LOG(
"EP", Sev::inform) <<
"Stretch " << list_stretches[choice_stretch];
261 Range tets_skin_part;
263 CHKERR skin.find_skin(0, tets,
false, tets_skin_part);
264 ParallelComm *pcomm =
267 CHKERR pcomm->filter_pstatus(tets_skin_part,
268 PSTATUS_SHARED | PSTATUS_MULTISHARED,
269 PSTATUS_NOT, -1, &tets_skin);
273 tets_skin = subtract(tets_skin,
v.faces);
277 tets_skin = subtract(tets_skin,
v.faces);
281 tets_skin = subtract(tets_skin,
v.faces);
284 auto subtract_faces_where_displacements_are_applied =
285 [&](
const std::string block_name) {
288 tets_skin = subtract(tets_skin, contact_range);
291 CHKERR subtract_faces_where_displacements_are_applied(
"CONTACT");
295 moab::Interface::UNION);
296 Range faces_not_on_the_skin = subtract(faces, tets_skin);
298 auto add_hdiv_field = [&](
const std::string
field_name,
const int order,
310 auto add_l2_field = [
this, meshset](
const std::string
field_name,
311 const int order,
const int dim) {
320 auto add_h1_field = [
this, meshset](
const std::string
field_name,
321 const int order,
const int dim) {
333 auto add_l2_field_by_range = [
this](
const std::string
field_name,
334 const int order,
const int dim,
335 const int field_dim,
Range &&
r) {
345 auto add_bubble_field = [
this, meshset](
const std::string
field_name,
346 const int order,
const int dim) {
352 auto field_order_table =
353 const_cast<Field *
>(field_ptr)->getFieldOrderTable();
354 auto get_cgg_bubble_order_zero = [](
int p) {
return 0; };
355 auto get_cgg_bubble_order_tet = [](
int p) {
358 field_order_table[MBVERTEX] = get_cgg_bubble_order_zero;
359 field_order_table[MBEDGE] = get_cgg_bubble_order_zero;
360 field_order_table[MBTRI] = get_cgg_bubble_order_zero;
361 field_order_table[MBTET] = get_cgg_bubble_order_tet;
400 auto add_field_to_fe = [
this](
const std::string fe,
440 auto add_field_to_fe = [
this](
const std::string fe,
449 Range natural_bc_elements;
452 natural_bc_elements.merge(
v.faces);
457 natural_bc_elements.merge(
v.faces);
460 Range essentail_bc_elements;
463 essentail_bc_elements.merge(
v.faces);
481 auto get_skin = [&]() {
486 CHKERR skin.find_skin(0, body_ents,
false, skin_ents);
490 auto filter_true_skin = [&](
auto &&skin) {
492 ParallelComm *pcomm =
494 CHKERR pcomm->filter_pstatus(skin, PSTATUS_SHARED | PSTATUS_MULTISHARED,
495 PSTATUS_NOT, -1, &boundary_ents);
496 return boundary_ents;
499 auto skin = filter_true_skin(get_skin());
510 MOFEM_LOG(
"EP", Sev::inform) <<
"Contact elements " << contact_range.size();
544 auto remove_dofs_on_essential_spatial_stress_boundary =
545 [&](
const std::string prb_name) {
547 for (
int d : {0, 1, 2})
553 CHKERR remove_dofs_on_essential_spatial_stress_boundary(
"ESHELBY_PLASTICITY");
597 PetscSection section;
602 CHKERR PetscSectionDestroy(§ion);
615 ->pushMarkDOFsOnEntities<DisplacementCubitBcData>(
622 : blockName(name), faces(faces) {
623 vals.resize(3,
false);
624 flags.resize(3,
false);
625 for (
int ii = 0; ii != 3; ++ii) {
627 flags[ii] =
static_cast<int>(attr[ii + 3]);
630 MOFEM_LOG(
"EP", Sev::inform) <<
"Add BCDisp " << name;
632 <<
"Add BCDisp vals " <<
vals[0] <<
" " <<
vals[1] <<
" " <<
vals[2];
634 <<
"Add BCDisp flags " <<
flags[0] <<
" " <<
flags[1] <<
" " <<
flags[2];
635 MOFEM_LOG(
"EP", Sev::inform) <<
"Add BCDisp nb. of faces " <<
faces.size();
639 : blockName(name), faces(faces) {
640 vals.resize(3,
false);
641 for (
int ii = 0; ii != 3; ++ii) {
649 : blockName(name), faces(faces) {
650 vals.resize(3,
false);
651 flags.resize(3,
false);
652 for (
int ii = 0; ii != 3; ++ii) {
654 flags[ii] =
static_cast<int>(attr[ii + 3]);
657 MOFEM_LOG(
"EP", Sev::inform) <<
"Add BCForce " << name;
659 <<
"Add BCForce vals " <<
vals[0] <<
" " <<
vals[1] <<
" " <<
vals[2];
661 <<
"Add BCForce flags " <<
flags[0] <<
" " <<
flags[1] <<
" " <<
flags[2];
662 MOFEM_LOG(
"EP", Sev::inform) <<
"Add BCForce nb. of faces " <<
faces.size();
667 boost::shared_ptr<TractionFreeBc> &bc_ptr,
668 const std::string contact_set_name) {
674 Range tets_skin_part;
676 CHKERR skin.find_skin(0, tets,
false, tets_skin_part);
677 ParallelComm *pcomm =
680 CHKERR pcomm->filter_pstatus(tets_skin_part,
681 PSTATUS_SHARED | PSTATUS_MULTISHARED,
682 PSTATUS_NOT, -1, &tets_skin);
685 for (
int dd = 0;
dd != 3; ++
dd)
686 (*bc_ptr)[
dd] = tets_skin;
691 (*bc_ptr)[0] = subtract((*bc_ptr)[0],
v.faces);
693 (*bc_ptr)[1] = subtract((*bc_ptr)[1],
v.faces);
695 (*bc_ptr)[2] = subtract((*bc_ptr)[2],
v.faces);
700 (*bc_ptr)[0] = subtract((*bc_ptr)[0],
v.faces);
701 (*bc_ptr)[1] = subtract((*bc_ptr)[1],
v.faces);
702 (*bc_ptr)[2] = subtract((*bc_ptr)[2],
v.faces);
707 std::regex((boost::format(
"%s(.*)") % contact_set_name).str()))) {
711 (*bc_ptr)[0] = subtract((*bc_ptr)[0], faces);
712 (*bc_ptr)[1] = subtract((*bc_ptr)[1], faces);
713 (*bc_ptr)[2] = subtract((*bc_ptr)[2], faces);
742 return p_data + p_data + (p_data - 1);
749 int operator()(
int p_row,
int p_col,
int p_data)
const {
return 2 * p_data; }
764 boost::shared_ptr<BaseFunctionCtx> ctx_ptr) {
769 int nb_gauss_pts = pts.size2();
774 if (pts.size1() < 3) {
776 "Wrong dimension of pts, should be at least 3 rows with "
803 "Wrong base, should be USER_BASE");
811 const int nb_gauss_pts = pts.size2();
816 phi.resize(mat.size1(), mat.size2(),
false);
820 shapeFun.resize(nb_gauss_pts, 4,
false);
822 &pts(2, 0), nb_gauss_pts);
824 double diff_shape_fun[12];
830 phi.resize(nb_gauss_pts, 9 * nb_base_functions,
false);
853 const int tag,
const bool do_rhs,
const bool do_lhs,
854 boost::shared_ptr<VolumeElementForcesAndSourcesCore> &fe) {
856 fe = boost::make_shared<VolumeElementForcesAndSourcesCore>(
mField);
858 fe->getUserPolynomialBase() =
889 fe->getOpPtrVector().push_back(
896 if (std::abs(
alphaRho) > std::numeric_limits<double>::epsilon()) {
908 fe->getOpPtrVector().push_back(
919 const int tag,
const bool add_elastic,
const bool add_material,
920 boost::shared_ptr<VolumeElementForcesAndSourcesCore> &fe_rhs,
921 boost::shared_ptr<VolumeElementForcesAndSourcesCore> &fe_lhs) {
924 auto time_scale = boost::make_shared<TimeScale>();
931 fe_rhs->getOpPtrVector().push_back(
933 fe_rhs->getOpPtrVector().push_back(
935 fe_rhs->getOpPtrVector().push_back(
937 fe_rhs->getOpPtrVector().push_back(
939 fe_rhs->getOpPtrVector().push_back(
941 fe_rhs->getOpPtrVector().push_back(
945 using BodyNaturalBC =
947 Assembly<PETSC>::LinearForm<
GAUSS>;
949 BodyNaturalBC::OpFlux<NaturalMeshsetType<BLOCKSET>, 1, 3>;
950 CHKERR BodyNaturalBC::AddFluxToPipeline<OpBodyForce>::add(
951 fe_rhs->getOpPtrVector(),
mField,
"w", {time_scale},
"BODY_FORCE",
961 const bool symmetric_system =
970 if (!symmetric_system) {
985 if (!symmetric_system) {
990 fe_lhs->getOpPtrVector().push_back(
1001 if (
precEpsOmega > std::numeric_limits<double>::epsilon()) {
1002 fe_lhs->getOpPtrVector().push_back(
1003 new OpMassStab(
rotAxis,
rotAxis, [
this](
double,
double,
double) {
1008 std::numeric_limits<double>::epsilon()) {
1010 fe_lhs->getOpPtrVector().push_back(
new OpMassStab(
1012 [
this](
double,
double,
double) {
return precEpsW; }));
1024 const bool add_elastic,
const bool add_material,
1025 boost::shared_ptr<FaceElementForcesAndSourcesCore> &fe_rhs,
1026 boost::shared_ptr<FaceElementForcesAndSourcesCore> &fe_lhs) {
1029 fe_rhs = boost::make_shared<FaceElementForcesAndSourcesCore>(
mField);
1030 fe_lhs = boost::make_shared<FaceElementForcesAndSourcesCore>(
mField);
1043 fe_rhs->getOpPtrVector().push_back(
1047 boost::make_shared<TimeScale>(
"disp_history.txt")
1050 fe_rhs->getOpPtrVector().push_back(
1059 boost::shared_ptr<ContactTree> &fe_contact_tree,
1060 boost::shared_ptr<FaceElementForcesAndSourcesCore> &fe_face_rhs,
1061 boost::shared_ptr<FaceElementForcesAndSourcesCore> &fe_face_lhs
1067 auto get_body_range = [
this](
auto name,
int dim) {
1068 std::map<int, Range> map;
1073 (boost::format(
"%s(.*)") % name).str()
1082 map[m_ptr->getMeshsetId()] = ents;
1088 auto get_map_skin = [
this](
auto &&map) {
1089 ParallelComm *pcomm =
1093 for(
auto &
m : map) {
1095 CHKERR skin.find_skin(0,
m.second,
false, skin_faces);
1097 PSTATUS_SHARED | PSTATUS_MULTISHARED,
1098 PSTATUS_NOT, -1,
nullptr),
1100 m.second.swap(skin_faces);
1110 fe_face_rhs = boost::make_shared<BoundaryEle>(
mField);
1111 fe_face_lhs = boost::make_shared<BoundaryEle>(
mField);
1112 auto rule = [](
int,
int,
int o) {
return -1; };
1116 &levels, PETSC_NULL);
1118 auto refine = Tools::refineTriangle(levels);
1120 auto set_rule = [levels, refine](
1123 int order_col,
int order_data
1127 auto rule = 2 * order_data;
1128 fe_raw_ptr->gaussPts = Tools::refineTriangleIntegrationPts(rule, refine);
1132 fe_face_rhs->getRuleHook = rule;
1133 fe_face_lhs->getRuleHook = rule;
1134 fe_face_rhs->setRuleHook = set_rule;
1135 fe_face_lhs->setRuleHook = set_rule;
1138 fe_face_rhs->getOpPtrVector(), {HDIV});
1140 fe_face_lhs->getOpPtrVector(), {HDIV});
1142 auto add_contact_three = [&]() {
1144 auto tree_moab_ptr = boost::make_shared<moab::Core>();
1145 fe_contact_tree = boost::make_shared<ContactTree>(
1147 get_map_skin(get_body_range(
"BODY", 3)));
1148 auto contact_common_data_ptr = boost::make_shared<ContactOps::CommonData>();
1150 fe_contact_tree->getOpPtrVector(), {HDIV});
1151 fe_contact_tree->getOpPtrVector().push_back(
1153 contactDisp, contact_common_data_ptr->contactDispPtr()));
1154 fe_contact_tree->getOpPtrVector().push_back(
1156 piolaStress, contact_common_data_ptr->contactTractionPtr()));
1158 auto u_h1_ptr = boost::make_shared<MatrixDouble>();
1159 fe_contact_tree->getOpPtrVector().push_back(
1161 fe_contact_tree->getOpPtrVector().push_back(
1162 new OpMoveNode(fe_contact_tree, contact_common_data_ptr, u_h1_ptr));
1166 auto add_ops_face_lhs = [&](
auto &pip) {
1168 auto contact_common_data_ptr = boost::make_shared<ContactOps::CommonData>();
1170 contactDisp, contact_common_data_ptr->contactDispPtr()));
1172 piolaStress, contact_common_data_ptr->contactTractionPtr()));
1173 auto u_h1_ptr = boost::make_shared<MatrixDouble>();
1176 fe_contact_tree, contact_common_data_ptr, u_h1_ptr,
1179 auto contact_sfd_map_range_ptr = boost::make_shared<std::map<int, Range>>(
1180 get_body_range(
"CONTACT_SDF", 2));
1184 contact_sfd_map_range_ptr));
1187 contact_sfd_map_range_ptr));
1199 pip.push_back(
new OpMassStab(
1208 auto add_ops_face_rhs = [&](
auto &pip) {
1210 auto contact_common_data_ptr = boost::make_shared<ContactOps::CommonData>();
1212 piolaStress, contact_common_data_ptr->contactTractionPtr()));
1214 contactDisp, contact_common_data_ptr->contactDispPtr()));
1215 auto u_h1_ptr = boost::make_shared<MatrixDouble>();
1218 fe_contact_tree, contact_common_data_ptr, u_h1_ptr,
1220 auto contact_sfd_map_range_ptr = boost::make_shared<std::map<int, Range>>(
1221 get_body_range(
"CONTACT_SDF", 2));
1223 contactDisp, contact_common_data_ptr, fe_contact_tree,
1224 contact_sfd_map_range_ptr));
1226 piolaStress, contact_common_data_ptr, fe_contact_tree));
1232 CHKERR add_contact_three();
1233 CHKERR add_ops_face_lhs(fe_face_lhs->getOpPtrVector());
1234 CHKERR add_ops_face_rhs(fe_face_rhs->getOpPtrVector());
1245 boost::make_shared<ForcesAndSourcesCore::UserDataOperator::AdjCache>();
1247 auto get_op_contact_bc = [&]() {
1251 return op_loop_side;
1254 auto op_contact_bc = get_op_contact_bc();
1255 elasticFeLhs->getOpPtrVector().push_back(op_contact_bc);
1267 boost::shared_ptr<FEMethod>
null;
1268 boost::shared_ptr<FeTractionBc> spatial_traction_bc(
1271 if (std::abs(
alphaRho) > std::numeric_limits<double>::epsilon()) {
1281 spatial_traction_bc);
1296 spatial_traction_bc);
1314 boost::shared_ptr<ContactOps::SDFPython> sdf_python_ptr;
1316 auto file_exists = [](std::string myfile) {
1317 std::ifstream file(myfile.c_str());
1324 if (file_exists(
"sdf.py")) {
1325 MOFEM_LOG(
"EP", Sev::inform) <<
"sdf.py file found";
1326 sdf_python_ptr = boost::make_shared<ContactOps::SDFPython>();
1327 CHKERR sdf_python_ptr->sdfInit(
"sdf.py");
1328 ContactOps::sdfPythonWeakPtr = sdf_python_ptr;
1330 MOFEM_LOG(
"EP", Sev::warning) <<
"sdf.py file NOT found";
1335 boost::shared_ptr<TsCtx>
ts_ctx;
1344 CHKERR TSAppendOptionsPrefix(ts,
"elastic_");
1345 CHKERR TSSetFromOptions(ts);
1350 CHKERR TSGetSNES(ts, &snes);
1352 PetscViewerAndFormat *vf;
1353 CHKERR PetscViewerAndFormatCreate(PETSC_VIEWER_STDOUT_WORLD,
1354 PETSC_VIEWER_DEFAULT, &vf);
1357 (
MoFEMErrorCode(*)(SNES, PetscInt, PetscReal,
void *))SNESMonitorFields,
1360 PetscSection section;
1363 CHKERR PetscSectionGetNumFields(section, &num_fields);
1364 for (
int ff = 0; ff != num_fields; ff++) {
1372 CHKERR VecGhostUpdateBegin(x, INSERT_VALUES, SCATTER_FORWARD);
1373 CHKERR VecGhostUpdateEnd(x, INSERT_VALUES, SCATTER_FORWARD);
1376 boost::shared_ptr<SetUpSchur> schur_ptr;
1383 ts_ctx_ptr->zeroMatrix =
false;
1386 if (std::abs(
alphaRho) > std::numeric_limits<double>::epsilon()) {
1387 CHKERR TSSetI2Function(ts,
f, PETSC_NULL, PETSC_NULL);
1388 CHKERR TSSetI2Jacobian(ts,
m, p, PETSC_NULL, PETSC_NULL);
1390 CHKERR TSSetIFunction(ts,
f, PETSC_NULL, PETSC_NULL);
1391 CHKERR TSSetIJacobian(ts,
m, p, PETSC_NULL, PETSC_NULL);
1395 CHKERR SNESGetKSP(snes, &ksp);
1397 CHKERR KSPGetPC(ksp, &pc);
1400 CHKERR schur_ptr->setUp(ksp);
1405 CHKERR schur_ptr->preProc();
1419 CHKERR schur_ptr->postProc();
1424 if (std::abs(
alphaRho) > std::numeric_limits<double>::epsilon()) {
1426 CHKERR VecDuplicate(x, &xx);
1427 CHKERR VecZeroEntries(xx);
1428 CHKERR TS2SetSolution(ts, x, xx);
1431 CHKERR TSSetSolution(ts, x);
1438 CHKERR TSSolve(ts, PETSC_NULL);
1442 int lin_solver_iterations;
1443 CHKERR SNESGetLinearSolveIterations(snes, &lin_solver_iterations);
1445 <<
"Number of linear solver iterations " << lin_solver_iterations;
1447 PetscBool test_cook_flg = PETSC_FALSE;
1450 if (test_cook_flg) {
1451 constexpr
int expected_lin_solver_iterations = 11;
1466 const std::string file) {
1478 auto contact_common_data_ptr = boost::make_shared<ContactOps::CommonData>();
1480 auto domain_ops = [&](
auto &fe) {
1482 fe.getUserPolynomialBase() =
1501 fe.getOpPtrVector().push_back(
1517 CHKERR domain_ops(*(op_loop_side->getSideFEPtr()));
1525 auto u_h1_ptr = boost::make_shared<MatrixDouble>();
1526 auto lambda_h1_ptr = boost::make_shared<MatrixDouble>();
1535 piolaStress, contact_common_data_ptr->contactTractionPtr()));
1552 auto post_proc_norm_fe =
1553 boost::make_shared<VolumeElementForcesAndSourcesCore>(
mField);
1555 auto post_proc_norm_rule_hook = [](
int,
int,
int p) ->
int {
1558 post_proc_norm_fe->getRuleHook = post_proc_norm_rule_hook;
1560 post_proc_norm_fe->getUserPolynomialBase() =
1564 post_proc_norm_fe->getOpPtrVector(), {L2, H1, HDIV});
1566 enum NORMS { U_NORM_L2 = 0, U_NORM_H1, PIOLA_NORM, U_ERROR_L2, LAST_NORM };
1569 CHKERR VecZeroEntries(norms_vec);
1571 auto u_l2_ptr = boost::make_shared<MatrixDouble>();
1572 auto u_h1_ptr = boost::make_shared<MatrixDouble>();
1573 post_proc_norm_fe->getOpPtrVector().push_back(
1575 post_proc_norm_fe->getOpPtrVector().push_back(
1577 post_proc_norm_fe->getOpPtrVector().push_back(
1579 post_proc_norm_fe->getOpPtrVector().push_back(
1581 post_proc_norm_fe->getOpPtrVector().push_back(
1585 auto piola_ptr = boost::make_shared<MatrixDouble>();
1586 post_proc_norm_fe->getOpPtrVector().push_back(
1588 post_proc_norm_fe->getOpPtrVector().push_back(
1592 *post_proc_norm_fe);
1594 CHKERR VecAssemblyBegin(norms_vec);
1595 CHKERR VecAssemblyEnd(norms_vec);
1596 const double *norms;
1597 CHKERR VecGetArrayRead(norms_vec, &norms);
1598 MOFEM_LOG(
"EP", Sev::inform) <<
"norm_u: " << std::sqrt(norms[U_NORM_L2]);
1599 MOFEM_LOG(
"EP", Sev::inform) <<
"norm_u_h1: " << std::sqrt(norms[U_NORM_H1]);
1601 <<
"norm_error_u_l2: " << std::sqrt(norms[U_ERROR_L2]);
1603 <<
"norm_piola: " << std::sqrt(norms[PIOLA_NORM]);
1604 CHKERR VecRestoreArrayRead(norms_vec, &norms);
1619 for (
auto bc : bc_mng->getBcMapByBlockName()) {
1620 if (
auto disp_bc = bc.second->dispBcPtr) {
1622 MOFEM_LOG(
"EP", Sev::noisy) << *disp_bc;
1624 std::vector<double> block_attributes(6, 0.);
1625 if (disp_bc->data.flag1 == 1) {
1626 block_attributes[0] = disp_bc->data.value1;
1627 block_attributes[3] = 1;
1629 if (disp_bc->data.flag2 == 1) {
1630 block_attributes[1] = disp_bc->data.value2;
1631 block_attributes[4] = 1;
1633 if (disp_bc->data.flag3 == 1) {
1634 block_attributes[2] = disp_bc->data.value3;
1635 block_attributes[5] = 1;
1637 auto faces = bc.second->bcEnts.subset_by_dimension(2);
1657 for (
auto bc : bc_mng->getBcMapByBlockName()) {
1658 if (
auto force_bc = bc.second->forceBcPtr) {
1659 std::vector<double> block_attributes(6, 0.);
1660 block_attributes[0] = -force_bc->data.value3 * force_bc->data.value1;
1661 block_attributes[3] = 1;
1662 block_attributes[1] = -force_bc->data.value4 * force_bc->data.value1;
1663 block_attributes[4] = 1;
1664 block_attributes[2] = -force_bc->data.value5 * force_bc->data.value1;
1665 block_attributes[5] = 1;
1666 auto faces = bc.second->bcEnts.subset_by_dimension(2);