v0.14.0
Classes | Typedefs | Functions | Variables
poisson_2d_dis_galerkin.cpp File Reference
#include <MoFEM.hpp>
#include <PoissonDiscontinousGalerkin.hpp>

Go to the source code of this file.

Classes

struct  Poisson2DiscontGalerkin
 

Typedefs

using EntData = EntitiesFieldData::EntData
 
using DomainEle = PipelineManager::ElementsAndOpsByDim< SPACE_DIM >::DomainEle
 
using DomainEleOp = DomainEle::UserDataOperator
 
using BoundaryEle = PipelineManager::ElementsAndOpsByDim< SPACE_DIM >::BoundaryEle
 
using BoundaryEleOp = BoundaryEle::UserDataOperator
 
using FaceSideEle = PipelineManager::ElementsAndOpsByDim< SPACE_DIM >::FaceSideEle
 
using FaceSideOp = FaceSideEle::UserDataOperator
 
using PostProcEle = PostProcBrokenMeshInMoab< DomainEle >
 
using OpDomainGradGrad = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpGradGrad< BASE_DIM, FIELD_DIM, SPACE_DIM >
 
using OpDomainSource = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpSource< BASE_DIM, FIELD_DIM >
 

Functions

int main (int argc, char *argv[])
 [Run program] More...
 

Variables

constexpr int BASE_DIM = 1
 
constexpr int FIELD_DIM = 1
 
constexpr int SPACE_DIM = 2
 
static double penalty = 1e6
 
static double phi
 
static double nitsche = 1
 
PetscBool is_test = PETSC_FALSE
 
auto u_exact
 
auto u_grad_exact
 
auto source
 
static char help [] = "...\n\n"
 

Typedef Documentation

◆ BoundaryEle

Definition at line 21 of file poisson_2d_dis_galerkin.cpp.

◆ BoundaryEleOp

Examples
poisson_2d_dis_galerkin.cpp.

Definition at line 22 of file poisson_2d_dis_galerkin.cpp.

◆ DomainEle

Definition at line 17 of file poisson_2d_dis_galerkin.cpp.

◆ DomainEleOp

Examples
poisson_2d_dis_galerkin.cpp.

Definition at line 18 of file poisson_2d_dis_galerkin.cpp.

◆ EntData

Examples
poisson_2d_dis_galerkin.cpp.

Definition at line 15 of file poisson_2d_dis_galerkin.cpp.

◆ FaceSideEle

Definition at line 24 of file poisson_2d_dis_galerkin.cpp.

◆ FaceSideOp

Examples
PoissonDiscontinousGalerkin.hpp.

Definition at line 25 of file poisson_2d_dis_galerkin.cpp.

◆ OpDomainGradGrad

Examples
poisson_2d_dis_galerkin.cpp.

Definition at line 37 of file poisson_2d_dis_galerkin.cpp.

◆ OpDomainSource

using OpDomainSource = FormsIntegrators<DomainEleOp>::Assembly< PETSC>::LinearForm<GAUSS>::OpSource<BASE_DIM, FIELD_DIM>
Examples
poisson_2d_dis_galerkin.cpp.

Definition at line 39 of file poisson_2d_dis_galerkin.cpp.

◆ PostProcEle

Definition at line 27 of file poisson_2d_dis_galerkin.cpp.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

[Run program]

[Main]

Examples
poisson_2d_dis_galerkin.cpp.

Definition at line 538 of file poisson_2d_dis_galerkin.cpp.

538  {
539 
540  // Initialisation of MoFEM/PETSc and MOAB data structures
541  const char param_file[] = "param_file.petsc";
542  MoFEM::Core::Initialize(&argc, &argv, param_file, help);
543 
544  // Error handling
545  try {
546  // Register MoFEM discrete manager in PETSc
547  DMType dm_name = "DMMOFEM";
548  CHKERR DMRegister_MoFEM(dm_name);
549 
550  // Create MOAB instance
551  moab::Core mb_instance; // mesh database
552  moab::Interface &moab = mb_instance; // mesh database interface
553 
554  // Create MoFEM instance
555  MoFEM::Core core(moab); // finite element database
556  MoFEM::Interface &m_field = core; // finite element interface
557 
558  // Run the main analysis
559  Poisson2DiscontGalerkin poisson_problem(m_field);
560  CHKERR poisson_problem.runProgram();
561  }
562  CATCH_ERRORS;
563 
564  // Finish work: cleaning memory, getting statistics, etc.
566 
567  return 0;
568 }

Variable Documentation

◆ BASE_DIM

constexpr int BASE_DIM = 1
constexpr
Examples
poisson_2d_dis_galerkin.cpp.

Definition at line 11 of file poisson_2d_dis_galerkin.cpp.

◆ FIELD_DIM

constexpr int FIELD_DIM = 1
constexpr
Examples
poisson_2d_dis_galerkin.cpp.

Definition at line 12 of file poisson_2d_dis_galerkin.cpp.

◆ help

char help[] = "...\n\n"
static
Examples
poisson_2d_dis_galerkin.cpp.

Definition at line 72 of file poisson_2d_dis_galerkin.cpp.

◆ is_test

PetscBool is_test = PETSC_FALSE
Examples
poisson_2d_dis_galerkin.cpp.

Definition at line 41 of file poisson_2d_dis_galerkin.cpp.

◆ nitsche

double nitsche = 1
static

◆ penalty

double penalty = 1e6
static

Definition at line 29 of file poisson_2d_dis_galerkin.cpp.

◆ phi

double phi
static

◆ source

auto source
Initial value:
= [](const double x, const double y, const double) {
if (is_test)
return -(2 * x * x + 2 * y * y);
else
return 8 * M_PI * M_PI * cos(2 * x * M_PI) * cos(2 * y * M_PI);
}
Examples
mixed_poisson.cpp, poisson_2d_dis_galerkin.cpp, and test_broken_space.cpp.

Definition at line 62 of file poisson_2d_dis_galerkin.cpp.

◆ SPACE_DIM

constexpr int SPACE_DIM = 2
constexpr
Examples
poisson_2d_dis_galerkin.cpp.

Definition at line 13 of file poisson_2d_dis_galerkin.cpp.

◆ u_exact

auto u_exact
Initial value:
= [](const double x, const double y, const double) {
if (is_test)
return x * x * y * y;
else
return cos(2 * x * M_PI) * cos(2 * y * M_PI);
}
Examples
poisson_2d_dis_galerkin.cpp.

Definition at line 43 of file poisson_2d_dis_galerkin.cpp.

◆ u_grad_exact

auto u_grad_exact
Initial value:
= [](const double x, const double y, const double) {
if (is_test)
return FTensor::Tensor1<double, 2>{2 * x * y * y, 2 * x * x * y};
else
-2 * M_PI * cos(2 * M_PI * y) * sin(2 * M_PI * x),
-2 * M_PI * cos(2 * M_PI * x) * sin(2 * M_PI * y)
};
}
Examples
poisson_2d_dis_galerkin.cpp.

Definition at line 50 of file poisson_2d_dis_galerkin.cpp.

MoFEM::CoreTmp< 0 >
Core (interface) class.
Definition: Core.hpp:82
FTensor::Tensor1
Definition: Tensor1_value.hpp:8
MoFEM::CoreTmp< 0 >::Finalize
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition: Core.cpp:112
MoFEM::DeprecatedCoreInterface
Deprecated interface functions.
Definition: DeprecatedCoreInterface.hpp:16
MoFEM::Interface
DeprecatedCoreInterface Interface
Definition: Interface.hpp:2010
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
Poisson2DiscontGalerkin
Definition: poisson_2d_dis_galerkin.cpp:74
double
MoFEM::DMRegister_MoFEM
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition: DMMoFEM.cpp:43
help
static char help[]
Definition: poisson_2d_dis_galerkin.cpp:72
MoFEM::CoreTmp< 0 >::Initialize
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
Definition: Core.cpp:72
CATCH_ERRORS
#define CATCH_ERRORS
Catch errors.
Definition: definitions.h:385
MoFEM::Core
CoreTmp< 0 > Core
Definition: Core.hpp:1148
is_test
PetscBool is_test
Definition: poisson_2d_dis_galerkin.cpp:41