12 using namespace MoFEM;
112 #include <boost/python.hpp>
113 #include <boost/python/def.hpp>
114 #include <boost/python/numpy.hpp>
115 namespace bp = boost::python;
116 namespace np = boost::python::numpy;
125 #endif // ADD_CONTACT
148 boost::shared_ptr<ClosestPointProjection>
cpPtr;
152 boost::shared_ptr<ContactOps::SDFPython> sdfPythonPtr;
154 #endif // ADD_CONTACT
162 CHKERR boundaryCondition();
192 enum bases { AINSWORTH, DEMKOWICZ, LASBASETOPT };
193 const char *list_bases[LASBASETOPT] = {
"ainsworth",
"demkowicz"};
194 PetscInt choice_base_value = AINSWORTH;
196 LASBASETOPT, &choice_base_value, PETSC_NULL);
201 switch (choice_base_value) {
205 <<
"Set AINSWORTH_LEGENDRE_BASE for displacements";
210 <<
"Set DEMKOWICZ_JACOBI_BASE for displacements";
227 auto get_skin = [&]() {
229 CHKERR mField.get_moab().get_entities_by_dimension(0,
SPACE_DIM, body_ents);
230 Skinner skin(&mField.get_moab());
232 CHKERR skin.find_skin(0, body_ents,
false, skin_ents);
236 auto filter_blocks = [&](
auto skin) {
237 bool is_contact_block =
false;
242 (boost::format(
"%s(.*)") %
"CONTACT").str()
251 <<
"Find contact block set: " <<
m->getName();
252 auto meshset =
m->getMeshset();
253 Range contact_meshset_range;
254 CHKERR mField.get_moab().get_entities_by_dimension(
255 meshset,
SPACE_DIM - 1, contact_meshset_range,
true);
258 contact_meshset_range);
259 contact_range.merge(contact_meshset_range);
261 if (is_contact_block) {
263 <<
"Nb entities in contact surface: " << contact_range.size();
265 skin = intersect(skin, contact_range);
270 auto filter_true_skin = [&](
auto skin) {
272 ParallelComm *pcomm =
274 CHKERR pcomm->filter_pstatus(skin, PSTATUS_SHARED | PSTATUS_MULTISHARED,
275 PSTATUS_NOT, -1, &boundary_ents);
276 return boundary_ents;
279 auto boundary_ents = filter_true_skin(filter_blocks(get_skin()));
282 CHKERR simple->setFieldOrder(
"SIGMA", approxOrder - 1, &boundary_ents);
290 sdfPythonPtr = boost::make_shared<ContactOps::SDFPython>();
291 CHKERR sdfPythonPtr->sdfInit(
"sdf.py");
292 ContactOps::sdfPythonWeakPtr = sdfPythonPtr;
300 auto project_ho_geometry = [&]() {
302 return mField.loop_dofs(
"GEOMETRY", ent_method);
304 PetscBool project_geometry = PETSC_TRUE;
306 &project_geometry, PETSC_NULL);
307 if (project_geometry) {
308 CHKERR project_ho_geometry();
322 VonMissesPlaneStress,
326 const char *list_materials[LastModel] = {
"VonMisses",
"VonMissesPlaneStress",
328 PetscInt choice_material = VonMisses;
330 LastModel, &choice_material, PETSC_NULL);
332 switch (choice_material) {
334 cpPtr = createMaterial<J2Plasticity<3>>();
336 case VonMissesPlaneStress:
339 "VonMissesPlaneStrain is only for 2D case");
340 cpPtr = createMaterial<J2Plasticity<2>>();
343 cpPtr = createMaterial<ParaboloidalPlasticity>();
350 cpPtr->integrationRule = [](
int,
int,
int p) {
return 2 * (p - 2); };
364 auto time_scale = boost::make_shared<TimeScale>();
366 auto rule = [](
int,
int,
int p) {
return 2 * p; };
367 CHKERR pipeline_mng->setDomainRhsIntegrationRule(cpPtr->integrationRule);
368 CHKERR pipeline_mng->setDomainLhsIntegrationRule(cpPtr->integrationRule);
369 CHKERR pipeline_mng->setBoundaryRhsIntegrationRule(rule);
370 CHKERR pipeline_mng->setBoundaryLhsIntegrationRule(rule);
373 pipeline_mng->getOpBoundaryLhsPipeline(), {HDIV},
"GEOMETRY");
374 pipeline_mng->getOpBoundaryLhsPipeline().push_back(
378 pipeline_mng->getOpBoundaryRhsPipeline(), {HDIV},
"GEOMETRY");
379 pipeline_mng->getOpBoundaryRhsPipeline().push_back(
384 pipeline_mng->getOpBoundaryRhsPipeline(), mField,
"U", {time_scale},
388 pipeline_mng->getOpBoundaryLhsPipeline(), mField,
"U", Sev::inform);
392 ContactOps::opFactoryBoundaryLhs<SPACE_DIM, PETSC, GAUSS, BoundaryEleOp>(
393 pipeline_mng->getOpBoundaryLhsPipeline(),
"SIGMA",
"U");
395 ContactOps::opFactoryBoundaryToDomainLhs<SPACE_DIM, PETSC, GAUSS, DomainEle>(
396 mField, pipeline_mng->getOpBoundaryLhsPipeline(),
397 simple->getDomainFEName(),
"SIGMA",
"U",
"GEOMETRY",
398 cpPtr->integrationRule);
401 ContactOps::opFactoryBoundaryRhs<SPACE_DIM, PETSC, GAUSS, BoundaryEleOp>(
402 pipeline_mng->getOpBoundaryRhsPipeline(),
"SIGMA",
"U");
403 #endif // ADD_CONTACT
407 pipeline_mng->getOpDomainRhsPipeline(), mField,
"U", {time_scale},
408 "BODY_FORCE", Sev::inform);
411 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(),
"REMOVE_X",
413 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(),
"REMOVE_Y",
415 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(),
"REMOVE_Z",
418 for (
auto b : {
"FIX_X",
"REMOVE_X"})
419 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(), b,
420 "SIGMA", 0, 0,
false,
true);
421 for (
auto b : {
"FIX_Y",
"REMOVE_Y"})
422 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(), b,
423 "SIGMA", 1, 1,
false,
true);
424 for (
auto b : {
"FIX_Z",
"REMOVE_Z"})
425 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(), b,
426 "SIGMA", 2, 2,
false,
true);
427 for (
auto b : {
"FIX_ALL",
"REMOVE_ALL"})
428 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(), b,
429 "SIGMA", 0, 3,
false,
true);
430 CHKERR bc_mng->removeBlockDOFsOnEntities(
431 simple->getProblemName(),
"NO_CONTACT",
"SIGMA", 0, 3,
false,
true);
435 simple->getProblemName(),
"U");
448 auto add_domain_ops_lhs = [&](
auto &pip) {
454 auto common_data_ptr = boost::make_shared<ADOLCPlasticity::CommonData>();
457 "U", common_data_ptr->getGardAtGaussPtsPtr()));
459 CHKERR opFactoryDomainLhs<SPACE_DIM, PETSC, GAUSS, DomainEleOp>(
460 mField,
"U", pip,
"ADOLCMAT", common_data_ptr, cpPtr);
464 auto add_domain_ops_rhs = [&](
auto &pip) {
470 auto common_data_ptr = boost::make_shared<ADOLCPlasticity::CommonData>();
473 "U", common_data_ptr->getGardAtGaussPtsPtr()));
475 CHKERR opFactoryDomainRhs<SPACE_DIM, PETSC, GAUSS, DomainEleOp>(
476 mField,
"U", pip,
"ADOLCMAT", common_data_ptr, cpPtr, Sev::inform);
478 CHKERR ContactOps::opFactoryDomainRhs<SPACE_DIM, PETSC, GAUSS, DomainEleOp>(
480 #endif // ADD_CONTACT
486 CHKERR add_domain_ops_lhs(pipeline_mng->getOpDomainLhsPipeline());
488 CHKERR add_domain_ops_rhs(pipeline_mng->getOpDomainRhsPipeline());
502 std::pair<boost::shared_ptr<PostProcEleDomain>,
503 boost::shared_ptr<PostProcEleBdy>>
505 boost::shared_ptr<DomainEle> reaction_fe,
506 std::vector<boost::shared_ptr<ScalingMethod>> smv)
507 : dM(dm), reactionFE(reaction_fe), vecOfTimeScalingMethods(smv) {
509 domainPostProcFe = pair_post_proc_fe.first;
510 skinPostProcFe = pair_post_proc_fe.second;
515 auto get_integrate_traction = [&]() {
516 auto integrate_traction = boost::make_shared<BoundaryEle>(*m_field_ptr);
517 auto common_data_ptr = boost::make_shared<ContactOps::CommonData>();
520 integrate_traction->getOpPtrVector(), {HDIV},
"GEOMETRY")),
524 integrate_traction->getOpPtrVector().push_back(
533 integrate_traction->getOpPtrVector(),
"SIGMA", 0)),
534 "push operators to calculate traction");
536 return integrate_traction;
539 integrateTraction = get_integrate_traction();
548 auto print_traction = [&](
const std::string msg) {
555 MOFEM_LOG_C(
"CONTACT", Sev::inform,
"%s time %3.4e %3.4e %3.4e %3.4e",
556 msg.c_str(), ts_t, t_ptr[0], t_ptr[1], t_ptr[2]);
564 auto make_vtk = [&]() {
566 if (domainPostProcFe) {
569 CHKERR domainPostProcFe->writeFile(
570 "out_plastic_" + boost::lexical_cast<std::string>(ts_step) +
573 if (skinPostProcFe) {
576 CHKERR skinPostProcFe->writeFile(
577 "out_skin_plastic_" + boost::lexical_cast<std::string>(ts_step) +
587 CHKERR VecZeroEntries(fRes);
588 reactionFE->f = fRes;
590 CHKERR VecAssemblyBegin(fRes);
591 CHKERR VecAssemblyEnd(fRes);
592 CHKERR VecGhostUpdateBegin(fRes, ADD_VALUES, SCATTER_REVERSE);
593 CHKERR VecGhostUpdateEnd(fRes, ADD_VALUES, SCATTER_REVERSE);
598 *m_field_ptr, reactionFE, fRes)();
601 CHKERR VecNorm(fRes, NORM_2, &nrm);
603 <<
"Residual norm " << nrm <<
" at time step " << ts_step;
607 auto calculate_traction = [&] {
617 auto get_min_max_displacement = [&]() {
622 std::array<double, 4> a_min = {DBL_MAX, DBL_MAX, DBL_MAX, 0};
623 std::array<double, 4> a_max = {-DBL_MAX, -DBL_MAX, -DBL_MAX, 0};
625 auto get_min_max = [&](boost::shared_ptr<FieldEntity> field_entity_ptr) {
628 for (
auto v : field_entity_ptr->getEntFieldData()) {
629 a_min[
d] = std::min(a_min[
d],
v);
630 a_max[
d] = std::max(a_max[
d],
v);
642 get_min_max,
"U", &verts);
644 auto mpi_reduce = [&](
auto &
a,
auto op) {
645 std::array<double, 3> a_mpi = {0, 0, 0};
646 MPI_Allreduce(
a.data(), a_mpi.data(), 3, MPI_DOUBLE, op,
651 auto a_min_mpi = mpi_reduce(a_min, MPI_MIN);
652 auto a_max_mpi = mpi_reduce(a_max, MPI_MAX);
655 <<
"Min displacement " << a_min_mpi[0] <<
" " << a_min_mpi[1] <<
" "
658 <<
"Max displacement " << a_max_mpi[0] <<
" " << a_max_mpi[1] <<
" "
662 CHKERR get_min_max_displacement();
664 CHKERR calculate_traction();
665 CHKERR print_traction(
"Contact force");
668 for (
auto s : vecOfTimeScalingMethods) {
669 scale *= s->getScale(this->ts_t);
673 <<
"Time: " << this->ts_t <<
" scale: " <<
scale;
698 auto dm =
simple->getDM();
699 auto time_scale = boost::make_shared<TimeScale>();
703 auto create_post_proc_fe = [dm,
this,
simple]() {
707 auto post_proc_ele_domain = [
this](
auto &pip_domain,
auto &fe_name) {
710 pip_domain, {
H1,
HDIV},
"GEOMETRY");
715 auto grad_ptr = boost::make_shared<MatrixDouble>();
716 pip_domain.push_back(
726 pip_domain.push_back(op_this);
730 auto fe_physics = op_this->getThisFEPtr();
732 auto evaluate_stress_on_physical_element = [&]() {
734 fe_physics->getRuleHook = cpPtr->integrationRule;
736 fe_physics->getOpPtrVector(), {H1});
737 auto common_data_ptr =
738 boost::make_shared<ADOLCPlasticity::CommonData>();
741 fe_physics->getOpPtrVector().push_back(
743 "U", common_data_ptr->getGardAtGaussPtsPtr()));
745 CHKERR cpPtr->addMatBlockOps(mField, fe_physics->getOpPtrVector(),
746 "ADOLCMAT", Sev::noisy);
747 fe_physics->getOpPtrVector().push_back(
748 getRawPtrOpCalculateStress<SPACE_DIM>(mField, common_data_ptr,
750 return common_data_ptr;
753 auto dg_projection_froward_and_back = [&](
auto &common_data_ptr) {
755 int dg_order = approxOrder - 1;
756 auto entity_data_l2 =
757 boost::make_shared<EntitiesFieldData>(MBENTITYSET);
759 boost::make_shared<MatrixDouble>();
762 dg_order, mass_ptr, entity_data_l2, approxBase,
L2));
764 auto coeffs_ptr_stress = boost::make_shared<MatrixDouble>();
767 common_data_ptr->getStressMatrixPtr(), coeffs_ptr_stress, mass_ptr,
768 entity_data_l2, approxBase,
L2));
770 auto coeffs_ptr_plastic_strain = boost::make_shared<MatrixDouble>();
772 common_data_ptr->getPlasticStrainMatrixPtr(),
773 coeffs_ptr_plastic_strain, mass_ptr, entity_data_l2, approxBase,
779 common_data_ptr->getStressMatrixPtr(), coeffs_ptr_stress,
780 entity_data_l2, approxBase,
L2));
782 common_data_ptr->getPlasticStrainMatrixPtr(),
783 coeffs_ptr_plastic_strain, entity_data_l2, approxBase,
L2));
786 auto common_data_ptr = evaluate_stress_on_physical_element();
787 dg_projection_froward_and_back(common_data_ptr);
789 return boost::make_tuple(grad_ptr, common_data_ptr->getStressMatrixPtr(),
790 common_data_ptr->getPlasticStrainMatrixPtr());
796 auto add_post_proc_map = [&](
auto post_proc_fe,
auto u_ptr,
auto grad_ptr,
797 auto stress_ptr,
auto plastic_strain_ptr,
798 auto contact_stress_ptr,
auto X_ptr) {
800 post_proc_fe->getOpPtrVector().push_back(
802 new OpPPMapSPACE_DIM(
804 post_proc_fe->getPostProcMesh(), post_proc_fe->getMapGaussPts(),
808 {{
"U", u_ptr}, {
"GEOMETRY", X_ptr}},
810 {{
"GRAD", grad_ptr}, {
"SIGMA", contact_stress_ptr}},
819 post_proc_fe->getOpPtrVector().push_back(
823 post_proc_fe->getPostProcMesh(), post_proc_fe->getMapGaussPts(),
831 {{
"STRESS", stress_ptr}, {
"PLASTIC_STRAIN", plastic_strain_ptr}}
840 auto vol_post_proc = [
this,
simple, post_proc_ele_domain,
841 add_post_proc_map]() {
842 PetscBool post_proc_vol = PETSC_FALSE;
844 post_proc_vol = PETSC_TRUE;
847 &post_proc_vol, PETSC_NULL);
848 if (post_proc_vol == PETSC_FALSE)
849 return boost::shared_ptr<PostProcEleDomain>();
850 auto post_proc_fe = boost::make_shared<PostProcEleDomain>(mField);
851 auto u_ptr = boost::make_shared<MatrixDouble>();
852 post_proc_fe->getOpPtrVector().push_back(
854 auto X_ptr = boost::make_shared<MatrixDouble>();
855 post_proc_fe->getOpPtrVector().push_back(
857 auto contact_stress_ptr = boost::make_shared<MatrixDouble>();
859 post_proc_fe->getOpPtrVector().push_back(
861 "SIGMA", contact_stress_ptr));
863 contact_stress_ptr =
nullptr;
865 auto [grad_ptr, stress_ptr, plastic_strain_ptr] = post_proc_ele_domain(
866 post_proc_fe->getOpPtrVector(),
simple->getDomainFEName());
868 return add_post_proc_map(post_proc_fe, u_ptr, grad_ptr, stress_ptr,
869 plastic_strain_ptr, contact_stress_ptr, X_ptr);
872 auto skin_post_proc = [
this,
simple, post_proc_ele_domain,
873 add_post_proc_map]() {
876 PetscBool post_proc_skin = PETSC_TRUE;
878 post_proc_skin = PETSC_FALSE;
881 &post_proc_skin, PETSC_NULL);
883 if (post_proc_skin == PETSC_FALSE)
884 return boost::shared_ptr<PostProcEleBdy>();
886 auto post_proc_fe = boost::make_shared<PostProcEleBdy>(mField);
887 auto u_ptr = boost::make_shared<MatrixDouble>();
888 post_proc_fe->getOpPtrVector().push_back(
890 auto X_ptr = boost::make_shared<MatrixDouble>();
891 post_proc_fe->getOpPtrVector().push_back(
893 auto contact_stress_ptr = boost::make_shared<MatrixDouble>();
896 auto [grad_ptr, stress_ptr, plastic_strain_ptr] = post_proc_ele_domain(
897 op_loop_side->getOpPtrVector(),
simple->getDomainFEName());
899 op_loop_side->getOpPtrVector().push_back(
901 "SIGMA", contact_stress_ptr));
903 contact_stress_ptr =
nullptr;
905 post_proc_fe->getOpPtrVector().push_back(op_loop_side);
907 return add_post_proc_map(post_proc_fe, u_ptr, grad_ptr, stress_ptr,
908 plastic_strain_ptr, contact_stress_ptr, X_ptr);
911 return std::make_pair(vol_post_proc(), skin_post_proc());
914 auto create_reaction_fe = [&]() {
915 auto fe_ptr = boost::make_shared<DomainEle>(mField);
916 fe_ptr->getRuleHook = cpPtr->integrationRule;
918 auto &pip = fe_ptr->getOpPtrVector();
920 auto common_data_ptr = boost::make_shared<ADOLCPlasticity::CommonData>();
922 "U", common_data_ptr->getGardAtGaussPtsPtr()));
923 CHKERR opFactoryDomainRhs<SPACE_DIM, PETSC, GAUSS, DomainEleOp>(
924 mField,
"U", pip,
"ADOLCMAT", common_data_ptr, cpPtr, Sev::noisy);
929 auto add_extra_finite_elements_to_ksp_solver_pipelines = [&]() {
932 auto pre_proc_ptr = boost::make_shared<FEMethod>();
933 auto post_proc_rhs_ptr = boost::make_shared<FEMethod>();
934 auto post_proc_lhs_ptr = boost::make_shared<FEMethod>();
936 auto get_bc_hook_rhs = [
this, pre_proc_ptr, time_scale]() {
939 {time_scale},
false)();
943 pre_proc_ptr->preProcessHook = get_bc_hook_rhs;
945 auto get_post_proc_hook_rhs = [
this, post_proc_rhs_ptr]() {
948 mField, post_proc_rhs_ptr,
nullptr, Sev::verbose)();
950 mField, post_proc_rhs_ptr, 1.)();
953 auto get_post_proc_hook_lhs = [
this, post_proc_lhs_ptr]() {
956 mField, post_proc_lhs_ptr, 1.)();
959 post_proc_rhs_ptr->postProcessHook = get_post_proc_hook_rhs;
960 post_proc_lhs_ptr->postProcessHook = get_post_proc_hook_lhs;
964 ts_ctx_ptr->getPreProcessIFunction().push_front(pre_proc_ptr);
965 ts_ctx_ptr->getPreProcessIJacobian().push_front(pre_proc_ptr);
966 ts_ctx_ptr->getPostProcessIFunction().push_back(post_proc_rhs_ptr);
967 ts_ctx_ptr->getPostProcessIJacobian().push_back(post_proc_lhs_ptr);
973 CHKERR add_extra_finite_elements_to_ksp_solver_pipelines();
975 auto create_monitor_fe = [dm, time_scale](
auto &&post_proc_fe,
976 auto &&reaction_fe) {
977 return boost::make_shared<Monitor>(
978 dm, post_proc_fe, reaction_fe,
979 std::vector<boost::shared_ptr<ScalingMethod>>{time_scale});
983 auto set_up_post_step = [&](
auto ts) {
988 auto create_update_ptr = [&]() {
989 auto fe_ptr = boost::make_shared<DomainEle>(mField);
990 fe_ptr->getRuleHook = cpPtr->integrationRule;
993 auto common_data_ptr = boost::make_shared<ADOLCPlasticity::CommonData>();
994 fe_ptr->getOpPtrVector().push_back(
996 "U", common_data_ptr->getGardAtGaussPtsPtr()));
998 opFactoryDomainUpdate<SPACE_DIM>(mField, fe_ptr->getOpPtrVector(),
999 "ADOLCMAT", common_data_ptr, cpPtr),
1010 auto ts_step_post_proc = [](TS ts) {
1019 CHKERR TSSetPostStep(ts, ts_step_post_proc);
1025 auto set_up_monitor = [&](
auto ts) {
1027 boost::shared_ptr<FEMethod> null_fe;
1029 create_monitor_fe(create_post_proc_fe(), create_reaction_fe());
1031 null_fe, monitor_ptr);
1035 auto set_section_monitor = [&](
auto solver) {
1038 CHKERR TSGetSNES(solver, &snes);
1039 CHKERR SNESMonitorSet(snes,
1042 (
void *)(snes_ctx_ptr.get()),
nullptr);
1046 auto set_up_adapt = [&](
auto ts) {
1050 CHKERR TSGetAdapt(ts, &adapt);
1055 auto ts = pipeline_mng->createTSIM();
1059 CHKERR TSSetMaxTime(ts, ftime);
1060 CHKERR TSSetExactFinalTime(ts, TS_EXACTFINALTIME_MATCHSTEP);
1066 CHKERR set_section_monitor(ts);
1069 CHKERR set_up_monitor(ts);
1070 CHKERR set_up_post_step(ts);
1072 CHKERR TSSetFromOptions(ts);
1074 CHKERR TSSolve(ts, NULL);
1077 CHKERR TSGetTime(ts, &ftime);
1079 PetscInt steps, snesfails, rejects, nonlinits, linits;
1080 CHKERR TSGetStepNumber(ts, &steps);
1081 CHKERR TSGetSNESFailures(ts, &snesfails);
1082 CHKERR TSGetStepRejections(ts, &rejects);
1083 CHKERR TSGetSNESIterations(ts, &nonlinits);
1084 CHKERR TSGetKSPIterations(ts, &linits);
1086 "steps %d (%d rejected, %d SNES fails), ftime %g, nonlinits "
1088 steps, rejects, snesfails, ftime, nonlinits, linits);
1099 auto dm =
simple->getDM();
1105 CHKERR VecNorm(T, NORM_2, &nrm2);
1106 MOFEM_LOG(
"PlasticPrb", Sev::inform) <<
"Solution norm " << nrm2;
1108 auto post_proc_norm_fe = boost::make_shared<DomainEle>(
mField);
1110 post_proc_norm_fe->getRuleHook =
cpPtr->integrationRule;
1113 post_proc_norm_fe->getOpPtrVector(), {H1});
1115 enum NORMS { U_NORM_L2 = 0, PIOLA_NORM, LAST_NORM };
1119 CHKERR VecZeroEntries(norms_vec);
1121 auto u_ptr = boost::make_shared<MatrixDouble>();
1122 post_proc_norm_fe->getOpPtrVector().push_back(
1125 post_proc_norm_fe->getOpPtrVector().push_back(
1131 CHKERR VecAssemblyBegin(norms_vec);
1132 CHKERR VecAssemblyEnd(norms_vec);
1136 const double *norms;
1137 CHKERR VecGetArrayRead(norms_vec, &norms);
1139 <<
"norm_u: " << std::scientific << std::sqrt(norms[U_NORM_L2]);
1140 CHKERR VecRestoreArrayRead(norms_vec, &norms);
1150 PetscInt test_nb = 0;
1151 PetscBool test_flg = PETSC_FALSE;
1160 CHKERR VecNorm(T, NORM_2, &nrm2);
1161 MOFEM_LOG(
"PlasticPrb", Sev::verbose) <<
"Regression norm " << nrm2;
1162 double regression_value = 0;
1168 if (fabs(nrm2 - regression_value) > 1e-2)
1170 "Regression test field; wrong norm value. %6.4e != %6.4e", nrm2,
1196 #endif // ADD_CONTACT
1199 const char param_file[] =
"param_file.petsc";
1203 auto core_log = logging::core::get();
1205 LogManager::createSink(LogManager::getStrmWorld(),
"PlasticPrb"));
1206 LogManager::setLog(
"PlasticPrb");
1211 LogManager::createSink(LogManager::getStrmWorld(),
"CONTACT"));
1212 LogManager::setLog(
"CONTACT");
1214 #endif // ADD_CONTACT
1219 DMType dm_name =
"DMMOFEM";
1243 if (Py_FinalizeEx() < 0) {
1247 #endif // ADD_CONTACT