128 auto make_vtk = [&]() {
132 "out_plastic_" + boost::lexical_cast<std::string>(ts_step) +
".h5m");
136 auto calculate_reaction = [&]() {
142 CHKERR VecGhostUpdateBegin(
r, ADD_VALUES, SCATTER_REVERSE);
143 CHKERR VecGhostUpdateEnd(
r, ADD_VALUES, SCATTER_REVERSE);
149 MOFEM_LOG_C(
"EXAMPLE", Sev::inform,
"reaction time %3.4e %3.4e", ts_t,
155 auto print_max_min = [&](
auto &tuple,
const std::string msg) {
157 CHKERR VecScatterBegin(std::get<1>(tuple), ts_u, std::get<0>(tuple),
158 INSERT_VALUES, SCATTER_FORWARD);
159 CHKERR VecScatterEnd(std::get<1>(tuple), ts_u, std::get<0>(tuple),
160 INSERT_VALUES, SCATTER_FORWARD);
162 CHKERR VecMax(std::get<0>(tuple), PETSC_NULL, &max);
163 CHKERR VecMin(std::get<0>(tuple), PETSC_NULL, &min);
164 MOFEM_LOG_C(
"EXAMPLE", Sev::inform,
"%s time %3.4e min %3.4e max %3.4e",
165 msg.c_str(), ts_t, min, max);
170 CHKERR calculate_reaction();
#define MOFEM_LOG_C(channel, severity, format,...)
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
auto smartCreateDMVector
Get smart vector from DM.
PetscErrorCode DMoFEMLoopFiniteElements(DM dm, const char fe_name[], MoFEM::FEMethod *method, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr())
Executes FEMethod for finite elements in DM.
const double r
rate factor