v0.9.2
Public Member Functions | Private Attributes | List of all members
OpPlasticTools::Monitor Struct Reference

#include <users_modules/basic_finite_elements/lessons/src/PlasticOps.hpp>

Inheritance diagram for OpPlasticTools::Monitor:
[legend]
Collaboration diagram for OpPlasticTools::Monitor:
[legend]

Public Member Functions

 Monitor (SmartPetscObj< DM > &dm, boost::shared_ptr< PostProcFaceOnRefinedMesh > &post_proc_fe, std::tuple< SmartPetscObj< Vec >, SmartPetscObj< VecScatter >> ux_scatter, std::tuple< SmartPetscObj< Vec >, SmartPetscObj< VecScatter >> uy_scatter)
 
MoFEMErrorCode preProcess ()
 
MoFEMErrorCode operator() ()
 
MoFEMErrorCode postProcess ()
 

Private Attributes

SmartPetscObj< DM > dM
 
boost::shared_ptr< PostProcFaceOnRefinedMeshpostProcFe
 
std::tuple< SmartPetscObj< Vec >, SmartPetscObj< VecScatter > > uXScatter
 
std::tuple< SmartPetscObj< Vec >, SmartPetscObj< VecScatter > > uYScatter
 

Detailed Description

Examples
lesson7_plastic.cpp.

Definition at line 1218 of file PlasticOps.hpp.

Constructor & Destructor Documentation

◆ Monitor()

OpPlasticTools::Monitor::Monitor ( SmartPetscObj< DM > &  dm,
boost::shared_ptr< PostProcFaceOnRefinedMesh > &  post_proc_fe,
std::tuple< SmartPetscObj< Vec >, SmartPetscObj< VecScatter >>  ux_scatter,
std::tuple< SmartPetscObj< Vec >, SmartPetscObj< VecScatter >>  uy_scatter 
)

Definition at line 1220 of file PlasticOps.hpp.

1226  : dM(dm), postProcFe(post_proc_fe), uXScatter(ux_scatter),
1227  uYScatter(uy_scatter){};
boost::shared_ptr< PostProcFaceOnRefinedMesh > postProcFe
std::tuple< SmartPetscObj< Vec >, SmartPetscObj< VecScatter > > uXScatter
std::tuple< SmartPetscObj< Vec >, SmartPetscObj< VecScatter > > uYScatter
SmartPetscObj< DM > dM

Member Function Documentation

◆ operator()()

MoFEMErrorCode OpPlasticTools::Monitor::operator() ( )

Definition at line 1230 of file PlasticOps.hpp.

1230 { return 0; }

◆ postProcess()

MoFEMErrorCode OpPlasticTools::Monitor::postProcess ( )

Definition at line 1232 of file PlasticOps.hpp.

1232  {
1234 
1235  auto make_vtk = [&]() {
1238  CHKERR postProcFe->writeFile(
1239  "out_plastic_" + boost::lexical_cast<std::string>(ts_step) + ".h5m");
1241  };
1242 
1243  auto print_max_min = [&](auto &tuple, const std::string msg) {
1245  CHKERR VecScatterBegin(std::get<1>(tuple), ts_u, std::get<0>(tuple),
1246  INSERT_VALUES, SCATTER_FORWARD);
1247  CHKERR VecScatterEnd(std::get<1>(tuple), ts_u, std::get<0>(tuple),
1248  INSERT_VALUES, SCATTER_FORWARD);
1249  double max, min;
1250  CHKERR VecMax(std::get<0>(tuple), PETSC_NULL, &max);
1251  CHKERR VecMin(std::get<0>(tuple), PETSC_NULL, &min);
1252  PetscPrintf(PETSC_COMM_WORLD, "%s time %3.4e min %3.4e max %3.4e\n",
1253  msg.c_str(), ts_t, min, max);
1255  };
1256 
1257  CHKERR make_vtk();
1258  CHKERR print_max_min(uXScatter, "Ux");
1259  CHKERR print_max_min(uYScatter, "Uy");
1260 
1262  }
boost::shared_ptr< PostProcFaceOnRefinedMesh > postProcFe
std::tuple< SmartPetscObj< Vec >, SmartPetscObj< VecScatter > > uXScatter
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:483
PetscErrorCode DMoFEMLoopFiniteElements(DM dm, const char fe_name[], MoFEM::FEMethod *method)
Executes FEMethod for finite elements in DM.
Definition: DMMMoFEM.cpp:507
#define CHKERR
Inline error check.
Definition: definitions.h:602
std::tuple< SmartPetscObj< Vec >, SmartPetscObj< VecScatter > > uYScatter
SmartPetscObj< DM > dM
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:413

◆ preProcess()

MoFEMErrorCode OpPlasticTools::Monitor::preProcess ( )

Definition at line 1229 of file PlasticOps.hpp.

1229 { return 0; }

Member Data Documentation

◆ dM

SmartPetscObj<DM> OpPlasticTools::Monitor::dM
private

Definition at line 1265 of file PlasticOps.hpp.

◆ postProcFe

boost::shared_ptr<PostProcFaceOnRefinedMesh> OpPlasticTools::Monitor::postProcFe
private

Definition at line 1266 of file PlasticOps.hpp.

◆ uXScatter

std::tuple<SmartPetscObj<Vec>, SmartPetscObj<VecScatter> > OpPlasticTools::Monitor::uXScatter
private

Definition at line 1267 of file PlasticOps.hpp.

◆ uYScatter

std::tuple<SmartPetscObj<Vec>, SmartPetscObj<VecScatter> > OpPlasticTools::Monitor::uYScatter
private

Definition at line 1268 of file PlasticOps.hpp.


The documentation for this struct was generated from the following file: