12 std::pair<boost::shared_ptr<PostProcEle>,
13 boost::shared_ptr<SkinPostProcEle>>
15 boost::shared_ptr<DomainEle> reaction_fe,
16 std::tuple<SmartPetscObj<Vec>, SmartPetscObj<VecScatter>> ux_scatter,
17 std::tuple<SmartPetscObj<Vec>, SmartPetscObj<VecScatter>> uy_scatter,
18 std::tuple<SmartPetscObj<Vec>, SmartPetscObj<VecScatter>> uz_scatter)
34 auto make_vtk = [&]() {
40 boost::lexical_cast<std::string>(ts_step) +
47 "out_skin_plastic_" + boost::lexical_cast<std::string>(ts_step) +
53 auto calculate_reaction = [&]() {
61 auto post_proc_residual = [&](
auto dm,
auto f_res,
auto out_name) {
64 boost::make_shared<PostProcBrokenMeshInMoab<DomainEle>>(
66 using OpPPMap = OpPostProcMapInMoab<SPACE_DIM, SPACE_DIM>;
67 auto u_vec = boost::make_shared<MatrixDouble>();
68 post_proc_fe->getOpPtrVector().push_back(
69 new OpCalculateVectorFieldValues<SPACE_DIM>(
"U", u_vec, f_res));
70 post_proc_fe->getOpPtrVector().push_back(
74 post_proc_fe->getPostProcMesh(), post_proc_fe->getMapGaussPts(),
85 post_proc_fe->writeFile(
"res.h5m");
89 CHKERR post_proc_residual(
dM,
r,
"reaction");
95 auto print_max_min = [&](
auto &tuple,
const std::string msg) {
97 CHKERR VecScatterBegin(std::get<1>(tuple), ts_u, std::get<0>(tuple),
98 INSERT_VALUES, SCATTER_FORWARD);
99 CHKERR VecScatterEnd(std::get<1>(tuple), ts_u, std::get<0>(tuple),
100 INSERT_VALUES, SCATTER_FORWARD);
102 CHKERR VecMax(std::get<0>(tuple), PETSC_NULL, &max);
103 CHKERR VecMin(std::get<0>(tuple), PETSC_NULL, &min);
104 MOFEM_LOG_C(
"PLASTICITY", Sev::inform,
"%s time %3.4e min %3.4e max %3.4e",
105 msg.c_str(), ts_t, min, max);
111 if (!(ts_step % se)) {
115 CHKERR calculate_reaction();
125 SmartPetscObj<DM>
dM;