 |
| v0.10.0
|
Go to the documentation of this file.
19 #ifndef __DEFINITONS_H__
20 #define __DEFINITONS_H__
24 #define DEPRECATED __attribute__((deprecated))
25 #elif defined(_MSC_VER)
26 #define DEPRECATED __declspec(deprecated)
28 #pragma message("WARNING: You need to implement DEPRECATED for this compiler")
81 FE_METHOD = 1 << 3 | 1 << 4 | 1 << 5 | 1 << 6 | 1 << 7,
138 "MOFEM_DATA_INCONSISTENCY",
139 "MOFEM_NOT_IMPLEMENTED",
141 "MOFEM_OPERATION_UNSUCCESSFUL",
142 "MOFEM_IMPOSIBLE_CASE",
143 "MOFEM_INVALID_DATA",
144 "MOFEM_MOFEMEXCEPTION_THROW",
145 "MOFEM_STD_EXCEPTION_THROW",
146 "MOFEM_ATOM_TEST_INVALID",
166 "AINSWORTH_LEGENDRE_BASE",
167 "AINSWORTH_LOBATTO_BASE",
168 "AINSWORTH_BERNSTEIN_BEZIER_BASE",
169 "DEMKOWICZ_JACOBI_BASE",
185 "NOSPACE",
"NOFIELD",
"H1",
"HCURL",
"HDIV",
"L2",
"LASTSPACE"};
206 BYALL = 1 << 0 | 1 << 1 | 1 << 2
245 "UNKNOWNSET",
"NODESET",
"SIDESET",
"BLOCKSET",
246 "MATERIALSET",
"DISPLACEMENTSET",
"FORCESET",
"PRESSURESET",
247 "VELOCITYSET",
"ACCELERATIONSET",
"TEMPERATURESET",
"HEATFLUXSET",
248 "INTERFACESET",
"UNKNOWNNAME",
"MAT_ELASTICSET",
"MAT_INTERFSET",
249 "MAT_THERMALSET",
"BODYFORCESSET",
"MAT_MOISTURESET",
"DIRICHLET_BC",
250 "NEUMANN_BC",
"LASTSET_BC"};
284 #define MAX_CORE_TMP 1
285 #define BITREFEDGES_SIZE 6
286 #define BITREFLEVEL_SIZE 128
287 #define BITFIELDID_SIZE 32
288 #define BITFEID_SIZE 32
289 #define BITPROBLEMID_SIZE 32
290 #define BITINTERFACEUID_SIZE 32
292 #define MYPCOMM_INDEX 0
295 #define MB_TYPE_WIDTH 4
296 #define MB_ID_WIDTH (8 * sizeof(EntityHandle) - MB_TYPE_WIDTH)
297 #define MB_TYPE_MASK ((EntityHandle)0xF << MB_ID_WIDTH)
300 #define MB_START_ID ((EntityID)1)
302 ((EntityID)MB_ID_MASK)
303 #define MB_ID_MASK (~MB_TYPE_MASK)
305 #define MAX_DOFS_ON_ENTITY 512
306 #define MAX_PROCESSORS_NUMBER 1024
307 #define DOF_UID_MASK \
308 (MAX_DOFS_ON_ENTITY - 1)
309 #define ENTITY_UID_MASK (~DOF_UID_MASK)
311 #define NOT_USED(x) ((void)(x))
320 #define BARRIER_PCOMM_RANK_START(PCMB) \
322 for (unsigned int i = 0; i < PCMB->proc_config().proc_rank(); i++) \
323 MPI_Barrier(PCMB->proc_config().proc_comm()); \
328 #define BARRIER_RANK_START(PCMB) \
330 macro_is_deprecated_using_deprecated_function(); \
331 for (unsigned int i = 0; i < PCMB->proc_config().proc_rank(); i++) \
332 MPI_Barrier(PCMB->proc_config().proc_comm()); \
342 #define BARRIER_PCOMM_RANK_END(PCMB) \
344 for (unsigned int i = PCMB->proc_config().proc_rank(); \
345 i < PCMB->proc_config().proc_size(); i++) \
346 MPI_Barrier(PCMB->proc_config().proc_comm()); \
351 #define BARRIER_RANK_END(PCMB) \
353 macro_is_deprecated_using_deprecated_function(); \
354 for (unsigned int i = PCMB->proc_config().proc_rank(); \
355 i < PCMB->proc_config().proc_size(); i++) \
356 MPI_Barrier(PCMB->proc_config().proc_comm()); \
366 #define BARRIER_MOFEM_RANK_START(MOFEM) \
368 for (int i = 0; i < (MOFEM)->get_comm_rank(); i++) \
369 MPI_Barrier((MOFEM)->get_comm()); \
379 #define BARRIER_MOFEM_RANK_END(MOFEM) \
381 for (int i = (MOFEM)->get_comm_rank(); i < (MOFEM)->get_comm_size(); i++) \
382 MPI_Barrier((MOFEM)->get_comm()); \
415 #define MoFEMFunctionBegin \
416 PetscFunctionBegin; \
441 #define CATCH_ERRORS \
442 catch (MoFEMExceptionInitial const &ex) { \
443 return PetscError(PETSC_COMM_SELF, ex.lINE, PETSC_FUNCTION_NAME, __FILE__, \
444 ex.errorCode, PETSC_ERROR_INITIAL, ex.what()); \
446 catch (MoFEMExceptionRepeat const &ex) { \
447 return PetscError(PETSC_COMM_SELF, ex.lINE, PETSC_FUNCTION_NAME, __FILE__, \
448 ex.errorCode, PETSC_ERROR_REPEAT, " "); \
450 catch (MoFEMException const &ex) { \
451 SETERRQ(PETSC_COMM_SELF, ex.errorCode, ex.errorMessage); \
453 catch (boost::bad_weak_ptr & ex) { \
454 std::string message("Boost bad weak ptr: " + std::string(ex.what()) + \
455 " at " + boost::lexical_cast<std::string>(__LINE__) + \
456 " : " + std::string(__FILE__) + " in " + \
457 std::string(PETSC_FUNCTION_NAME)); \
458 SETERRQ(PETSC_COMM_SELF, MOFEM_STD_EXCEPTION_THROW, message.c_str()); \
460 catch (std::out_of_range & ex) { \
461 std::string message("Std out of range error: " + std::string(ex.what()) + \
462 " at " + boost::lexical_cast<std::string>(__LINE__) + \
463 " : " + std::string(__FILE__) + " in " + \
464 std::string(PETSC_FUNCTION_NAME)); \
465 SETERRQ(PETSC_COMM_SELF, MOFEM_STD_EXCEPTION_THROW, message.c_str()); \
467 catch (std::exception const &ex) { \
468 std::string message("Std error: " + std::string(ex.what()) + " at " + \
469 boost::lexical_cast<std::string>(__LINE__) + " : " + \
470 std::string(__FILE__) + " in " + \
471 std::string(PETSC_FUNCTION_NAME)); \
472 SETERRQ(PETSC_COMM_SELF, MOFEM_STD_EXCEPTION_THROW, message.c_str()); \
485 #define MoFEMFunctionReturn(a) \
488 PetscFunctionReturn(a)
509 #define MoFEMFunctionBeginHot PetscFunctionBeginHot
516 #define MoFEMFunctionReturnHot(a) PetscFunctionReturn(a)
518 #define CHKERRQ_PETSC(n) CHKERRQ(n)
523 #define CHKERRQ_MOAB(a) \
524 if (PetscUnlikely(MB_SUCCESS != (a))) { \
525 std::string error_str = (unsigned)(a) <= (unsigned)MB_FAILURE \
526 ? moab::ErrorCodeStr[a] \
527 : "INVALID ERROR CODE"; \
528 std::string str("MOAB error (" + boost::lexical_cast<std::string>((a)) + \
529 ") " + error_str + " at line " + \
530 boost::lexical_cast<std::string>(__LINE__) + " : " + \
531 std::string(__FILE__)); \
532 SETERRQ(PETSC_COMM_SELF, MOFEM_MOAB_ERROR, str.c_str()); \
553 if ((boost::is_same<BOOST_TYPEOF((n)), \
554 MoFEMErrorCodeGeneric<PetscErrorCode>>::value)) { \
555 CHKERRQ_PETSC((n)); \
556 } else if (boost::is_same<BOOST_TYPEOF((n)), \
557 MoFEMErrorCodeGeneric<moab::ErrorCode>>::value) { \
604 #define CHKERR MoFEM::ErrorChecker<__LINE__>() <<
610 #define MOAB_THROW(a) \
612 if (PetscUnlikely(MB_SUCCESS != (a))) { \
613 std::string error_str = (unsigned)(a) <= (unsigned)MB_FAILURE \
614 ? moab::ErrorCodeStr[a] \
615 : "INVALID ERROR CODE"; \
616 std::string str("MOAB error (" + boost::lexical_cast<std::string>((a)) + \
617 ") " + error_str + " at line " + \
618 boost::lexical_cast<std::string>(__LINE__) + " : " + \
619 std::string(__FILE__)); \
620 throw MoFEMException(MOFEM_MOAB_ERROR, str.c_str()); \
628 #define THROW_MESSAGE(a) \
630 throw MoFEM::MoFEMException( \
631 MOFEM_MOFEMEXCEPTION_THROW, \
632 ("MoFEM error " + boost::lexical_cast<std::string>((a)) + \
633 " at line " + boost::lexical_cast<std::string>(__LINE__) + " : " + \
634 std::string(__FILE__)) \
642 #define SSTR(x) toString(x)
644 #define TENSOR1_VEC_PTR(VEC) &VEC[0], &VEC[1], &VEC[2]
646 #define SYMMETRIC_TENSOR4_MAT_PTR(MAT) \
647 &MAT(0, 0), &MAT(0, 1), &MAT(0, 2), &MAT(0, 3), &MAT(0, 4), &MAT(0, 5), \
648 &MAT(1, 0), &MAT(1, 1), &MAT(1, 2), &MAT(1, 3), &MAT(1, 4), &MAT(1, 5), \
649 &MAT(2, 0), &MAT(2, 1), &MAT(2, 2), &MAT(2, 3), &MAT(2, 4), &MAT(2, 5), \
650 &MAT(3, 0), &MAT(3, 1), &MAT(3, 2), &MAT(3, 3), &MAT(3, 4), &MAT(3, 5), \
651 &MAT(4, 0), &MAT(4, 1), &MAT(4, 2), &MAT(4, 3), &MAT(4, 4), &MAT(4, 5), \
652 &MAT(5, 0), &MAT(5, 1), &MAT(5, 2), &MAT(5, 3), &MAT(5, 4), &MAT(5, 5)
654 #define TENSOR4_MAT_PTR(MAT) &MAT(0, 0), MAT.size2()
656 #define TENSOR2_MAT_PTR(MAT) \
657 &MAT(0, 0), &MAT(1, 0), &MAT(2, 0), &MAT(3, 0), &MAT(4, 0), &MAT(5, 0), \
658 &MAT(6, 0), &MAT(7, 0), &MAT(8, 0)
660 #define SYMMETRIC_TENSOR2_MAT_PTR(MAT) \
661 &MAT(0, 0), &MAT(0, 1), &MAT(0, 2), &MAT(0, 3), &MAT(0, 4), &MAT(0, 5)
663 #define SYMMETRIC_TENSOR2_VEC_PTR(VEC) \
664 &VEC[0], &VEC[1], &VEC[2], &VEC[3], &VEC[4], &VEC[5]
666 #endif //__DEFINITONS_H__
@ LOBATTO_BASE_FUNCTION_INTERFACE
@ KERNEL_BASE_FUNCTION_INTERFACE
static const char *const MoFEMErrorCodesNames[]
@ BITREFMANAGER_INTERFACE
@ MOFEM_STD_EXCEPTION_THROW
static const char *const ApproximationBaseNames[]
@ PROBLEMSMANAGER_INTERFACE
@ QUAD_BASE_FUNCTION_INTERFACE
@ L2
field with C-1 continuity
HVecFormatting
Format in rows of vectorial base functions.
@ FIELDEVALUATOR_INTERFACE
@ USER_BASE
user implemented approximation base
@ PRISMSFROMSURFACE_INTERFACE
FieldSpace
approximation spaces
@ MAT_THERMALSET
block name is "MAT_THERMAL"
VERBOSITY_LEVELS
Verbosity levels.
@ BODYFORCESSET
block name is "BODY_FORCES"
@ EDGE_BASE_FUNCTION_INTERFACE
@ MESHSETSMANAGER_INTERFACE
@ MAT_ELASTICSET
block name is "MAT_ELASTIC"
@ JACOBI_BASE_FUNCTION_INTERFACE
@ LASTSPACE
FieldSpace in [ 0, LASTSPACE )
@ TRI_BASE_FUNCTION_INTERFACE
HVecDiffFormatting
Format in rows of vectorial base gradients of base functions.
MoFEMErrorCodes
Error handling.
@ BITLEVELCOUPLER_INTERFACE
@ MOFEM_OPERATION_UNSUCCESSFUL
@ MOFEM_MOFEMEXCEPTION_THROW
@ AINSWORTH_BERNSTEIN_BEZIER_BASE
@ LEGENDRE_BASE_FUNCTION_INTERFACE
@ COORDSSYSTEMMANAGER_INTERFACE
@ UNKNOWN_BASE_FUNCTION_INTERFACE
DMInterfaces
interfaces for PETSc DM interfaces
@ MATRIX_MANAGER_INTERFACE
@ FATPRISM_BASE_FUNCTION_INTERFACE
Interfaces
Interfaces IDs.
static const char *const FieldSpaceNames[]
BaseIntefaces
Interfaces uses to manage base functions.
static const char *const CubitBCNames[]
Names of types of sets and boundary conditions.
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
@ HCURL
field with continuous tangents
@ MOFEM_DATA_INCONSISTENCY
FieldApproximationBase
approximation base
MoFEMTypes
Those types control how functions respond on arguments, f.e. error handling.
@ MOFEM_ATOM_TEST_INVALID
@ DEPRECATED_CORE_INTERFACE
@ HDIV
field with continuous normal traction
@ INTEGRATED_JACOBI_BASE_FUNCTION_INTERFACE
@ MAT_MOISTURESET
block name is "MAT_MOISTURE"
@ FLATPRISM_BASE_FUNCTION_INTERFACE
DEPRECATED void macro_is_deprecated_using_deprecated_function()
Is used to indicate that macro is deprecated Do nothing just triggers error at the compilation.
CubitBC
Types of sets and boundary conditions.
@ TET_BASE_FUNCTION_INTERFACE
@ NOFIELD
scalar or vector of scalars describe (no true field)
@ ENT_BASE_FUNCTION_INTERFACE