v0.16.0
Loading...
Searching...
No Matches
poisson_2d_dis_galerkin.cpp
Go to the documentation of this file.
1/**
2 * \file poisson_2d_dis_galerkin.cpp
3 * \example mofem/tutorials/scl-11/poisson_2d_dis_galerkin.cpp
4 *
5 * Example of implementation for discontinuous Galerkin.
6 */
7
8#include <MoFEM.hpp>
9using namespace MoFEM;
10
11constexpr int BASE_DIM = 1;
12constexpr int FIELD_DIM = 1;
13constexpr int SPACE_DIM = 2;
14
16
18using DomainEleOp = DomainEle::UserDataOperator;
19
22using BoundaryEleOp = BoundaryEle::UserDataOperator;
25using FaceSideOp = FaceSideEle::UserDataOperator;
26
28
29static double penalty = 1e6;
30static double phi =
31 -1; // 1 - symmetric Nitsche, 0 - nonsymmetric, -1 antisymmetrica
32static double nitsche = 1;
33
35
40
41PetscBool is_test = PETSC_FALSE;
42
43auto u_exact = [](const double x, const double y, const double) {
44 if (is_test)
45 return x * x * y * y;
46 else
47 return cos(2 * x * M_PI) * cos(2 * y * M_PI);
48};
49
50auto u_grad_exact = [](const double x, const double y, const double) {
51 if (is_test)
52 return FTensor::Tensor1<double, 2>{2 * x * y * y, 2 * x * x * y};
53 else
55
56 -2 * M_PI * cos(2 * M_PI * y) * sin(2 * M_PI * x),
57 -2 * M_PI * cos(2 * M_PI * x) * sin(2 * M_PI * y)
58
59 };
60};
61
62auto source = [](const double x, const double y, const double) {
63 if (is_test)
64 return -(2 * x * x + 2 * y * y);
65 else
66 return 8 * M_PI * M_PI * cos(2 * x * M_PI) * cos(2 * y * M_PI);
67};
68
69using namespace MoFEM;
71
72static char help[] = "...\n\n";
73
75public:
77
78 // Declaration of the main function to run analysis
80
81private:
82 // Declaration of other main functions called in runProgram()
91
92 // MoFEM interfaces
95
96 // Field name and approximation order
97 std::string domainField;
98 int oRder;
99};
100
102 : domainField("U"), mField(m_field), oRder(4) {}
103
104//! [Read mesh]
107
110
111 // Only L2 field is set in this example. Two lines bellow forces simple
112 // interface to creat lower dimension (edge) elements, despite that fact that
113 // there is no field spanning on such elements. We need them for DG method.
116
118
120}
121//! [Read mesh]
122
123//! [Setup problem]
126
127 CHKERR PetscOptionsGetInt(PETSC_NULLPTR, "", "-order", &oRder, PETSC_NULLPTR);
128 CHKERR PetscOptionsGetScalar(PETSC_NULLPTR, "", "-penalty", &penalty,
129 PETSC_NULLPTR);
130 CHKERR PetscOptionsGetScalar(PETSC_NULLPTR, "", "-phi", &phi, PETSC_NULLPTR);
131 CHKERR PetscOptionsGetScalar(PETSC_NULLPTR, "", "-nitsche", &nitsche,
132 PETSC_NULLPTR);
133 PetscOptionsGetBool(PETSC_NULLPTR, "", "-is_test", &is_test, PETSC_NULLPTR);
134
135 MOFEM_LOG("WORLD", Sev::inform) << "Set order: " << oRder;
136 MOFEM_LOG("WORLD", Sev::inform) << "Set penalty: " << penalty;
137 MOFEM_LOG("WORLD", Sev::inform) << "Set phi: " << phi;
138 MOFEM_LOG("WORLD", Sev::inform) << "Set nitche: " << nitsche;
139 MOFEM_LOG("WORLD", Sev::inform) << "Set test: " << (is_test == PETSC_TRUE);
140
145
146 // This is only for debigging and experimentation, to see boundary and edge
147 // elements.
148 [[maybe_unused]] auto save_shared = [&](auto meshset, std::string prefix) {
150 auto file_name =
151 prefix + "_" +
152 boost::lexical_cast<std::string>(mField.get_comm_rank()) + ".vtk";
153 CHKERR mField.get_moab().write_file(file_name.c_str(), "VTK", "", &meshset,
154 1);
156 };
157
158 // CHKERR save_shared(simpleInterface->getBoundaryMeshSet(), "bdy");
159 // CHKERR save_shared(simpleInterface->getSkeletonMeshSet(), "skel");
160
162}
163//! [Setup problem]
164
165//! [Boundary condition]
170
171//! [Boundary condition]
172
173//! [Assemble system]
176
177 auto pipeline_mng = mField.getInterface<PipelineManager>();
178
179 auto add_base_ops = [&](auto &pipeline) {
180 auto det_ptr = boost::make_shared<VectorDouble>();
181 auto jac_ptr = boost::make_shared<MatrixDouble>();
182 auto inv_jac_ptr = boost::make_shared<MatrixDouble>();
183 pipeline.push_back(new OpCalculateHOJacForFace(jac_ptr));
184 pipeline.push_back(new OpInvertMatrix<2>(jac_ptr, det_ptr, inv_jac_ptr));
185 pipeline.push_back(new OpSetInvJacL2ForFace(inv_jac_ptr));
186 };
187
188 add_base_ops(pipeline_mng->getOpDomainLhsPipeline());
189 pipeline_mng->getOpDomainLhsPipeline().push_back(new OpDomainGradGrad(
191 [](const double, const double, const double) { return 1; }));
192 pipeline_mng->getOpDomainRhsPipeline().push_back(
194
195 // Push operators to the Pipeline for Skeleton
196 auto side_fe_ptr = boost::make_shared<FaceSideEle>(mField);
197 add_base_ops(side_fe_ptr->getOpPtrVector());
198 side_fe_ptr->getOpPtrVector().push_back(
200
201 // Push operators to the Pipeline for Skeleton
202 pipeline_mng->getOpSkeletonLhsPipeline().push_back(
203 new OpL2LhsPenalty(side_fe_ptr));
204
205 // Push operators to the Pipeline for Boundary
206 pipeline_mng->getOpBoundaryLhsPipeline().push_back(
207 new OpL2LhsPenalty(side_fe_ptr));
208 pipeline_mng->getOpBoundaryRhsPipeline().push_back(
209 new OpL2BoundaryRhs(side_fe_ptr, u_exact));
210
212}
213//! [Assemble system]
214
215//! [Set integration rules]
218
219 auto rule_lhs = [](int, int, int p) -> int { return 2 * p; };
220 auto rule_rhs = [](int, int, int p) -> int { return 2 * p; };
221 auto rule_2 = [this](int, int, int) { return 2 * oRder; };
222
223 auto pipeline_mng = mField.getInterface<PipelineManager>();
224 CHKERR pipeline_mng->setDomainLhsIntegrationRule(rule_lhs);
225 CHKERR pipeline_mng->setDomainRhsIntegrationRule(rule_rhs);
226
227 CHKERR pipeline_mng->setSkeletonLhsIntegrationRule(rule_2);
228 CHKERR pipeline_mng->setSkeletonRhsIntegrationRule(rule_2);
229 CHKERR pipeline_mng->setBoundaryLhsIntegrationRule(rule_2);
230 CHKERR pipeline_mng->setBoundaryRhsIntegrationRule(rule_2);
231
233}
234//! [Set integration rules]
235
236//! [Solve system]
239
240 auto pipeline_mng = mField.getInterface<PipelineManager>();
241
242 auto ksp_solver = pipeline_mng->createKSP();
243 CHKERR KSPSetFromOptions(ksp_solver);
244 CHKERR KSPSetUp(ksp_solver);
245
246 // Create RHS and solution vectors
247 auto dm = simpleInterface->getDM();
248 auto F = createDMVector(dm);
249 auto D = vectorDuplicate(F);
250
251 CHKERR KSPSolve(ksp_solver, F, D);
252
253 // Scatter result data on the mesh
254 CHKERR VecGhostUpdateBegin(D, INSERT_VALUES, SCATTER_FORWARD);
255 CHKERR VecGhostUpdateEnd(D, INSERT_VALUES, SCATTER_FORWARD);
256 CHKERR DMoFEMMeshToLocalVector(dm, D, INSERT_VALUES, SCATTER_REVERSE);
257
259}
260//! [Solve system]
261
264
265 auto pipeline_mng = mField.getInterface<PipelineManager>();
266
267 auto rule = [](int, int, int p) -> int { return 2 * p; };
268 CHKERR pipeline_mng->setEvaluationIntegrationRule(rule);
269 auto rule_2 = [this](int, int, int) { return 2 * oRder; };
270 auto &evaluation_pipeline = pipeline_mng->getOpEvaluationPipeline();
271
272 auto add_base_ops = [&](auto &pipeline) {
273 auto det_ptr = boost::make_shared<VectorDouble>();
274 auto jac_ptr = boost::make_shared<MatrixDouble>();
275 auto inv_jac_ptr = boost::make_shared<MatrixDouble>();
276 pipeline.push_back(new OpCalculateHOJacForFace(jac_ptr));
277 pipeline.push_back(new OpInvertMatrix<2>(jac_ptr, det_ptr, inv_jac_ptr));
278 pipeline.push_back(new OpSetInvJacL2ForFace(inv_jac_ptr));
279 };
280
281 auto u_vals_ptr = boost::make_shared<VectorDouble>();
282 auto u_grad_ptr = boost::make_shared<MatrixDouble>();
283
284 add_base_ops(evaluation_pipeline);
285 evaluation_pipeline.push_back(
287 evaluation_pipeline.push_back(
289
290 enum NORMS { L2 = 0, SEMI_NORM, H1, LAST_NORM };
291 std::array<int, LAST_NORM> error_indices;
292 for (int i = 0; i != LAST_NORM; ++i)
293 error_indices[i] = i;
294 auto l2_vec = createVectorMPI(
295 mField.get_comm(), (!mField.get_comm_rank()) ? LAST_NORM : 0, LAST_NORM);
296
297 auto error_op = new DomainEleOp(domainField, DomainEleOp::OPROW);
298 error_op->doWorkRhsHook = [&](DataOperator *op_ptr, int side, EntityType type,
301 auto o = static_cast<DomainEleOp *>(op_ptr);
302
303 FTensor::Index<'i', 2> i;
304
305 if (const size_t nb_dofs = data.getIndices().size()) {
306
307 const int nb_integration_pts = o->getGaussPts().size2();
308 auto t_w = o->getFTensor0IntegrationWeight();
309 auto t_val = getFTensor0FromVec(*u_vals_ptr);
310 auto t_grad = getFTensor1FromMat<2>(*u_grad_ptr);
311 auto t_coords = o->getFTensor1CoordsAtGaussPts();
312
313 std::array<double, LAST_NORM> error;
314 std::fill(error.begin(), error.end(), 0);
315
316 for (int gg = 0; gg != nb_integration_pts; ++gg) {
317
318 const double alpha = t_w * o->getMeasure();
319 const double diff =
320 t_val - u_exact(t_coords(0), t_coords(1), t_coords(2));
321
322 auto t_exact_grad = u_grad_exact(t_coords(0), t_coords(1), t_coords(2));
323
324 const double diff_grad =
325 (t_grad(i) - t_exact_grad(i)) * (t_grad(i) - t_exact_grad(i));
326
327 error[L2] += alpha * pow(diff, 2);
328 error[SEMI_NORM] += alpha * diff_grad;
329
330 ++t_w;
331 ++t_val;
332 ++t_grad;
333 ++t_coords;
334 }
335
336 error[H1] = error[L2] + error[SEMI_NORM];
337
338 CHKERR VecSetValues(l2_vec, LAST_NORM, error_indices.data(), error.data(),
339 ADD_VALUES);
340 }
341
343 };
344
345 auto side_fe_ptr = boost::make_shared<FaceSideEle>(mField);
346 add_base_ops(side_fe_ptr->getOpPtrVector());
347 side_fe_ptr->getOpPtrVector().push_back(
349 std::array<VectorDouble, 2> side_vals;
350 std::array<double, 2> area_map;
351 std::array<EntityHandle, 2> side_ents = {0, 0};
352
353 auto side_vals_op = new DomainEleOp(domainField, DomainEleOp::OPROW);
354 side_vals_op->doWorkRhsHook = [&](DataOperator *op_ptr, int side,
355 EntityType type,
358 auto o = static_cast<FaceSideOp *>(op_ptr);
359
360 const auto nb_in_loop = o->getFEMethod()->nInTheLoop;
361 area_map[nb_in_loop] = o->getMeasure();
362 side_vals[nb_in_loop] = *u_vals_ptr;
363 side_ents[nb_in_loop] = o->getFEEntityHandle();
364 if (!nb_in_loop) {
365 area_map[1] = 0;
366 side_vals[1].clear();
367 side_ents[1] = 0;
368 }
369
371 };
372 side_fe_ptr->getOpPtrVector().push_back(side_vals_op);
373
374 auto do_work_rhs_error = [&](DataOperator *op_ptr, int side, EntityType type,
377 auto o = static_cast<BoundaryEleOp *>(op_ptr);
378
379 CHKERR o->loopSideFaces("dFE", *side_fe_ptr);
380 const auto in_the_loop = side_fe_ptr->nInTheLoop;
381 if (in_the_loop) {
382 if (auto side_ptr_fe = o->getSidePtrFE()) {
383 if (side_ptr_fe->numeredEntFiniteElementPtr->getEnt() != side_ents[0]) {
385 }
386 }
387 }
388
389#ifndef NDEBUG
390 const std::array<std::string, 2> ele_type_name = {"BOUNDARY", "SKELETON"};
391 MOFEM_LOG("SELF", Sev::noisy)
392 << "do_work_rhs_error in_the_loop " << ele_type_name[in_the_loop];
393#endif
394
395 const double s = o->getMeasure() / (area_map[0] + area_map[1]);
396 const double p = penalty * s;
397
398 std::array<double, LAST_NORM> error;
399 std::fill(error.begin(), error.end(), 0);
400
401 const int nb_integration_pts = o->getGaussPts().size2();
402
403 if (!in_the_loop) {
404 side_vals[1].resize(nb_integration_pts, false);
405 auto t_coords = o->getFTensor1CoordsAtGaussPts();
406 auto t_val_m = getFTensor0FromVec(side_vals[1]);
407 for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
408 t_val_m = u_exact(t_coords(0), t_coords(1), t_coords(2));
409 ++t_coords;
410 ++t_val_m;
411 }
412 }
413
414 auto t_val_p = getFTensor0FromVec(side_vals[0]);
415 auto t_val_m = getFTensor0FromVec(side_vals[1]);
416 auto t_w = o->getFTensor0IntegrationWeight();
417
418 for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
419
420 const double alpha = o->getMeasure() * t_w;
421 const auto diff = t_val_p - t_val_m;
422 error[SEMI_NORM] += alpha * p * diff * diff;
423
424 ++t_w;
425 ++t_val_p;
426 ++t_val_m;
427 }
428
429
430 error[H1] = error[SEMI_NORM];
431 CHKERR VecSetValues(l2_vec, LAST_NORM, error_indices.data(), error.data(),
432 ADD_VALUES);
433
435 };
436
437 auto skeleton_error_op = new BoundaryEleOp(NOSPACE, BoundaryEleOp::OPSPACE);
438 skeleton_error_op->doWorkRhsHook = do_work_rhs_error;
439 auto boundary_error_op = new BoundaryEleOp(NOSPACE, BoundaryEleOp::OPSPACE);
440 boundary_error_op->doWorkRhsHook = do_work_rhs_error;
441
442 evaluation_pipeline.push_back(error_op);
443
444 auto add_side_error_op = [&](const std::string &fe_name, auto error_op) {
445 auto op_loop_side = new OpLoopSide<BoundaryEle>(
446 mField, fe_name, SPACE_DIM - 1, Sev::verbose);
447 op_loop_side->getSideFEPtr()->getRuleHook = rule_2;
448 op_loop_side->getOpPtrVector().push_back(error_op);
449 evaluation_pipeline.push_back(op_loop_side);
450 };
451
452 add_side_error_op(simpleInterface->getSkeletonFEName(), skeleton_error_op);
453 add_side_error_op(simpleInterface->getBoundaryFEName(), boundary_error_op);
454
455 CHKERR pipeline_mng->loopFiniteElementsEvaluation();
456
457 CHKERR VecAssemblyBegin(l2_vec);
458 CHKERR VecAssemblyEnd(l2_vec);
459
460 if (mField.get_comm_rank() == 0) {
461 const double *array;
462 CHKERR VecGetArrayRead(l2_vec, &array);
463 MOFEM_LOG_C("SELF", Sev::inform, "Error Norm L2 %6.4e",
464 std::sqrt(array[L2]));
465 MOFEM_LOG_C("SELF", Sev::inform, "Error Norm Energetic %6.4e",
466 std::sqrt(array[SEMI_NORM]));
467 MOFEM_LOG_C("SELF", Sev::inform, "Error Norm H1 %6.4e",
468 std::sqrt(array[H1]));
469
470 if(is_test) {
471 constexpr double eps = 1e-12;
472 if (std::sqrt(array[H1]) > eps)
473 SETERRQ(PETSC_COMM_WORLD, MOFEM_ATOM_TEST_INVALID, "Error is too big");
474 }
475
476 CHKERR VecRestoreArrayRead(l2_vec, &array);
477 const MoFEM::Problem *problem_ptr;
479 MOFEM_LOG_C("SELF", Sev::inform, "Nb. DOFs %d",
480 problem_ptr->getNbDofsRow());
481 }
482
484}
485
486//! [Output results]
489
490 auto pipeline_mng = mField.getInterface<PipelineManager>();
491
492 auto post_proc_fe = boost::make_shared<PostProcEle>(mField);
493
494 auto u_ptr = boost::make_shared<VectorDouble>();
495 post_proc_fe->getOpPtrVector().push_back(
497
499
500 post_proc_fe->getOpPtrVector().push_back(
501
502 new OpPPMap(
503
504 post_proc_fe->getPostProcMesh(), post_proc_fe->getMapGaussPts(),
505
506 {{"U", u_ptr}},
507
508 {},
509
510 {},
511
512 {})
513
514 );
515
516 pipeline_mng->getDomainPostProcFE() = post_proc_fe;
517 CHKERR pipeline_mng->loopFiniteElementsPostProc();
518 CHKERR post_proc_fe->writeFile("out_result.h5m");
519
521}
522//! [Output results]
523
524//! [Run program]
539//! [Run program]
540
541//! [Main]
542int main(int argc, char *argv[]) {
543
544 // Initialisation of MoFEM/PETSc and MOAB data structures
545 const char param_file[] = "param_file.petsc";
546 MoFEM::Core::Initialize(&argc, &argv, param_file, help);
547
548 // Error handling
549 try {
550 // Register MoFEM discrete manager in PETSc
551 DMType dm_name = "DMMOFEM";
552 CHKERR DMRegister_MoFEM(dm_name);
553
554 // Create MOAB instance
555 moab::Core mb_instance; // mesh database
556 moab::Interface &moab = mb_instance; // mesh database interface
557
558 // Create MoFEM instance
559 MoFEM::Core core(moab); // finite element database
560 MoFEM::Interface &m_field = core; // finite element interface
561
562 // Run the main analysis
563 Poisson2DiscontGalerkin poisson_problem(m_field);
564 CHKERR poisson_problem.runProgram();
565 }
567
568 // Finish work: cleaning memory, getting statistics, etc.
570
571 return 0;
572}
573//! [Main]
std::string type
#define MOFEM_LOG_C(channel, severity, format,...)
int main()
static const double eps
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpSource< 1, FIELD_DIM > OpDomainSource
ElementsAndOps< SPACE_DIM >::DomainEle DomainEle
ElementsAndOps< SPACE_DIM >::BoundaryEle BoundaryEle
#define CATCH_ERRORS
Catch errors.
@ AINSWORTH_LOBATTO_BASE
Definition definitions.h:62
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
@ L2
field with C-1 continuity
Definition definitions.h:88
@ H1
continuous field
Definition definitions.h:85
@ NOSPACE
Definition definitions.h:83
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_ATOM_TEST_INVALID
Definition definitions.h:40
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
constexpr auto domainField
@ F
PetscErrorCode DMMoFEMGetProblemPtr(DM dm, const MoFEM::Problem **problem_ptr)
Get pointer to problem data structure.
Definition DMMoFEM.cpp:422
PetscErrorCode DMoFEMMeshToLocalVector(DM dm, Vec l, InsertMode mode, ScatterMode scatter_mode, RowColData rc=RowColData::COL)
set local (or ghosted) vector values on mesh for partition only
Definition DMMoFEM.cpp:514
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition DMMoFEM.cpp:43
auto createDMVector(DM dm, RowColData rc=RowColData::COL)
Get smart vector from DM.
Definition DMMoFEM.hpp:1237
SmartPetscObj< KSP > createKSP(SmartPetscObj< DM > dm=nullptr)
Create KSP (linear) solver.
@ PETSC
Standard PETSc assembly.
#define MOFEM_LOG(channel, severity)
Log.
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpGradGrad< 1, 1, SPACE_DIM > OpDomainGradGrad
Definition helmholtz.cpp:25
double D
PipelineManager::ElementsAndOpsByDim< FE_DIM >::FaceSideEle FaceSideEle
Definition level_set.cpp:41
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
implementation of Data Operators for Forces and Sources
Definition Common.hpp:10
PetscErrorCode PetscOptionsGetInt(PetscOptions *, const char pre[], const char name[], PetscInt *ivalue, PetscBool *set)
PetscErrorCode PetscOptionsGetBool(PetscOptions *, const char pre[], const char name[], PetscBool *bval, PetscBool *set)
OpCalculateHOJacForFaceImpl< 2 > OpCalculateHOJacForFace
PetscErrorCode PetscOptionsGetScalar(PetscOptions *, const char pre[], const char name[], PetscScalar *dval, PetscBool *set)
SmartPetscObj< Vec > vectorDuplicate(Vec vec)
Create duplicate vector of smart vector.
auto createVectorMPI(MPI_Comm comm, PetscInt n, PetscInt N)
Create MPI Vector.
static auto getFTensor0FromVec(V &data)
Get tensor rank 0 (scalar) form data vector.
MoFEMErrorCode VecSetValues(Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.
OpPostProcMapInMoab< SPACE_DIM, SPACE_DIM > OpPPMap
auto u_grad_exact
static char help[]
constexpr int SPACE_DIM
static double nitsche
constexpr int FIELD_DIM
constexpr int BASE_DIM
DomainEle::UserDataOperator DomainEleOp
static double penalty
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpGradGrad< BASE_DIM, FIELD_DIM, SPACE_DIM > OpDomainGradGrad
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpSource< BASE_DIM, FIELD_DIM > OpDomainSource
static double phi
BoundaryEle::UserDataOperator BoundaryEleOp
PetscBool is_test
virtual moab::Interface & get_moab()=0
virtual MPI_Comm & get_comm() const =0
virtual int get_comm_rank() const =0
Core (interface) class.
Definition Core.hpp:83
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
Definition Core.cpp:68
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition Core.cpp:123
base operator to do operations at Gauss Pt. level
Deprecated interface functions.
Data on single entity (This is passed as argument to DataOperator::doWork)
Get field gradients at integration pts for scalar field rank 0, i.e. vector field.
Specialization for double precision scalar field values calculation.
Operator for inverting matrices at integration points.
Element used to execute operators on side of the element.
Post post-proc data at points from hash maps.
Template struct for dimension-specific finite element types.
PipelineManager interface.
MoFEMErrorCode setEvaluationIntegrationRule(RuleHookFun rule)
Set integration rule for domain evaluation finite element.
boost::shared_ptr< FEMethod > & getDomainPostProcFE()
Get domain postprocessing finite element.
MoFEMErrorCode setDomainLhsIntegrationRule(RuleHookFun rule)
Set integration rule for domain left-hand side finite element.
keeps basic data about problem
DofIdx getNbDofsRow() const
Simple interface for fast problem set-up.
Definition Simple.hpp:27
MoFEMErrorCode addDomainField(const std::string name, const FieldSpace space, const FieldApproximationBase base, const FieldCoefficientsNumber nb_of_coefficients, const TagType tag_type=MB_TAG_SPARSE, const enum MoFEMTypes bh=MF_ZERO, int verb=-1)
Add field on domain.
Definition Simple.cpp:261
bool & getAddBoundaryFE()
Get the addBoundaryFE flag.
Definition Simple.hpp:546
const std::string getBoundaryFEName() const
Get the Boundary FE Name.
Definition Simple.hpp:436
MoFEMErrorCode loadFile(const std::string options, const std::string mesh_file_name, LoadFileFunc loadFunc=defaultLoadFileFunc)
Load mesh file.
Definition Simple.cpp:191
const std::string getSkeletonFEName() const
Get the Skeleton FE Name.
Definition Simple.hpp:443
MoFEMErrorCode getOptions()
get options
Definition Simple.cpp:180
MoFEMErrorCode getDM(DM *dm)
Get DM.
Definition Simple.cpp:799
MoFEMErrorCode setFieldOrder(const std::string field_name, const int order, const Range *ents=NULL)
Set field order.
Definition Simple.cpp:575
bool & getAddSkeletonFE()
Get the addSkeletonFE flag.
Definition Simple.hpp:536
MoFEMErrorCode setUp(const PetscBool is_partitioned=PETSC_TRUE)
Setup problem.
Definition Simple.cpp:735
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
Operator tp collect data from elements on the side of Edge/Face.
Operator to evaluate Dirichlet boundary conditions using DG.
MoFEMErrorCode boundaryCondition()
[Setup problem]
MoFEMErrorCode checkResults()
[Solve system]
MoFEMErrorCode setupProblem()
[Read mesh]
MoFEMErrorCode setIntegrationRules()
[Assemble system]
MoFEMErrorCode assembleSystem()
[Boundary condition]
Poisson2DiscontGalerkin(MoFEM::Interface &m_field)
MoFEMErrorCode solveSystem()
[Set integration rules]
MoFEMErrorCode readMesh()
[Read mesh]
MoFEMErrorCode outputResults()
[Output results]
MoFEMErrorCode runProgram()
[Output results]