v0.14.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Poisson2DiscontGalerkin Struct Reference
Collaboration diagram for Poisson2DiscontGalerkin:
[legend]

Public Member Functions

 Poisson2DiscontGalerkin (MoFEM::Interface &m_field)
 
MoFEMErrorCode runProgram ()
 [Output results] More...
 

Private Member Functions

MoFEMErrorCode readMesh ()
 [Read mesh] More...
 
MoFEMErrorCode setupProblem ()
 [Read mesh] More...
 
MoFEMErrorCode boundaryCondition ()
 [Setup problem] More...
 
MoFEMErrorCode assembleSystem ()
 [Boundary condition] More...
 
MoFEMErrorCode setIntegrationRules ()
 [Assemble system] More...
 
MoFEMErrorCode solveSystem ()
 [Set integration rules] More...
 
MoFEMErrorCode checkResults ()
 [Solve system] More...
 
MoFEMErrorCode outputResults ()
 [Output results] More...
 

Private Attributes

MoFEM::InterfacemField
 
SimplesimpleInterface
 
std::string domainField
 
int oRder
 

Detailed Description

Examples
poisson_2d_dis_galerkin.cpp.

Definition at line 74 of file poisson_2d_dis_galerkin.cpp.

Constructor & Destructor Documentation

◆ Poisson2DiscontGalerkin()

Poisson2DiscontGalerkin::Poisson2DiscontGalerkin ( MoFEM::Interface m_field)
Examples
poisson_2d_dis_galerkin.cpp.

Definition at line 101 of file poisson_2d_dis_galerkin.cpp.

102  : domainField("U"), mField(m_field), oRder(4) {}

Member Function Documentation

◆ assembleSystem()

MoFEMErrorCode Poisson2DiscontGalerkin::assembleSystem ( )
private

[Boundary condition]

[Assemble system]

Examples
poisson_2d_dis_galerkin.cpp.

Definition at line 174 of file poisson_2d_dis_galerkin.cpp.

174  {
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 }

◆ boundaryCondition()

MoFEMErrorCode Poisson2DiscontGalerkin::boundaryCondition ( )
private

[Setup problem]

[Boundary condition]

Examples
poisson_2d_dis_galerkin.cpp.

Definition at line 166 of file poisson_2d_dis_galerkin.cpp.

166  {
169 }

◆ checkResults()

MoFEMErrorCode Poisson2DiscontGalerkin::checkResults ( )
private

[Solve system]

Examples
poisson_2d_dis_galerkin.cpp.

Definition at line 262 of file poisson_2d_dis_galerkin.cpp.

262  {
264 
265  auto pipeline_mng = mField.getInterface<PipelineManager>();
266  pipeline_mng->getDomainRhsFE().reset();
267  pipeline_mng->getDomainLhsFE().reset();
268  pipeline_mng->getSkeletonRhsFE().reset();
269  pipeline_mng->getSkeletonLhsFE().reset();
270  pipeline_mng->getBoundaryRhsFE().reset();
271  pipeline_mng->getBoundaryLhsFE().reset();
272 
273  auto rule = [](int, int, int p) -> int { return 2 * p; };
274  CHKERR pipeline_mng->setDomainRhsIntegrationRule(rule);
275  auto rule_2 = [this](int, int, int) { return 2 * oRder; };
276  CHKERR pipeline_mng->setSkeletonRhsIntegrationRule(rule_2);
277 
278  auto add_base_ops = [&](auto &pipeline) {
279  auto det_ptr = boost::make_shared<VectorDouble>();
280  auto jac_ptr = boost::make_shared<MatrixDouble>();
281  auto inv_jac_ptr = boost::make_shared<MatrixDouble>();
282  pipeline.push_back(new OpCalculateHOJacForFace(jac_ptr));
283  pipeline.push_back(new OpInvertMatrix<2>(jac_ptr, det_ptr, inv_jac_ptr));
284  pipeline.push_back(new OpSetInvJacL2ForFace(inv_jac_ptr));
285  };
286 
287  auto u_vals_ptr = boost::make_shared<VectorDouble>();
288  auto u_grad_ptr = boost::make_shared<MatrixDouble>();
289 
290  add_base_ops(pipeline_mng->getOpDomainRhsPipeline());
291  pipeline_mng->getOpDomainRhsPipeline().push_back(
292  new OpCalculateScalarFieldValues(domainField, u_vals_ptr));
293  pipeline_mng->getOpDomainRhsPipeline().push_back(
295 
296  enum NORMS { L2 = 0, SEMI_NORM, H1, LAST_NORM };
297  std::array<int, LAST_NORM> error_indices;
298  for (int i = 0; i != LAST_NORM; ++i)
299  error_indices[i] = i;
300  auto l2_vec = createVectorMPI(
301  mField.get_comm(), (!mField.get_comm_rank()) ? LAST_NORM : 0, LAST_NORM);
302 
303  auto error_op = new DomainEleOp(domainField, DomainEleOp::OPROW);
304  error_op->doWorkRhsHook = [&](DataOperator *op_ptr, int side, EntityType type,
307  auto o = static_cast<DomainEleOp *>(op_ptr);
308 
310 
311  if (const size_t nb_dofs = data.getIndices().size()) {
312 
313  const int nb_integration_pts = o->getGaussPts().size2();
314  auto t_w = o->getFTensor0IntegrationWeight();
315  auto t_val = getFTensor0FromVec(*u_vals_ptr);
316  auto t_grad = getFTensor1FromMat<2>(*u_grad_ptr);
317  auto t_coords = o->getFTensor1CoordsAtGaussPts();
318 
319  std::array<double, LAST_NORM> error;
320  std::fill(error.begin(), error.end(), 0);
321 
322  for (int gg = 0; gg != nb_integration_pts; ++gg) {
323 
324  const double alpha = t_w * o->getMeasure();
325  const double diff =
326  t_val - u_exact(t_coords(0), t_coords(1), t_coords(2));
327 
328  auto t_exact_grad = u_grad_exact(t_coords(0), t_coords(1), t_coords(2));
329 
330  const double diff_grad =
331  (t_grad(i) - t_exact_grad(i)) * (t_grad(i) - t_exact_grad(i));
332 
333  error[L2] += alpha * pow(diff, 2);
334  error[SEMI_NORM] += alpha * diff_grad;
335 
336  ++t_w;
337  ++t_val;
338  ++t_grad;
339  ++t_coords;
340  }
341 
342  error[H1] = error[L2] + error[SEMI_NORM];
343 
344  CHKERR VecSetValues(l2_vec, LAST_NORM, error_indices.data(), error.data(),
345  ADD_VALUES);
346  }
347 
349  };
350 
351  auto side_fe_ptr = boost::make_shared<FaceSideEle>(mField);
352  add_base_ops(side_fe_ptr->getOpPtrVector());
353  side_fe_ptr->getOpPtrVector().push_back(
354  new OpCalculateScalarFieldValues(domainField, u_vals_ptr));
355  std::array<VectorDouble, 2> side_vals;
356  std::array<double, 2> area_map;
357 
358  auto side_vals_op = new DomainEleOp(domainField, DomainEleOp::OPROW);
359  side_vals_op->doWorkRhsHook = [&](DataOperator *op_ptr, int side,
360  EntityType type,
363  auto o = static_cast<FaceSideOp *>(op_ptr);
364 
365  const auto nb_in_loop = o->getFEMethod()->nInTheLoop;
366  area_map[nb_in_loop] = o->getMeasure();
367  side_vals[nb_in_loop] = *u_vals_ptr;
368  if (!nb_in_loop) {
369  area_map[1] = 0;
370  side_vals[1].clear();
371  }
372 
374  };
375  side_fe_ptr->getOpPtrVector().push_back(side_vals_op);
376 
377  auto do_work_rhs_error = [&](DataOperator *op_ptr, int side, EntityType type,
380  auto o = static_cast<BoundaryEleOp *>(op_ptr);
381 
382  CHKERR o->loopSideFaces("dFE", *side_fe_ptr);
383  const auto in_the_loop = side_fe_ptr->nInTheLoop;
384 
385 #ifndef NDEBUG
386  const std::array<std::string, 2> ele_type_name = {"BOUNDARY", "SKELETON"};
387  MOFEM_LOG("SELF", Sev::noisy)
388  << "do_work_rhs_error in_the_loop " << ele_type_name[in_the_loop];
389 #endif
390 
391  const double s = o->getMeasure() / (area_map[0] + area_map[1]);
392  const double p = penalty * s;
393 
394  constexpr std::array<int, 2> sign_array{1, -1};
395 
396  std::array<double, LAST_NORM> error;
397  std::fill(error.begin(), error.end(), 0);
398 
399  const int nb_integration_pts = o->getGaussPts().size2();
400 
401  if (!in_the_loop) {
402  side_vals[1].resize(nb_integration_pts, false);
403  auto t_coords = o->getFTensor1CoordsAtGaussPts();
404  auto t_val_m = getFTensor0FromVec(side_vals[1]);
405  for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
406  t_val_m = u_exact(t_coords(0), t_coords(1), t_coords(2));
407  ++t_coords;
408  ++t_val_m;
409  }
410  }
411 
412  auto t_val_p = getFTensor0FromVec(side_vals[0]);
413  auto t_val_m = getFTensor0FromVec(side_vals[1]);
414  auto t_w = o->getFTensor0IntegrationWeight();
415 
416  for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
417 
418  const double alpha = o->getMeasure() * t_w;
419  const auto diff = t_val_p - t_val_m;
420  error[SEMI_NORM] += alpha * p * diff * diff;
421 
422  ++t_w;
423  ++t_val_p;
424  ++t_val_m;
425  }
426 
427 
428  error[H1] = error[SEMI_NORM];
429  CHKERR VecSetValues(l2_vec, LAST_NORM, error_indices.data(), error.data(),
430  ADD_VALUES);
431 
433  };
434 
435  auto skeleton_error_op = new BoundaryEleOp(NOSPACE, BoundaryEleOp::OPSPACE);
436  skeleton_error_op->doWorkRhsHook = do_work_rhs_error;
437  auto boundary_error_op = new BoundaryEleOp(NOSPACE, BoundaryEleOp::OPSPACE);
438  boundary_error_op->doWorkRhsHook = do_work_rhs_error;
439 
440  pipeline_mng->getOpDomainRhsPipeline().push_back(error_op);
441  pipeline_mng->getOpSkeletonLhsPipeline().push_back(skeleton_error_op);
442  pipeline_mng->getOpBoundaryRhsPipeline().push_back(boundary_error_op);
443 
444  CHKERR pipeline_mng->loopFiniteElements();
445 
446  CHKERR VecAssemblyBegin(l2_vec);
447  CHKERR VecAssemblyEnd(l2_vec);
448 
449  if (mField.get_comm_rank() == 0) {
450  const double *array;
451  CHKERR VecGetArrayRead(l2_vec, &array);
452  MOFEM_LOG_C("SELF", Sev::inform, "Error Norm L2 %6.4e",
453  std::sqrt(array[L2]));
454  MOFEM_LOG_C("SELF", Sev::inform, "Error Norm Energetic %6.4e",
455  std::sqrt(array[SEMI_NORM]));
456  MOFEM_LOG_C("SELF", Sev::inform, "Error Norm H1 %6.4e",
457  std::sqrt(array[H1]));
458 
459  if(is_test) {
460  constexpr double eps = 1e-12;
461  if (std::sqrt(array[H1]) > eps)
462  SETERRQ(PETSC_COMM_WORLD, MOFEM_ATOM_TEST_INVALID, "Error is too big");
463  }
464 
465  CHKERR VecRestoreArrayRead(l2_vec, &array);
466  const MoFEM::Problem *problem_ptr;
468  MOFEM_LOG_C("SELF", Sev::inform, "Nb. DOFs %d",
469  problem_ptr->getNbDofsRow());
470  }
471 
472 
473 
475 }

◆ outputResults()

MoFEMErrorCode Poisson2DiscontGalerkin::outputResults ( )
private

[Output results]

Examples
poisson_2d_dis_galerkin.cpp.

Definition at line 478 of file poisson_2d_dis_galerkin.cpp.

478  {
480 
481  auto pipeline_mng = mField.getInterface<PipelineManager>();
482  pipeline_mng->getDomainLhsFE().reset();
483  pipeline_mng->getSkeletonRhsFE().reset();
484  pipeline_mng->getSkeletonLhsFE().reset();
485  pipeline_mng->getBoundaryRhsFE().reset();
486  pipeline_mng->getBoundaryLhsFE().reset();
487 
488  auto post_proc_fe = boost::make_shared<PostProcEle>(mField);
489 
490  auto u_ptr = boost::make_shared<VectorDouble>();
491  post_proc_fe->getOpPtrVector().push_back(
493 
495 
496  post_proc_fe->getOpPtrVector().push_back(
497 
498  new OpPPMap(
499 
500  post_proc_fe->getPostProcMesh(), post_proc_fe->getMapGaussPts(),
501 
502  {{"U", u_ptr}},
503 
504  {},
505 
506  {},
507 
508  {})
509 
510  );
511 
512  pipeline_mng->getDomainRhsFE() = post_proc_fe;
513  CHKERR pipeline_mng->loopFiniteElements();
514  CHKERR post_proc_fe->writeFile("out_result.h5m");
515 
517 }

◆ readMesh()

MoFEMErrorCode Poisson2DiscontGalerkin::readMesh ( )
private

[Read mesh]

Examples
poisson_2d_dis_galerkin.cpp.

Definition at line 105 of file poisson_2d_dis_galerkin.cpp.

105  {
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 }

◆ runProgram()

MoFEMErrorCode Poisson2DiscontGalerkin::runProgram ( )

[Output results]

[Run program]

Examples
poisson_2d_dis_galerkin.cpp.

Definition at line 521 of file poisson_2d_dis_galerkin.cpp.

521  {
523 
524  CHKERR readMesh();
532 
534 }

◆ setIntegrationRules()

MoFEMErrorCode Poisson2DiscontGalerkin::setIntegrationRules ( )
private

[Assemble system]

[Set integration rules]

Examples
poisson_2d_dis_galerkin.cpp.

Definition at line 216 of file poisson_2d_dis_galerkin.cpp.

216  {
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 }

◆ setupProblem()

MoFEMErrorCode Poisson2DiscontGalerkin::setupProblem ( )
private

[Read mesh]

[Setup problem]

Examples
poisson_2d_dis_galerkin.cpp.

Definition at line 124 of file poisson_2d_dis_galerkin.cpp.

124  {
126 
127  CHKERR PetscOptionsGetInt(PETSC_NULL, "", "-order", &oRder, PETSC_NULL);
128  CHKERR PetscOptionsGetScalar(PETSC_NULL, "", "-penalty", &penalty,
129  PETSC_NULL);
130  CHKERR PetscOptionsGetScalar(PETSC_NULL, "", "-phi", &phi, PETSC_NULL);
131  CHKERR PetscOptionsGetScalar(PETSC_NULL, "", "-nitsche", &nitsche,
132  PETSC_NULL);
133  PetscOptionsGetBool(PETSC_NULL, "", "-is_test", &is_test, PETSC_NULL);
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  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 }

◆ solveSystem()

MoFEMErrorCode Poisson2DiscontGalerkin::solveSystem ( )
private

[Set integration rules]

[Solve system]

Examples
poisson_2d_dis_galerkin.cpp.

Definition at line 237 of file poisson_2d_dis_galerkin.cpp.

237  {
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 }

Member Data Documentation

◆ domainField

std::string Poisson2DiscontGalerkin::domainField
private
Examples
poisson_2d_dis_galerkin.cpp.

Definition at line 97 of file poisson_2d_dis_galerkin.cpp.

◆ mField

MoFEM::Interface& Poisson2DiscontGalerkin::mField
private
Examples
poisson_2d_dis_galerkin.cpp.

Definition at line 93 of file poisson_2d_dis_galerkin.cpp.

◆ oRder

int Poisson2DiscontGalerkin::oRder
private
Examples
poisson_2d_dis_galerkin.cpp.

Definition at line 98 of file poisson_2d_dis_galerkin.cpp.

◆ simpleInterface

Simple* Poisson2DiscontGalerkin::simpleInterface
private
Examples
poisson_2d_dis_galerkin.cpp.

Definition at line 94 of file poisson_2d_dis_galerkin.cpp.


The documentation for this struct was generated from the following file:
NOSPACE
@ NOSPACE
Definition: definitions.h:83
MoFEM::UnknownInterface::getInterface
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
Definition: UnknownInterface.hpp:93
MoFEM::EntitiesFieldData::EntData
Data on single entity (This is passed as argument to DataOperator::doWork)
Definition: EntitiesFieldData.hpp:128
Poisson2DiscontGalerkin::solveSystem
MoFEMErrorCode solveSystem()
[Set integration rules]
Definition: poisson_2d_dis_galerkin.cpp:237
Poisson2DiscontGalerkin::readMesh
MoFEMErrorCode readMesh()
[Read mesh]
Definition: poisson_2d_dis_galerkin.cpp:105
MoFEM::PipelineManager::getDomainRhsFE
boost::shared_ptr< FEMethod > & getDomainRhsFE()
Definition: PipelineManager.hpp:405
H1
@ H1
continuous field
Definition: definitions.h:85
Poisson2DiscontGalerkin::checkResults
MoFEMErrorCode checkResults()
[Solve system]
Definition: poisson_2d_dis_galerkin.cpp:262
MoFEM::DataOperator
base operator to do operations at Gauss Pt. level
Definition: DataOperators.hpp:24
u_grad_exact
auto u_grad_exact
Definition: poisson_2d_dis_galerkin.cpp:50
MoFEM::CoreInterface::get_comm
virtual MPI_Comm & get_comm() const =0
L2
@ L2
field with C-1 continuity
Definition: definitions.h:88
phi
static double phi
Definition: poisson_2d_dis_galerkin.cpp:30
MoFEM::CoreInterface::get_comm_rank
virtual int get_comm_rank() const =0
MoFEM::Simple::loadFile
MoFEMErrorCode loadFile(const std::string options, const std::string mesh_file_name, LoadFileFunc loadFunc=defaultLoadFileFunc)
Load mesh file.
Definition: Simple.cpp:194
MoFEM::PipelineManager
PipelineManager interface.
Definition: PipelineManager.hpp:24
MoFEM::DMoFEMMeshToLocalVector
PetscErrorCode DMoFEMMeshToLocalVector(DM dm, Vec l, InsertMode mode, ScatterMode scatter_mode)
set local (or ghosted) vector values on mesh for partition only
Definition: DMMoFEM.cpp:523
Poisson2DiscontGalerkinOperators::OpL2LhsPenalty
Operator the left hand side matrix.
Definition: PoissonDiscontinousGalerkin.hpp:115
OpDomainGradGrad
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpGradGrad< BASE_DIM, FIELD_DIM, SPACE_DIM > OpDomainGradGrad
Definition: poisson_2d_dis_galerkin.cpp:37
DomainEleOp
DomainEle::UserDataOperator DomainEleOp
Definition: poisson_2d_dis_galerkin.cpp:18
MoFEM::VecSetValues
MoFEMErrorCode VecSetValues(Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.
Definition: EntitiesFieldData.hpp:1589
Poisson2DiscontGalerkinOperators::OpL2BoundaryRhs
Operator to evaluate Dirichlet boundary conditions using DG.
Definition: PoissonDiscontinousGalerkin.hpp:274
MoFEM::OpCalculateScalarFieldGradient
Get field gradients at integration pts for scalar filed rank 0, i.e. vector field.
Definition: UserDataOperators.hpp:1293
Poisson2DiscontGalerkin::setupProblem
MoFEMErrorCode setupProblem()
[Read mesh]
Definition: poisson_2d_dis_galerkin.cpp:124
MoFEM::OpSetInvJacL2ForFace
Definition: UserDataOperators.hpp:2925
MoFEM::Simple::getOptions
MoFEMErrorCode getOptions()
get options
Definition: Simple.cpp:180
u_exact
auto u_exact
Definition: poisson_2d_dis_galerkin.cpp:43
MoFEM::Simple::getAddSkeletonFE
bool & getAddSkeletonFE()
Get the addSkeletonFE.
Definition: Simple.hpp:452
Poisson2DiscontGalerkin::simpleInterface
Simple * simpleInterface
Definition: poisson_2d_dis_galerkin.cpp:94
MoFEM::Simple::getDM
MoFEMErrorCode getDM(DM *dm)
Get DM.
Definition: Simple.cpp:747
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
Poisson2DiscontGalerkin::domainField
std::string domainField
Definition: poisson_2d_dis_galerkin.cpp:97
MoFEM::createDMVector
auto createDMVector(DM dm)
Get smart vector from DM.
Definition: DMMoFEM.hpp:1099
Poisson2DiscontGalerkin::oRder
int oRder
Definition: poisson_2d_dis_galerkin.cpp:98
penalty
static double penalty
Definition: poisson_2d_dis_galerkin.cpp:29
MoFEM::CoreInterface::get_moab
virtual moab::Interface & get_moab()=0
FaceSideOp
BoundaryEleOp
MOFEM_LOG_C
#define MOFEM_LOG_C(channel, severity, format,...)
Definition: LogManager.hpp:311
convert.type
type
Definition: convert.py:64
MoFEM::Problem::getNbDofsRow
DofIdx getNbDofsRow() const
Definition: ProblemsMultiIndices.hpp:376
OpPPMap
OpPostProcMapInMoab< SPACE_DIM, SPACE_DIM > OpPPMap
Definition: photon_diffusion.cpp:29
MoFEM::getFTensor0FromVec
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
Definition: Templates.hpp:135
MoFEM::OpCalculateScalarFieldValues
Get value at integration points for scalar field.
Definition: UserDataOperators.hpp:82
MoFEM::Simple::addDomainField
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:264
MoFEM::PipelineManager::createKSP
SmartPetscObj< KSP > createKSP(SmartPetscObj< DM > dm=nullptr)
Create KSP (linear) solver.
Definition: PipelineManager.cpp:49
MoFEM::Simple::getAddBoundaryFE
bool & getAddBoundaryFE()
Get the addSkeletonFE.
Definition: Simple.hpp:463
Poisson2DiscontGalerkinOperators::OpCalculateSideData
Operator tp collect data from elements on the side of Edge/Face.
Definition: PoissonDiscontinousGalerkin.hpp:38
OpDomainSource
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpSource< BASE_DIM, FIELD_DIM > OpDomainSource
Definition: poisson_2d_dis_galerkin.cpp:39
nitsche
static double nitsche
Definition: poisson_2d_dis_galerkin.cpp:32
AINSWORTH_LOBATTO_BASE
@ AINSWORTH_LOBATTO_BASE
Definition: definitions.h:62
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
FTensor::Index< 'i', 2 >
MoFEM::Simple::setFieldOrder
MoFEMErrorCode setFieldOrder(const std::string field_name, const int order, const Range *ents=NULL)
Set field order.
Definition: Simple.cpp:545
MoFEM::PipelineManager::getDomainLhsFE
boost::shared_ptr< FEMethod > & getDomainLhsFE()
Definition: PipelineManager.hpp:401
DomainEleOp
MOFEM_LOG
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:308
MoFEM::vectorDuplicate
SmartPetscObj< Vec > vectorDuplicate(Vec vec)
Create duplicate vector of smart vector.
Definition: PetscSmartObj.hpp:221
BoundaryEleOp
BoundaryEle::UserDataOperator BoundaryEleOp
Definition: poisson_2d_dis_galerkin.cpp:22
Poisson2DiscontGalerkin::boundaryCondition
MoFEMErrorCode boundaryCondition()
[Setup problem]
Definition: poisson_2d_dis_galerkin.cpp:166
Poisson2DiscontGalerkin::assembleSystem
MoFEMErrorCode assembleSystem()
[Boundary condition]
Definition: poisson_2d_dis_galerkin.cpp:174
eps
static const double eps
Definition: check_base_functions_derivatives_on_tet.cpp:11
Poisson2DiscontGalerkin::mField
MoFEM::Interface & mField
Definition: poisson_2d_dis_galerkin.cpp:93
MoFEM::DMMoFEMGetProblemPtr
PetscErrorCode DMMoFEMGetProblemPtr(DM dm, const MoFEM::Problem **problem_ptr)
Get pointer to problem data structure.
Definition: DMMoFEM.cpp:426
MoFEM::createVectorMPI
auto createVectorMPI(MPI_Comm comm, PetscInt n, PetscInt N)
Create MPI Vector.
Definition: PetscSmartObj.hpp:202
MoFEM::OpInvertMatrix
Definition: UserDataOperators.hpp:3249
MoFEM::OpCalculateHOJacForFace
OpCalculateHOJacForFaceImpl< 2 > OpCalculateHOJacForFace
Definition: HODataOperators.hpp:264
ReactionDiffusionEquation::D
const double D
diffusivity
Definition: reaction_diffusion.cpp:20
Poisson2DiscontGalerkin::outputResults
MoFEMErrorCode outputResults()
[Output results]
Definition: poisson_2d_dis_galerkin.cpp:478
MOFEM_ATOM_TEST_INVALID
@ MOFEM_ATOM_TEST_INVALID
Definition: definitions.h:40
MoFEM::PetscOptionsGetScalar
PetscErrorCode PetscOptionsGetScalar(PetscOptions *, const char pre[], const char name[], PetscScalar *dval, PetscBool *set)
Definition: DeprecatedPetsc.hpp:162
MoFEM::Problem
keeps basic data about problem
Definition: ProblemsMultiIndices.hpp:54
is_test
PetscBool is_test
Definition: poisson_2d_dis_galerkin.cpp:41
source
auto source
Definition: poisson_2d_dis_galerkin.cpp:62
MoFEM::Simple::setUp
MoFEMErrorCode setUp(const PetscBool is_partitioned=PETSC_TRUE)
Setup problem.
Definition: Simple.cpp:683
convert.int
int
Definition: convert.py:64
MoFEM::PetscOptionsGetInt
PetscErrorCode PetscOptionsGetInt(PetscOptions *, const char pre[], const char name[], PetscInt *ivalue, PetscBool *set)
Definition: DeprecatedPetsc.hpp:142
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
Poisson2DiscontGalerkin::setIntegrationRules
MoFEMErrorCode setIntegrationRules()
[Assemble system]
Definition: poisson_2d_dis_galerkin.cpp:216
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
F
@ F
Definition: free_surface.cpp:394
MoFEM::PetscOptionsGetBool
PetscErrorCode PetscOptionsGetBool(PetscOptions *, const char pre[], const char name[], PetscBool *bval, PetscBool *set)
Definition: DeprecatedPetsc.hpp:182
MoFEM::OpPostProcMapInMoab
Post post-proc data at points from hash maps.
Definition: PostProcBrokenMeshInMoabBase.hpp:698