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

Go to the source code of this file.

Classes

struct  ElementsAndOps< DIM >
 
struct  ElementsAndOps< 2 >
 
struct  Poisson2DiscontGalerkin
 

Typedefs

using EntData = EntitiesFieldData::EntData
 
using DomainEle = ElementsAndOps< SPACE_DIM >::DomainEle
 
using DomainEleOp = DomainEle::UserDataOperator
 
using BoundaryEle = ElementsAndOps< SPACE_DIM >::BoundaryEle
 
using BoundaryEleOp = ElementsAndOps< SPACE_DIM >::BoundaryEleOp
 
using FaceSideEle = ElementsAndOps< 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 27 of file poisson_2d_dis_galerkin.cpp.

◆ BoundaryEleOp

Examples
poisson_2d_dis_galerkin.cpp.

Definition at line 28 of file poisson_2d_dis_galerkin.cpp.

◆ DomainEle

Definition at line 24 of file poisson_2d_dis_galerkin.cpp.

◆ DomainEleOp

Examples
poisson_2d_dis_galerkin.cpp.

Definition at line 25 of file poisson_2d_dis_galerkin.cpp.

◆ EntData

Examples
poisson_2d_dis_galerkin.cpp.

Definition at line 23 of file poisson_2d_dis_galerkin.cpp.

◆ FaceSideEle

Definition at line 29 of file poisson_2d_dis_galerkin.cpp.

◆ FaceSideOp

Definition at line 30 of file poisson_2d_dis_galerkin.cpp.

◆ OpDomainGradGrad

Examples
poisson_2d_dis_galerkin.cpp.

Definition at line 41 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 43 of file poisson_2d_dis_galerkin.cpp.

◆ PostProcEle

Definition at line 32 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 543 of file poisson_2d_dis_galerkin.cpp.

543 {
544
545 // Initialisation of MoFEM/PETSc and MOAB data structures
546 const char param_file[] = "param_file.petsc";
548
549 // Error handling
550 try {
551 // Register MoFEM discrete manager in PETSc
552 DMType dm_name = "DMMOFEM";
553 CHKERR DMRegister_MoFEM(dm_name);
554
555 // Create MOAB instance
556 moab::Core mb_instance; // mesh database
557 moab::Interface &moab = mb_instance; // mesh database interface
558
559 // Create MoFEM instance
560 MoFEM::Core core(moab); // finite element database
561 MoFEM::Interface &m_field = core; // finite element interface
562
563 // Run the main analysis
564 Poisson2DiscontGalerkin poisson_problem(m_field);
565 CHKERR poisson_problem.runProgram();
566 }
568
569 // Finish work: cleaning memory, getting statistics, etc.
571
572 return 0;
573}
std::string param_file
#define CATCH_ERRORS
Catch errors.
Definition: definitions.h:372
#define CHKERR
Inline error check.
Definition: definitions.h:535
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition: DMMMoFEM.cpp:47
CoreTmp< 0 > Core
Definition: Core.hpp:1086
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1955
static char help[]
Core (interface) class.
Definition: Core.hpp:82
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
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition: Core.cpp:112
Deprecated interface functions.

Variable Documentation

◆ BASE_DIM

constexpr int BASE_DIM = 1
constexpr
Examples
poisson_2d_dis_galerkin.cpp.

Definition at line 19 of file poisson_2d_dis_galerkin.cpp.

◆ FIELD_DIM

constexpr int FIELD_DIM = 1
constexpr
Examples
poisson_2d_dis_galerkin.cpp.

Definition at line 20 of file poisson_2d_dis_galerkin.cpp.

◆ help

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

Definition at line 77 of file poisson_2d_dis_galerkin.cpp.

◆ is_test

PetscBool is_test = PETSC_FALSE
Examples
poisson_2d_dis_galerkin.cpp.

Definition at line 46 of file poisson_2d_dis_galerkin.cpp.

◆ nitsche

double nitsche = 1
static

◆ penalty

double penalty = 1e6
static

Definition at line 34 of file poisson_2d_dis_galerkin.cpp.

◆ phi

double phi
static
Initial value:
=
-1
Examples
poisson_2d_dis_galerkin.cpp.

Definition at line 35 of file poisson_2d_dis_galerkin.cpp.

◆ 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);
}
PetscBool is_test
Examples
mixed_poisson.cpp, and poisson_2d_dis_galerkin.cpp.

Definition at line 67 of file poisson_2d_dis_galerkin.cpp.

◆ SPACE_DIM

constexpr int SPACE_DIM = 2
constexpr
Examples
poisson_2d_dis_galerkin.cpp.

Definition at line 21 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 48 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 55 of file poisson_2d_dis_galerkin.cpp.