v0.8.13
Macros | Enumerations | Functions | Variables
definitions.h File Reference

useful compiler directives and definitions More...

Go to the source code of this file.

Macros

#define DEPRECATED
 
#define BITREFEDGES_SIZE   6
 number of edges on tetrahedral More...
 
#define BITREFLEVEL_SIZE   128
 max number of refinements More...
 
#define BITFIELDID_SIZE   32
 max number of fields More...
 
#define BITFEID_SIZE   32
 max number of finite elements More...
 
#define BITPROBLEMID_SIZE   32
 max number of problems More...
 
#define BITINTERFACEUID_SIZE   32
 
#define MYPCOMM_INDEX   0
 default communicator number PCOMM More...
 
#define MB_TYPE_WIDTH   4
 
#define MB_ID_WIDTH   (8 * sizeof(EntityHandle) - MB_TYPE_WIDTH)
 
#define MB_TYPE_MASK   ((EntityHandle)0xF << MB_ID_WIDTH)
 
#define MB_START_ID   ((EntityID)1)
 All entity id's currently start at 1. More...
 
#define MB_END_ID   ((EntityID)MB_ID_MASK)
 Last id is the complement of the MASK. More...
 
#define MB_ID_MASK   (~MB_TYPE_MASK)
 
#define MAX_DOFS_ON_ENTITY   512
 Maximal number of DOFs on entity. More...
 
#define DOF_UID_MASK_ON_ENTITY   (MAX_DOFS_ON_ENTITY - 1)
 Mask for DOF number on entity form UId. More...
 
#define NOT_USED(x)   ((void)(x))
 
#define BARRIER_PCOMM_RANK_START(PCMB)
 set barrier start Run code in sequence, starting from process 0, and ends on last process. More...
 
#define BARRIER_RANK_START(PCMB)
 
#define BARRIER_PCOMM_RANK_END(PCMB)
 set barrier start Run code in sequence, starting from process 0, and ends on last process. More...
 
#define BARRIER_RANK_END(PCMB)
 
#define BARRIER_MOFEM_RANK_START(MOFEM)
 set barrier start Run code in sequence, starting from process 0, and ends on last process. More...
 
#define BARRIER_MOFEM_RANK_END(MOFEM)
 set barrier start Run code in sequence, starting from process 0, and ends on last process. More...
 
#define MoFEMFunctionBegin
 First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions should be MoFEMFunctionReturn(0);. More...
 
#define CATCH_ERRORS
 Catch errors. More...
 
#define MoFEMFunctionReturn(a)
 Last executable line of each PETSc function used for error handling. Replaces return() More...
 
#define MoFEMFunctionBeginHot   PetscFunctionBeginHot
 First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions should be MoFEMFunctionReturn(0); Use of this function allows for lighter profiling by default. More...
 
#define MoFEMFunctionReturnHot(a)   PetscFunctionReturn(a)
 Last executable line of each PETSc function used for error handling. Replaces return() More...
 
#define CHKERRQ_PETSC(n)   CHKERRQ(n)
 
#define CHKERRQ_MOAB(a)
 check error code of MoAB function More...
 
#define CHKERRG(n)
 Check error code of MoFEM/MOAB/PETSc function. More...
 
#define CHKERR   ErrorCheckerCode<__LINE__>() <<
 Inline error check. More...
 
#define MOAB_THROW(a)
 Check error code of MoAB function and throw MoFEM exception. More...
 
#define THROW_MESSAGE(a)
 Throw MoFEM exception. More...
 
#define SSTR(x)   toString(x)
 Convert number to string. More...
 
#define TENSOR1_VEC_PTR(VEC)   &VEC[0], &VEC[1], &VEC[2]
 
#define SYMMETRIC_TENSOR4_MAT_PTR(MAT)
 
#define TENSOR4_MAT_PTR(MAT)   &MAT(0, 0), MAT.size2()
 
#define TENSOR2_MAT_PTR(MAT)
 
#define SYMMETRIC_TENSOR2_MAT_PTR(MAT)   &MAT(0, 0), &MAT(0, 1), &MAT(0, 2), &MAT(0, 3), &MAT(0, 4), &MAT(0, 5)
 
#define SYMMETRIC_TENSOR2_VEC_PTR(VEC)   &VEC[0], &VEC[1], &VEC[2], &VEC[3], &VEC[4], &VEC[5]
 

Enumerations

enum  Interfaces {
  UNKNOWNINTERFACE = 1 << 0, CORE_INTERFACE = 1 << 0 | 1 << 1, DEPRECATED_CORE_INTERFACE = 1 << 0 | 1 << 2, PROBLEMSMANAGER_INTERFACE = 1 << 0 | 1 << 3,
  SIMPLE_INTERFACE = 1 << 0 | 1 << 4, MESH_REFINE = 1 << 1 | 1 << 2, PRISM_INTEFACE = 1 << 1 | 1 << 3, SERIES_RECORDER = 1 << 1 | 1 << 4,
  ISMANAGER_INTERFACE = 1 << 1 | 1 << 5, VECMANAGER_INTERFACE = 1 << 1 | 1 << 6, FIELDBLAS_INTERFACE = 1 << 1 | 1 << 7, BITREFMANAGER_INTERFACE = 1 << 1 | 1 << 8,
  TOOLS = 1 << 1 | 1 << 10, TETGEN_INTERFACE = 1 << 2 | 1 << 3, MED_INTERFACE = 1 << 2 | 1 << 4, NODEMERGER_INTERFACE = 1 << 2 | 1 << 5,
  BITLEVELCOUPLER_INTERFACE = 1 << 2 | 1 << 6, PRISMSFROMSURFACE_INTERFACE = 1 << 2 | 1 << 7, MESHSETSMANAGER_INTERFACE = 1 << 2 | 1 << 8, COORDSSYSTEMMANAGER_INTERFACE = 1 << 2 | 1 << 9,
  CUTMESH_INTERFACE = 1 << 2 | 1 << 10
}
 Interfaces IDs. More...
 
enum  LoopInterfaces {
  KSP_METHOD = 1 << 3 | 1 << 4, SNES_METHOD = 1 << 3 | 1 << 5, TS_METHOD = 1 << 3 | 1 << 6, BASIC_METHOD = 1 << 3 | 1 << 4 | 1 << 5 | 1 << 6,
  FE_METHOD = 1 << 3 | 1 << 4 | 1 << 5 | 1 << 6 | 1 << 7, ENTITY_METHOD = 1 << 3 | 1 << 4 | 1 << 5 | 1 << 6 | 1 << 9, DOF_METHOD = 1 << 3 | 1 << 4 | 1 << 5 | 1 << 6 | 1 << 9
}
 
enum  DMInterfaces { UNKNOWN_DM_INTERFACE = 1 << 4 | 1 << 5, DMCTX_INTERFACE = 1 << 4 | 1 << 6 }
 interfaces for PETSc DM interfaces More...
 
enum  BaseIntefaces {
  UNKNOWN_BASE_FUNCTION_INTERFACE = 1 << 5 | 1 << 6, LEGENDRE_BASE_FUNCTION_INTERFACE = 1 << 5 | 1 << 7, LOBATTO_BASE_FUNCTION_INTERFACE = 1 << 5 | 1 << 8, KERNEL_BASE_FUNCTION_INTERFACE = 1 << 5 | 1 << 9,
  JACOBI_BASE_FUNCTION_INTERFACE = 1 << 5 | 1 << 10, INTEGRATED_JACOBI_BASE_FUNCTION_INTERFACE = 1 << 5 | 1 << 11, ENT_BASE_FUNCTION_INTERFACE = 1 << 5 | 1 << 6 | 1 << 7, TET_BASE_FUNCTION_INTERFACE = 1 << 5 | 1 << 6 | 1 << 8,
  TRI_BASE_FUNCTION_INTERFACE = 1 << 5 | 1 << 6 | 1 << 9, EDGE_BASE_FUNCTION_INTERFACE = 1 << 5 | 1 << 6 | 1 << 10, FATPRISM_BASE_FUNCTION_INTERFACE = 1 << 5 | 1 << 6 | 1 << 11, FLATPRISM_BASE_FUNCTION_INTERFACE = 1 << 5 | 1 << 6 | 1 << 12
}
 Interfaces uses to manage base functions. More...
 
enum  MoFEMErrorCodes {
  MOFEM_SUCESS = 0, MOFEM_DATA_INCONSISTENCY = 100, MOFEM_NOT_IMPLEMENTED = 101, MOFEM_NOT_FOUND = 102,
  MOFEM_OPERATION_UNSUCCESSFUL = 103, MOFEM_IMPOSIBLE_CASE = 104, MOFEM_INVALID_DATA = 105, MOFEM_NOT_INSTALLED = 106,
  MOFEM_MOFEMEXCEPTION_THROW = 107, MOFEM_STD_EXCEPTION_THROW = 108, MOFEM_ATOM_TEST_INVALID = 109, MOFEM_MOAB_ERROR = 110
}
 Error handling. More...
 
enum  FieldApproximationBase {
  NOBASE = 0, AINSWORTH_LEGENDRE_BASE, AINSWORTH_LOBATTO_BASE, AINSWORTH_BERNSTEIN_BEZIER_BASE,
  DEMKOWICZ_JACOBI_BASE, USER_BASE, LASTBASE
}
 approximation base More...
 
enum  FieldSpace {
  NOSPACE = 0, NOFIELD = 1, H1, HCURL,
  HDIV, L2, LASTSPACE
}
 approximation spaces More...
 
enum  MoFEMTypes { MF_ZERO = 0, MF_EXCL = 1 << 0, MF_EXIST = 1 << 1 }
 Those types control how functions respond on arguments, f.e. error handling. More...
 
enum  RowColData { ROW = 0, COL, DATA, LASTROWCOLDATA }
 RowColData. More...
 
enum  ByWhat {
  BYROW = 1 << 0, BYCOL = 1 << 1, BYDATA = 1 << 2, BYROWDATA = 1 << 0 | 1 << 2,
  BYCOLDATA = 1 << 1 | 1 << 2, BYROWCOL = 1 << 0 | 1 << 1, BYALL = 1 << 0 | 1 << 1 | 1 << 2
}
 
enum  CubitBC {
  UNKNOWNSET = 0, NODESET = 1 << 0, SIDESET = 1 << 1, BLOCKSET = 1 << 2,
  MATERIALSET = 1 << 3, DISPLACEMENTSET = 1 << 4, FORCESET = 1 << 5, PRESSURESET = 1 << 6,
  VELOCITYSET = 1 << 7, ACCELERATIONSET = 1 << 8, TEMPERATURESET = 1 << 9, HEATFLUXSET = 1 << 10,
  INTERFACESET = 1 << 11, UNKNOWNNAME = 1 << 12, MAT_ELASTICSET = 1 << 13, MAT_INTERFSET = 1 << 14,
  MAT_THERMALSET = 1 << 15, BODYFORCESSET = 1 << 16, MAT_MOISTURESET = 1 << 17, DIRICHLET_BC = 1 << 18,
  NEUMANN_BC = 1 << 19, LASTSET_BC = 1 << 20
}
 Types of sets and boundary conditions. More...
 
enum  H1DiffFormating { H1_0 = 0, H1_1, H1_2 }
 Format of rows in gradients of H1 base functions. More...
 
enum  HDivFormatting { HDIV0 = 0, HDIV1, HDIV2 }
 Format in rows of Hdiv base functions. More...
 
enum  HDivDiffFormatting {
  HDIV0_0 = 0, HDIV1_0, HDIV2_0, HDIV0_1,
  HDIV1_1, HDIV2_1, HDIV0_2, HDIV1_2,
  HDIV2_2
}
 Format in rows of Hdiv gradients of base functions. More...
 
enum  HCurlFormatting { HCURL0 = 0, HCURL1, HCURL2 }
 Format in rows of Hcurl base functions. More...
 
enum  HCurlDiffFormatting {
  HCURL0_0 = 0, HCURL1_0, HCURL2_0, HCURL0_1,
  HCURL1_1, HCURL2_1, HCURL0_2, HCURL1_2,
  HCURL2_2
}
 Format in rows of Hcurl gradients of base functions. More...
 
enum  VERBOSITY_LEVELS {
  DEFAULT_VERBOSITY = -1, QUIET = 0, VERBOSE, VERY_VERBOSE,
  NOISY, VERY_NOISY
}
 Verbosity levels. More...
 

Functions

DEPRECATED void macro_is_deprecated_using_deprecated_function ()
 Is used to indicate that macro is deprecated Do nothing just triggers error at the compilation. More...
 

Variables

static const char *const MoFEMErrorCodesNames []
 
static const char *const ApproximationBaseNames []
 
static const char *const FieldSpaceNames []
 
static const char *const CubitBCNames []
 Names of types of sets and boundary conditions. More...
 

Detailed Description

useful compiler directives and definitions

Definition in file definitions.h.

Macro Definition Documentation

◆ BARRIER_MOFEM_RANK_END

#define BARRIER_MOFEM_RANK_END (   MOFEM)
Value:
{ \
for (int i = (MOFEM)->get_comm_rank(); i < (MOFEM)->get_comm_size(); i++) \
MPI_Barrier((MOFEM)->get_comm()); \
};

set barrier start Run code in sequence, starting from process 0, and ends on last process.

It can be only used for testing. Do not use that function as a part of these code.

Definition at line 403 of file definitions.h.

◆ BARRIER_MOFEM_RANK_START

#define BARRIER_MOFEM_RANK_START (   MOFEM)
Value:
{ \
for (int i = 0; i < (MOFEM)->get_comm_rank(); i++) \
MPI_Barrier((MOFEM)->get_comm()); \
};

set barrier start Run code in sequence, starting from process 0, and ends on last process.

It can be only used for testing. Do not use that function as a part of these code.

Definition at line 390 of file definitions.h.

◆ BARRIER_PCOMM_RANK_END

#define BARRIER_PCOMM_RANK_END (   PCMB)
Value:
{ \
for (unsigned int i = PCMB->proc_config().proc_rank(); \
i < PCMB->proc_config().proc_size(); i++) \
MPI_Barrier(PCMB->proc_config().proc_comm()); \
};

set barrier start Run code in sequence, starting from process 0, and ends on last process.

It can be only used for testing. Do not use that function as a part of these code.

Definition at line 366 of file definitions.h.

◆ BARRIER_PCOMM_RANK_START

#define BARRIER_PCOMM_RANK_START (   PCMB)
Value:
{ \
for (unsigned int i = 0; i < PCMB->proc_config().proc_rank(); i++) \
MPI_Barrier(PCMB->proc_config().proc_comm()); \
};

set barrier start Run code in sequence, starting from process 0, and ends on last process.

It can be only used for testing. Do not use that function as a part of these code.

Definition at line 344 of file definitions.h.

◆ BARRIER_RANK_END

#define BARRIER_RANK_END (   PCMB)
Value:
{ \
macro_is_deprecated_using_deprecated_function(); \
for (unsigned int i = PCMB->proc_config().proc_rank(); \
i < PCMB->proc_config().proc_size(); i++) \
MPI_Barrier(PCMB->proc_config().proc_comm()); \
};
Deprecated:
Do use this macro, instead use BARRIER_PCOMM_RANK_START

Definition at line 375 of file definitions.h.

◆ BARRIER_RANK_START

#define BARRIER_RANK_START (   PCMB)
Value:
{ \
macro_is_deprecated_using_deprecated_function(); \
for (unsigned int i = 0; i < PCMB->proc_config().proc_rank(); i++) \
MPI_Barrier(PCMB->proc_config().proc_comm()); \
};
Deprecated:
Do use this macro, instead use BARRIER_PCOMM_RANK_START

Definition at line 352 of file definitions.h.

◆ BITFEID_SIZE

#define BITFEID_SIZE   32

max number of finite elements

Definition at line 314 of file definitions.h.

◆ BITFIELDID_SIZE

#define BITFIELDID_SIZE   32

max number of fields

Definition at line 313 of file definitions.h.

◆ BITINTERFACEUID_SIZE

#define BITINTERFACEUID_SIZE   32

Definition at line 316 of file definitions.h.

◆ BITPROBLEMID_SIZE

#define BITPROBLEMID_SIZE   32

max number of problems

Definition at line 315 of file definitions.h.

◆ BITREFEDGES_SIZE

#define BITREFEDGES_SIZE   6

number of edges on tetrahedral

Definition at line 311 of file definitions.h.

◆ BITREFLEVEL_SIZE

#define BITREFLEVEL_SIZE   128

max number of refinements

Definition at line 312 of file definitions.h.

◆ CATCH_ERRORS

#define CATCH_ERRORS
Value:
catch (MoFEMExceptionInitial const &ex) { \
return PetscError(PETSC_COMM_SELF, ex.lINE, PETSC_FUNCTION_NAME, __FILE__, \
ex.errorCode, PETSC_ERROR_INITIAL, ex.what()); \
} \
catch (MoFEMExceptionRepeat const &ex) { \
return PetscError(PETSC_COMM_SELF, ex.lINE, PETSC_FUNCTION_NAME, __FILE__, \
ex.errorCode, PETSC_ERROR_REPEAT, " "); \
} \
catch (MoFEMException const &ex) { \
SETERRQ(PETSC_COMM_SELF, ex.errorCode, ex.errorMessage); \
} \
catch (std::exception const &ex) { \
std::string message("Error: " + std::string(ex.what()) + " at " + \
boost::lexical_cast<std::string>(__LINE__) + " : " + \
std::string(__FILE__) + " in " + \
std::string(PETSC_FUNCTION_NAME)); \
SETERRQ(PETSC_COMM_SELF, MOFEM_STD_EXCEPTION_THROW, message.c_str()); \
}

Catch errors.

Usage in main functions

int main(int argc, char *argv[]) {
MoFEM::Core::Initialize(&argc, &argv, (char *)0, help);
try {
// More code here
}
}
Examples:
analytical_nonlinear_poisson.cpp, analytical_poisson.cpp, analytical_poisson_field_split.cpp, cubit_bc_test.cpp, delete_ho_nodes.cpp, elasticity.cpp, field_to_vertices.cpp, forces_and_sources_testing_edge_element.cpp, hello_world.cpp, magnetostatic.cpp, mesh_cut.cpp, mesh_smoothing.cpp, minimal_surface_area.cpp, simple_elasticity.cpp, simple_interface.cpp, split_sideset.cpp, and unsaturated_transport.cpp.

Definition at line 465 of file definitions.h.

◆ CHKERR

#define CHKERR   ErrorCheckerCode<__LINE__>() <<

Inline error check.

// Call other functions
CHKERR fun_moab();
CHKERR fun_petsc();
CHKERR fun_mofem();
// Throw error
SETERRQ(PETSC_COMM_WORLD, MOFEM_DATA_INCONSISTENCY, "Some error message");
}
int main(int argc, char *argv[]) {
// Initailise MoFEM and Petsc
MoFEM::Core::Initialize(&argc, &argv, (char *)0, help);
try {
moab::Core mb_instance; // MoAB database
moab::Interface &moab = mb_instance;
MoFEM::Core core(moab); // MOFEM database
MoFEM::CoreInterface &m_field = core;
CHKERR foo(); // Call function
}
}
Examples:
analytical_nonlinear_poisson.cpp, analytical_poisson.cpp, analytical_poisson_field_split.cpp, AuxPoissonFunctions.hpp, cubit_bc_test.cpp, delete_ho_nodes.cpp, elasticity.cpp, field_to_vertices.cpp, forces_and_sources_testing_edge_element.cpp, hello_world.cpp, MagneticElement.hpp, magnetostatic.cpp, mesh_cut.cpp, mesh_smoothing.cpp, minimal_surface_area.cpp, PoissonOperators.hpp, simple_elasticity.cpp, simple_interface.cpp, split_sideset.cpp, and unsaturated_transport.cpp.

Definition at line 614 of file definitions.h.

◆ CHKERRG

#define CHKERRG (   n)
Value:
if ((boost::is_same<BOOST_TYPEOF((n)), \
MoFEMErrorCodeGeneric<PetscErrorCode>>::value)) { \
CHKERRQ_PETSC((n)); \
} else if (boost::is_same<BOOST_TYPEOF((n)), \
MoFEMErrorCodeGeneric<moab::ErrorCode>>::value) { \
CHKERRQ_MOAB((n)); \
}

Check error code of MoFEM/MOAB/PETSc function.

Parameters
aMoFEMErrorCode
rval = fun_moab(); CHKERRG(rval);
ierr = fun_petsc(); CHKERRG(ierr);
merr = fun_mofem(); CHKERRG(merr);
Note
Function detect type of errocode using specialized template function getErrorType, i.e. condition is evaluated at compilation time.
Examples:
analytical_nonlinear_poisson.cpp, analytical_poisson.cpp, analytical_poisson_field_split.cpp, delete_ho_nodes.cpp, elasticity.cpp, field_to_vertices.cpp, mesh_cut.cpp, mesh_smoothing.cpp, minimal_surface_area.cpp, NeoHookean.hpp, simple_elasticity.cpp, simple_interface.cpp, split_sideset.cpp, unsaturated_transport.cpp, and UnsaturatedFlow.hpp.

Definition at line 562 of file definitions.h.

◆ CHKERRQ_MOAB

#define CHKERRQ_MOAB (   a)
Value:
if (PetscUnlikely(MB_SUCCESS != (a))) { \
std::string error_str = (unsigned)(a) <= (unsigned)MB_FAILURE \
? moab::ErrorCodeStr[a] \
: "INVALID ERROR CODE"; \
std::string str("MOAB error (" + boost::lexical_cast<std::string>((a)) + \
") " + error_str + " at line " + \
boost::lexical_cast<std::string>(__LINE__) + " : " + \
std::string(__FILE__)); \
SETERRQ(PETSC_COMM_SELF, MOFEM_MOAB_ERROR, str.c_str()); \
}

check error code of MoAB function

Parameters
aMoABErrorCode
Examples:
cell_forces.cpp.

Definition at line 533 of file definitions.h.

◆ CHKERRQ_PETSC

#define CHKERRQ_PETSC (   n)    CHKERRQ(n)

Definition at line 528 of file definitions.h.

◆ DEPRECATED

#define DEPRECATED

Definition at line 29 of file definitions.h.

◆ DOF_UID_MASK_ON_ENTITY

#define DOF_UID_MASK_ON_ENTITY   (MAX_DOFS_ON_ENTITY - 1)

Mask for DOF number on entity form UId.

Definition at line 332 of file definitions.h.

◆ MAX_DOFS_ON_ENTITY

#define MAX_DOFS_ON_ENTITY   512

Maximal number of DOFs on entity.

Definition at line 331 of file definitions.h.

◆ MB_END_ID

#define MB_END_ID   ((EntityID)MB_ID_MASK)

Last id is the complement of the MASK.

Definition at line 327 of file definitions.h.

◆ MB_ID_MASK

#define MB_ID_MASK   (~MB_TYPE_MASK)

Definition at line 329 of file definitions.h.

◆ MB_ID_WIDTH

#define MB_ID_WIDTH   (8 * sizeof(EntityHandle) - MB_TYPE_WIDTH)

Definition at line 322 of file definitions.h.

◆ MB_START_ID

#define MB_START_ID   ((EntityID)1)

All entity id's currently start at 1.

Definition at line 326 of file definitions.h.

◆ MB_TYPE_MASK

#define MB_TYPE_MASK   ((EntityHandle)0xF << MB_ID_WIDTH)

Definition at line 323 of file definitions.h.

◆ MB_TYPE_WIDTH

#define MB_TYPE_WIDTH   4

Definition at line 321 of file definitions.h.

◆ MOAB_THROW

#define MOAB_THROW (   a)
Value:
{ \
if (PetscUnlikely(MB_SUCCESS != (a))) { \
std::string error_str = (unsigned)(a) <= (unsigned)MB_FAILURE \
? moab::ErrorCodeStr[a] \
: "INVALID ERROR CODE"; \
std::string str("MOAB error (" + boost::lexical_cast<std::string>((a)) + \
") " + error_str + " at line " + \
boost::lexical_cast<std::string>(__LINE__) + " : " + \
std::string(__FILE__)); \
throw MoFEMException(MOFEM_MOAB_ERROR, str.c_str()); \
} \
}

Check error code of MoAB function and throw MoFEM exception.

Parameters
aMoABErrorCode

Definition at line 620 of file definitions.h.

◆ MoFEMFunctionBegin

#define MoFEMFunctionBegin
Value:
PetscFunctionBegin; \
try {

First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions should be MoFEMFunctionReturn(0);.

Not collective

Example

PetscErrorCode fun() {
int something;
}
Examples:
analytical_poisson_field_split.cpp, AuxPoissonFunctions.hpp, forces_and_sources_testing_edge_element.cpp, hello_world.cpp, MagneticElement.hpp, mesh_smoothing.cpp, PoissonOperators.hpp, simple_elasticity.cpp, and simple_interface.cpp.

Definition at line 439 of file definitions.h.

◆ MoFEMFunctionBeginHot

#define MoFEMFunctionBeginHot   PetscFunctionBeginHot

First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions should be MoFEMFunctionReturn(0); Use of this function allows for lighter profiling by default.

Not collective

Example:

PetscErrorCode fun() {
int something;
// some work here
}
Examples:
mesh_smoothing.cpp, NeoHookean.hpp, simple_interface.cpp, and UnsaturatedFlow.hpp.

Definition at line 519 of file definitions.h.

◆ MoFEMFunctionReturn

#define MoFEMFunctionReturn (   a)
Value:
} \
CATCH_ERRORS \
PetscFunctionReturn(a)

Last executable line of each PETSc function used for error handling. Replaces return()

Parameters
aerror code
Note
MoFEMFunctionReturn has to be used with MoFEMFunctionBegin and can be used only at the end of the function. If is need to return function in earlier use MoFEMFunctionReturnHot
Examples:
analytical_poisson_field_split.cpp, AuxPoissonFunctions.hpp, forces_and_sources_testing_edge_element.cpp, hello_world.cpp, MagneticElement.hpp, mesh_smoothing.cpp, PoissonOperators.hpp, simple_elasticity.cpp, and simple_interface.cpp.

Definition at line 495 of file definitions.h.

◆ MoFEMFunctionReturnHot

#define MoFEMFunctionReturnHot (   a)    PetscFunctionReturn(a)

Last executable line of each PETSc function used for error handling. Replaces return()

Parameters
aerror code
Examples:
analytical_poisson_field_split.cpp, MagneticElement.hpp, mesh_smoothing.cpp, NeoHookean.hpp, PoissonOperators.hpp, simple_elasticity.cpp, simple_interface.cpp, and UnsaturatedFlow.hpp.

Definition at line 526 of file definitions.h.

◆ MYPCOMM_INDEX

#define MYPCOMM_INDEX   0

◆ NOT_USED

#define NOT_USED (   x)    ((void)(x))

Definition at line 335 of file definitions.h.

◆ SSTR

#define SSTR (   x)    toString(x)

Convert number to string.

Parameters
xnumber

Definition at line 650 of file definitions.h.

◆ SYMMETRIC_TENSOR2_MAT_PTR

#define SYMMETRIC_TENSOR2_MAT_PTR (   MAT)    &MAT(0, 0), &MAT(0, 1), &MAT(0, 2), &MAT(0, 3), &MAT(0, 4), &MAT(0, 5)

Definition at line 668 of file definitions.h.

◆ SYMMETRIC_TENSOR2_VEC_PTR

#define SYMMETRIC_TENSOR2_VEC_PTR (   VEC)    &VEC[0], &VEC[1], &VEC[2], &VEC[3], &VEC[4], &VEC[5]

Definition at line 671 of file definitions.h.

◆ SYMMETRIC_TENSOR4_MAT_PTR

#define SYMMETRIC_TENSOR4_MAT_PTR (   MAT)
Value:
&MAT(0, 0), &MAT(0, 1), &MAT(0, 2), &MAT(0, 3), &MAT(0, 4), &MAT(0, 5), \
&MAT(1, 0), &MAT(1, 1), &MAT(1, 2), &MAT(1, 3), &MAT(1, 4), &MAT(1, 5), \
&MAT(2, 0), &MAT(2, 1), &MAT(2, 2), &MAT(2, 3), &MAT(2, 4), &MAT(2, 5), \
&MAT(3, 0), &MAT(3, 1), &MAT(3, 2), &MAT(3, 3), &MAT(3, 4), &MAT(3, 5), \
&MAT(4, 0), &MAT(4, 1), &MAT(4, 2), &MAT(4, 3), &MAT(4, 4), &MAT(4, 5), \
&MAT(5, 0), &MAT(5, 1), &MAT(5, 2), &MAT(5, 3), &MAT(5, 4), &MAT(5, 5)

Definition at line 654 of file definitions.h.

◆ TENSOR1_VEC_PTR

#define TENSOR1_VEC_PTR (   VEC)    &VEC[0], &VEC[1], &VEC[2]

Definition at line 652 of file definitions.h.

◆ TENSOR2_MAT_PTR

#define TENSOR2_MAT_PTR (   MAT)
Value:
&MAT(0, 0), &MAT(1, 0), &MAT(2, 0), &MAT(3, 0), &MAT(4, 0), &MAT(5, 0), \
&MAT(6, 0), &MAT(7, 0), &MAT(8, 0)

Definition at line 664 of file definitions.h.

◆ TENSOR4_MAT_PTR

#define TENSOR4_MAT_PTR (   MAT)    &MAT(0, 0), MAT.size2()

Definition at line 662 of file definitions.h.

◆ THROW_MESSAGE

#define THROW_MESSAGE (   a)
Value:
{ \
std::string str("MoFEM error " + boost::lexical_cast<std::string>((a)) + \
" at line " + boost::lexical_cast<std::string>(__LINE__) + \
" : " + std::string(__FILE__)); \
}

Throw MoFEM exception.

Parameters
amessage

Definition at line 638 of file definitions.h.

Enumeration Type Documentation

◆ BaseIntefaces

Interfaces uses to manage base functions.

Enumerator
UNKNOWN_BASE_FUNCTION_INTERFACE 
LEGENDRE_BASE_FUNCTION_INTERFACE 
LOBATTO_BASE_FUNCTION_INTERFACE 
KERNEL_BASE_FUNCTION_INTERFACE 
JACOBI_BASE_FUNCTION_INTERFACE 
INTEGRATED_JACOBI_BASE_FUNCTION_INTERFACE 
ENT_BASE_FUNCTION_INTERFACE 
TET_BASE_FUNCTION_INTERFACE 
TRI_BASE_FUNCTION_INTERFACE 
EDGE_BASE_FUNCTION_INTERFACE 
FATPRISM_BASE_FUNCTION_INTERFACE 
FLATPRISM_BASE_FUNCTION_INTERFACE 

Definition at line 88 of file definitions.h.

◆ ByWhat

enum ByWhat

Controls adjency multi_index container (e.g. BYROW is adjacenciecy by field on on rows), see MoFEM::FieldEntityEntFiniteElementAdjacencyMap

Enumerator
BYROW 
BYCOL 
BYDATA 
BYROWDATA 
BYCOLDATA 
BYROWCOL 
BYALL 

Definition at line 201 of file definitions.h.

201  {
202  BYROW = 1 << 0,
203  BYCOL = 1 << 1,
204  BYDATA = 1 << 2,
205  BYROWDATA = 1 << 0 | 1 << 2,
206  BYCOLDATA = 1 << 1 | 1 << 2,
207  BYROWCOL = 1 << 0 | 1 << 1,
208  BYALL = 1 << 0 | 1 << 1 | 1 << 2
209 };

◆ CubitBC

enum CubitBC

Types of sets and boundary conditions.

Enumerator
UNKNOWNSET 
NODESET 
SIDESET 
BLOCKSET 
MATERIALSET 
DISPLACEMENTSET 
FORCESET 
PRESSURESET 
VELOCITYSET 
ACCELERATIONSET 
TEMPERATURESET 
HEATFLUXSET 
INTERFACESET 
UNKNOWNNAME 
MAT_ELASTICSET 

block name is "MAT_ELASTIC"

MAT_INTERFSET 
MAT_THERMALSET 

block name is "MAT_THERMAL"

BODYFORCESSET 

block name is "BODY_FORCES"

MAT_MOISTURESET 

block name is "MAT_MOISTURE"

DIRICHLET_BC 
NEUMANN_BC 
LASTSET_BC 

Definition at line 215 of file definitions.h.

215  {
216  UNKNOWNSET = 0,
217  NODESET = 1 << 0,
218  SIDESET = 1 << 1,
219  BLOCKSET = 1 << 2,
220  MATERIALSET = 1 << 3,
221  DISPLACEMENTSET = 1 << 4,
222  FORCESET = 1 << 5,
223  PRESSURESET = 1 << 6,
224  VELOCITYSET = 1 << 7,
225  ACCELERATIONSET = 1 << 8,
226  TEMPERATURESET = 1 << 9,
227  HEATFLUXSET = 1 << 10,
228  INTERFACESET = 1 << 11,
229  UNKNOWNNAME = 1 << 12,
230  MAT_ELASTICSET = 1 << 13, ///< block name is "MAT_ELASTIC"
231  MAT_INTERFSET = 1 << 14,
232  MAT_THERMALSET = 1 << 15, ///< block name is "MAT_THERMAL"
233  BODYFORCESSET = 1 << 16, ///< block name is "BODY_FORCES"
234  MAT_MOISTURESET = 1 << 17, ///< block name is "MAT_MOISTURE"
235  DIRICHLET_BC = 1 << 18,
236  NEUMANN_BC = 1 << 19,
237  LASTSET_BC = 1 << 20
238 };
block name is "MAT_MOISTURE"
Definition: definitions.h:234
block name is "MAT_THERMAL"
Definition: definitions.h:232
block name is "BODY_FORCES"
Definition: definitions.h:233
block name is "MAT_ELASTIC"
Definition: definitions.h:230

◆ DMInterfaces

interfaces for PETSc DM interfaces

Enumerator
UNKNOWN_DM_INTERFACE 
DMCTX_INTERFACE 

Definition at line 80 of file definitions.h.

80  {
81  UNKNOWN_DM_INTERFACE = 1 << 4 | 1 << 5,
82  DMCTX_INTERFACE = 1 << 4 | 1 << 6
83 };

◆ FieldApproximationBase

approximation base

Enumerator
NOBASE 
AINSWORTH_LEGENDRE_BASE 

Ainsworth Cole (Legendre) approx. base [1].

AINSWORTH_LOBATTO_BASE 

Like AINSWORTH_LEGENDRE_BASE but with Lobatto base instead Legendre [11]

AINSWORTH_BERNSTEIN_BEZIER_BASE 

Not yet implemented, in implementation we will follow [3] and [2]

DEMKOWICZ_JACOBI_BASE 

Construction of base is by Demkowicz [22]

USER_BASE 

user implemented approximation base

LASTBASE 

Definition at line 140 of file definitions.h.

140  {
141  NOBASE = 0,
143  1, ///< Ainsworth Cole (Legendre) approx. base \cite NME:NME847
144  AINSWORTH_LOBATTO_BASE, ///< Like AINSWORTH_LEGENDRE_BASE but with Lobatto
145  ///< base instead Legendre \cite beriot2015efficient
146  AINSWORTH_BERNSTEIN_BEZIER_BASE, ///< Not yet implemented, in implementation
147  ///< we will follow \cite
148  ///< ainsworth2011bernstein and \cite ainsworth2018bernstein
149  DEMKOWICZ_JACOBI_BASE, ///< Construction of base is by Demkowicz \cite
150  ///< fuentes2015orientation
151  USER_BASE, ///< user implemented approximation base
152  LASTBASE
153 };
user implemented approximation base
Definition: definitions.h:151
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:142

◆ FieldSpace

enum FieldSpace

approximation spaces

Enumerator
NOSPACE 
NOFIELD 

scalar or vector of scalars describe (no true field)

H1 

continuous field

HCURL 

field with continuous tangents

HDIV 

field with continuous normal traction

L2 

field with C-1 continuity

LASTSPACE 

FieldSpace in [ 0, LASTSPACE )

Definition at line 176 of file definitions.h.

176  {
177  NOSPACE = 0,
178  NOFIELD = 1, ///< scalar or vector of scalars describe (no true field)
179  H1, ///< continuous field
180  HCURL, ///< field with continuous tangents
181  HDIV, ///< field with continuous normal traction
182  L2, ///< field with C-1 continuity
183  LASTSPACE ///< FieldSpace in [ 0, LASTSPACE )
184 };
field with continuous normal traction
Definition: definitions.h:181
scalar or vector of scalars describe (no true field)
Definition: definitions.h:178
FieldSpace in [ 0, LASTSPACE )
Definition: definitions.h:183
field with continuous tangents
Definition: definitions.h:180
continuous field
Definition: definitions.h:179
field with C-1 continuity
Definition: definitions.h:182

◆ H1DiffFormating

Format of rows in gradients of H1 base functions.

Enumerator
H1_0 
H1_1 
H1_2 

Definition at line 257 of file definitions.h.

257 { H1_0 = 0, H1_1, H1_2 };

◆ HCurlDiffFormatting

Format in rows of Hcurl gradients of base functions.

Enumerator
HCURL0_0 
HCURL1_0 
HCURL2_0 
HCURL0_1 
HCURL1_1 
HCURL2_1 
HCURL0_2 
HCURL1_2 
HCURL2_2 

Definition at line 287 of file definitions.h.

287  {
288  HCURL0_0 = 0,
289  HCURL1_0,
290  HCURL2_0,
291  HCURL0_1,
292  HCURL1_1,
293  HCURL2_1,
294  HCURL0_2,
295  HCURL1_2,
296  HCURL2_2
297 };

◆ HCurlFormatting

Format in rows of Hcurl base functions.

Enumerator
HCURL0 
HCURL1 
HCURL2 

Definition at line 282 of file definitions.h.

282 { HCURL0 = 0, HCURL1, HCURL2 };

◆ HDivDiffFormatting

Format in rows of Hdiv gradients of base functions.

Enumerator
HDIV0_0 
HDIV1_0 
HDIV2_0 
HDIV0_1 
HDIV1_1 
HDIV2_1 
HDIV0_2 
HDIV1_2 
HDIV2_2 

Definition at line 267 of file definitions.h.

267  {
268  HDIV0_0 = 0,
269  HDIV1_0,
270  HDIV2_0,
271  HDIV0_1,
272  HDIV1_1,
273  HDIV2_1,
274  HDIV0_2,
275  HDIV1_2,
276  HDIV2_2
277 };

◆ HDivFormatting

Format in rows of Hdiv base functions.

Enumerator
HDIV0 
HDIV1 
HDIV2 

Definition at line 262 of file definitions.h.

262 { HDIV0 = 0, HDIV1, HDIV2 };

◆ Interfaces

enum Interfaces

Interfaces IDs.

To manage different complexities related to field, finite elements mesh refinements, etc. a appropriate interfaces related to each complexities are created. Interfaces by itself could vary by functionality or the same function can me managed with two interfaces with waring level of abstraction.

Enumerator
UNKNOWNINTERFACE 
CORE_INTERFACE 
DEPRECATED_CORE_INTERFACE 
PROBLEMSMANAGER_INTERFACE 
SIMPLE_INTERFACE 
MESH_REFINE 
PRISM_INTEFACE 
SERIES_RECORDER 
ISMANAGER_INTERFACE 
VECMANAGER_INTERFACE 
FIELDBLAS_INTERFACE 
BITREFMANAGER_INTERFACE 
TOOLS 
TETGEN_INTERFACE 
MED_INTERFACE 
NODEMERGER_INTERFACE 
BITLEVELCOUPLER_INTERFACE 
PRISMSFROMSURFACE_INTERFACE 
MESHSETSMANAGER_INTERFACE 
COORDSSYSTEMMANAGER_INTERFACE 
CUTMESH_INTERFACE 

Definition at line 40 of file definitions.h.

40  {
41  UNKNOWNINTERFACE = 1 << 0,
42  // Field Interface
43  CORE_INTERFACE = 1 << 0 | 1 << 1,
44  DEPRECATED_CORE_INTERFACE = 1 << 0 | 1 << 2,
45  PROBLEMSMANAGER_INTERFACE = 1 << 0 | 1 << 3,
46  SIMPLE_INTERFACE = 1 << 0 | 1 << 4,
47  MESH_REFINE = 1 << 1 | 1 << 2,
48  PRISM_INTEFACE = 1 << 1 | 1 << 3,
49  SERIES_RECORDER = 1 << 1 | 1 << 4,
50  ISMANAGER_INTERFACE = 1 << 1 | 1 << 5,
51  VECMANAGER_INTERFACE = 1 << 1 | 1 << 6,
52  FIELDBLAS_INTERFACE = 1 << 1 | 1 << 7,
53  BITREFMANAGER_INTERFACE = 1 << 1 | 1 << 8,
54  TOOLS = 1 << 1 | 1 << 10,
55  // Independent Interfaces
56  TETGEN_INTERFACE = 1 << 2 | 1 << 3,
57  MED_INTERFACE = 1 << 2 | 1 << 4,
58  NODEMERGER_INTERFACE = 1 << 2 | 1 << 5,
59  BITLEVELCOUPLER_INTERFACE = 1 << 2 | 1 << 6,
60  PRISMSFROMSURFACE_INTERFACE = 1 << 2 | 1 << 7,
61  MESHSETSMANAGER_INTERFACE = 1 << 2 | 1 << 8,
62  COORDSSYSTEMMANAGER_INTERFACE = 1 << 2 | 1 << 9,
63  CUTMESH_INTERFACE = 1 << 2 | 1 << 10
64 };

◆ LoopInterfaces

Enumerator
KSP_METHOD 
SNES_METHOD 
TS_METHOD 
BASIC_METHOD 
FE_METHOD 
ENTITY_METHOD 
DOF_METHOD 

Definition at line 66 of file definitions.h.

66  {
67  // Loop Methods
68  KSP_METHOD = 1 << 3 | 1 << 4,
69  SNES_METHOD = 1 << 3 | 1 << 5,
70  TS_METHOD = 1 << 3 | 1 << 6,
71  BASIC_METHOD = 1 << 3 | 1 << 4 | 1 << 5 | 1 << 6,
72  FE_METHOD = 1 << 3 | 1 << 4 | 1 << 5 | 1 << 6 | 1 << 7,
73  ENTITY_METHOD = 1 << 3 | 1 << 4 | 1 << 5 | 1 << 6 | 1 << 9,
74  DOF_METHOD = 1 << 3 | 1 << 4 | 1 << 5 | 1 << 6 | 1 << 9,
75 };

◆ MoFEMErrorCodes

Error handling.

This is complementary to PETSC error codes. The numerical values for these are defined in include/petscerror.h. The names are defined in err.c

MoAB error messages are defined in moab/Types.hpp

Enumerator
MOFEM_SUCESS 
MOFEM_DATA_INCONSISTENCY 
MOFEM_NOT_IMPLEMENTED 
MOFEM_NOT_FOUND 
MOFEM_OPERATION_UNSUCCESSFUL 
MOFEM_IMPOSIBLE_CASE 
MOFEM_INVALID_DATA 
MOFEM_NOT_INSTALLED 
MOFEM_MOFEMEXCEPTION_THROW 
MOFEM_STD_EXCEPTION_THROW 
MOFEM_ATOM_TEST_INVALID 
MOFEM_MOAB_ERROR 

Definition at line 111 of file definitions.h.

◆ MoFEMTypes

enum MoFEMTypes

Those types control how functions respond on arguments, f.e. error handling.

Enumerator
MF_ZERO 
MF_EXCL 
MF_EXIST 

Definition at line 191 of file definitions.h.

191 { MF_ZERO = 0, MF_EXCL = 1 << 0, MF_EXIST = 1 << 1 };

◆ RowColData

enum RowColData

RowColData.

Enumerator
ROW 
COL 
DATA 
LASTROWCOLDATA 

Definition at line 194 of file definitions.h.

◆ VERBOSITY_LEVELS

Verbosity levels.

Enumerator
DEFAULT_VERBOSITY 
QUIET 
VERBOSE 
VERY_VERBOSE 
NOISY 
VERY_NOISY 

Definition at line 302 of file definitions.h.

302  {
303  DEFAULT_VERBOSITY = -1,
304  QUIET = 0,
305  VERBOSE,
306  VERY_VERBOSE,
307  NOISY,
308  VERY_NOISY
309 };

Function Documentation

◆ macro_is_deprecated_using_deprecated_function()

DEPRECATED void macro_is_deprecated_using_deprecated_function ( )

Is used to indicate that macro is deprecated Do nothing just triggers error at the compilation.

Definition at line 20 of file Core.cpp.

20 {}

Variable Documentation

◆ ApproximationBaseNames

const char* const ApproximationBaseNames[]
static
Initial value:
= {
"NOBASE",
"AINSWORTH_LEGENDRE_BASE",
"AINSWORTH_LOBATTO_BASE",
"AINSWORTH_BERNSTEIN_BEZIER_BASE",
"DEMKOWICZ_JACOBI_BASE",
"USER_BASE",
"LASTBASE"}

Definition at line 155 of file definitions.h.

◆ CubitBCNames

const char* const CubitBCNames[]
static
Initial value:
= {
"UNKNOWNSET", "NODESET", "SIDESET", "BLOCKSET",
"MATERIALSET", "DISPLACEMENTSET", "FORCESET", "PRESSURESET",
"VELOCITYSET", "ACCELERATIONSET", "TEMPERATURESET", "HEATFLUXSET",
"INTERFACESET", "UNKNOWNNAME", "MAT_ELASTICSET", "MAT_INTERFSET",
"MAT_THERMALSET", "BODYFORCESSET", "MAT_MOISTURESET", "DIRICHLET_BC",
"NEUMANN_BC", "LASTSET_BC"}

Names of types of sets and boundary conditions.

Definition at line 246 of file definitions.h.

◆ FieldSpaceNames

const char* const FieldSpaceNames[]
static
Initial value:
= {
"NOSPACE", "NOFIELD", "H1", "HCURL", "HDIV", "L2", "LASTSPACE"}

Definition at line 186 of file definitions.h.

◆ MoFEMErrorCodesNames

const char* const MoFEMErrorCodesNames[]
static
Initial value:
= {
"MOFEM_SUCESS",
"MOFEM_DATA_INCONSISTENCY",
"MOFEM_NOT_IMPLEMENTED",
"MOFEM_NOT_FOUND",
"MOFEM_OPERATION_UNSUCCESSFUL",
"MOFEM_IMPOSIBLE_CASE",
"MOFEM_INVALID_DATA",
"MOFEM_MOFEMEXCEPTION_THROW",
"MOFEM_STD_EXCEPTION_THROW",
"MOFEM_ATOM_TEST_INVALID",
"MOFEM_MOAB_ERROR"}

Definition at line 126 of file definitions.h.