v0.8.13
definitions.h
Go to the documentation of this file.
1 /** \file definitions.h
2  * \brief useful compiler directives and definitions
3  */
4 
5 /* MoFEM is free software: you can redistribute it and/or modify it under
6  * the terms of the GNU Lesser General Public License as published by the
7  * Free Software Foundation, either version 3 of the License, or (at your
8  * option) any later version.
9  *
10  * MoFEM is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
13  * License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with MoFEM. If not, see <http://www.gnu.org/licenses/>
17  */
18 
19 #ifndef __DEFINITONS_H__
20 #define __DEFINITONS_H__
21 
22 // taken from http://stackoverflow.com/questions/295120/c-mark-as-deprecated
23 #ifdef __GNUC__
24 #define DEPRECATED __attribute__((deprecated))
25 #elif defined(_MSC_VER)
26 #define DEPRECATED __declspec(deprecated)
27 #else
28 #pragma message("WARNING: You need to implement DEPRECATED for this compiler")
29 #define DEPRECATED
30 #endif
31 
32 /** \brief Interfaces IDs
33  *
34  * To manage different complexities related to field, finite elements mesh
35  * refinements, etc. a appropriate interfaces related to each complexities are
36  * created. Interfaces by itself could vary by functionality or the same
37  * function can me managed with two interfaces with waring level of abstraction.
38  *
39  */
40 enum Interfaces {
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 };
65 
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 };
76 
77 /**
78  * \brief interfaces for PETSc DM interfaces
79  */
81  UNKNOWN_DM_INTERFACE = 1 << 4 | 1 << 5,
82  DMCTX_INTERFACE = 1 << 4 | 1 << 6
83 };
84 
85 /**
86  * \brief Interfaces uses to manage base functions
87  */
92  KERNEL_BASE_FUNCTION_INTERFACE = 1 << 5 | 1 << 9,
93  JACOBI_BASE_FUNCTION_INTERFACE = 1 << 5 | 1 << 10,
95  ENT_BASE_FUNCTION_INTERFACE = 1 << 5 | 1 << 6 | 1 << 7,
96  TET_BASE_FUNCTION_INTERFACE = 1 << 5 | 1 << 6 | 1 << 8,
97  TRI_BASE_FUNCTION_INTERFACE = 1 << 5 | 1 << 6 | 1 << 9,
98  EDGE_BASE_FUNCTION_INTERFACE = 1 << 5 | 1 << 6 | 1 << 10,
99  FATPRISM_BASE_FUNCTION_INTERFACE = 1 << 5 | 1 << 6 | 1 << 11,
100  FLATPRISM_BASE_FUNCTION_INTERFACE = 1 << 5 | 1 << 6 | 1 << 12
101 };
102 
103 /** \brief Error handling
104  *
105  * This is complementary to PETSC error codes. The numerical values for
106  * these are defined in include/petscerror.h. The names are defined in err.c
107  *
108  * MoAB error messages are defined in moab/Types.hpp
109  *
110  */
124 };
125 
126 const static char *const MoFEMErrorCodesNames[] = {
127  "MOFEM_SUCESS",
128  "MOFEM_DATA_INCONSISTENCY",
129  "MOFEM_NOT_IMPLEMENTED",
130  "MOFEM_NOT_FOUND",
131  "MOFEM_OPERATION_UNSUCCESSFUL",
132  "MOFEM_IMPOSIBLE_CASE",
133  "MOFEM_INVALID_DATA",
134  "MOFEM_MOFEMEXCEPTION_THROW",
135  "MOFEM_STD_EXCEPTION_THROW",
136  "MOFEM_ATOM_TEST_INVALID",
137  "MOFEM_MOAB_ERROR"};
138 
139 /// \brief approximation base
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
153 };
154 
155 const static char *const ApproximationBaseNames[] = {
156  "NOBASE",
157  "AINSWORTH_LEGENDRE_BASE",
158  "AINSWORTH_LOBATTO_BASE",
159  "AINSWORTH_BERNSTEIN_BEZIER_BASE",
160  "DEMKOWICZ_JACOBI_BASE",
161  "USER_BASE",
162  "LASTBASE"};
163 
164 #ifdef __cplusplus
165 const static FieldApproximationBase ApproximationBaseArray[] = {
166  NOBASE,
171  USER_BASE,
172  LASTBASE};
173 #endif // __cplusplus
174 
175 /// \brief approximation spaces
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 };
185 
186 const static char *const FieldSpaceNames[] = {
187  "NOSPACE", "NOFIELD", "H1", "HCURL", "HDIV", "L2", "LASTSPACE"};
188 
189 /// \brief Those types control how functions respond on arguments, f.e. error
190 /// handling
191 enum MoFEMTypes { MF_ZERO = 0, MF_EXCL = 1 << 0, MF_EXIST = 1 << 1 };
192 
193 /// \brief RowColData
195 
196 /**
197  * Controls adjency multi_index container (e.g. BYROW is adjacenciecy by field
198  * on on rows), see \ref MoFEM::FieldEntityEntFiniteElementAdjacencyMap
199  *
200  */
201 enum ByWhat {
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 };
210 
211 /**
212  * \brief Types of sets and boundary conditions
213  *
214  */
215 enum CubitBC {
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 };
239 
240 // OFF_DEPRECATED static const unsigned int UNKNOWNCUBITNAME = UNKNOWNNAME;
241 // OFF_DEPRECATED static const unsigned int LASTCUBITSET = LASTSET_BC;
242 
243 /**
244  * \brief Names of types of sets and boundary conditions
245  */
246 const static char *const CubitBCNames[] = {
247  "UNKNOWNSET", "NODESET", "SIDESET", "BLOCKSET",
248  "MATERIALSET", "DISPLACEMENTSET", "FORCESET", "PRESSURESET",
249  "VELOCITYSET", "ACCELERATIONSET", "TEMPERATURESET", "HEATFLUXSET",
250  "INTERFACESET", "UNKNOWNNAME", "MAT_ELASTICSET", "MAT_INTERFSET",
251  "MAT_THERMALSET", "BODYFORCESSET", "MAT_MOISTURESET", "DIRICHLET_BC",
252  "NEUMANN_BC", "LASTSET_BC"};
253 
254 /**
255  * \brief Format of rows in gradients of H1 base functions
256  */
257 enum H1DiffFormating { H1_0 = 0, H1_1, H1_2 };
258 
259 /**
260  * \brief Format in rows of Hdiv base functions
261  */
263 
264 /**
265  * \brief Format in rows of Hdiv gradients of base functions
266  */
268  HDIV0_0 = 0,
277 };
278 
279 /**
280  * \brief Format in rows of Hcurl base functions
281  */
283 
284 /**
285  * \brief Format in rows of Hcurl gradients of base functions
286  */
288  HCURL0_0 = 0,
297 };
298 
299 /**
300  * \brief Verbosity levels
301  */
304  QUIET = 0,
309 };
310 
311 #define BITREFEDGES_SIZE 6 ///< number of edges on tetrahedral
312 #define BITREFLEVEL_SIZE 128 ///< max number of refinements
313 #define BITFIELDID_SIZE 32 ///< max number of fields
314 #define BITFEID_SIZE 32 ///< max number of finite elements
315 #define BITPROBLEMID_SIZE 32 ///< max number of problems
316 #define BITINTERFACEUID_SIZE 32
317 
318 #define MYPCOMM_INDEX 0 ///< default communicator number PCOMM
319 
320 // This Is form MOAB
321 #define MB_TYPE_WIDTH 4
322 #define MB_ID_WIDTH (8 * sizeof(EntityHandle) - MB_TYPE_WIDTH)
323 #define MB_TYPE_MASK ((EntityHandle)0xF << MB_ID_WIDTH)
324 // 2^MB_TYPE_WIDTH-1 ------^
325 
326 #define MB_START_ID ((EntityID)1) ///< All entity id's currently start at 1
327 #define MB_END_ID \
328  ((EntityID)MB_ID_MASK) ///< Last id is the complement of the MASK
329 #define MB_ID_MASK (~MB_TYPE_MASK)
330 
331 #define MAX_DOFS_ON_ENTITY 512 ///< Maximal number of DOFs on entity
332 #define DOF_UID_MASK_ON_ENTITY \
333  (MAX_DOFS_ON_ENTITY - 1) ///< Mask for DOF number on entity form UId
334 
335 #define NOT_USED(x) ((void)(x))
336 
337 /** \brief set barrier start
338  * Run code in sequence, starting from process 0, and ends on last process.
339  *
340  * It can be only used for testing. Do not use that function as a part of these
341  * code.
342  *
343  */
344 #define BARRIER_PCOMM_RANK_START(PCMB) \
345  { \
346  for (unsigned int i = 0; i < PCMB->proc_config().proc_rank(); i++) \
347  MPI_Barrier(PCMB->proc_config().proc_comm()); \
348  };
349 
350 /** \deprecated Do use this macro, instead use BARRIER_PCOMM_RANK_START
351  */
352 #define BARRIER_RANK_START(PCMB) \
353  { \
354  macro_is_deprecated_using_deprecated_function(); \
355  for (unsigned int i = 0; i < PCMB->proc_config().proc_rank(); i++) \
356  MPI_Barrier(PCMB->proc_config().proc_comm()); \
357  };
358 
359 /** \brief set barrier start
360  * Run code in sequence, starting from process 0, and ends on last process.
361  *
362  * It can be only used for testing. Do not use that function as a part of these
363  * code.
364  *
365  */
366 #define BARRIER_PCOMM_RANK_END(PCMB) \
367  { \
368  for (unsigned int i = PCMB->proc_config().proc_rank(); \
369  i < PCMB->proc_config().proc_size(); i++) \
370  MPI_Barrier(PCMB->proc_config().proc_comm()); \
371  };
372 
373 /** \deprecated Do use this macro, instead use BARRIER_PCOMM_RANK_START
374  */
375 #define BARRIER_RANK_END(PCMB) \
376  { \
377  macro_is_deprecated_using_deprecated_function(); \
378  for (unsigned int i = PCMB->proc_config().proc_rank(); \
379  i < PCMB->proc_config().proc_size(); i++) \
380  MPI_Barrier(PCMB->proc_config().proc_comm()); \
381  };
382 
383 /** \brief set barrier start
384  * Run code in sequence, starting from process 0, and ends on last process.
385  *
386  * It can be only used for testing. Do not use that function as a part of these
387  * code.
388  *
389  */
390 #define BARRIER_MOFEM_RANK_START(MOFEM) \
391  { \
392  for (int i = 0; i < (MOFEM)->get_comm_rank(); i++) \
393  MPI_Barrier((MOFEM)->get_comm()); \
394  };
395 
396 /** \brief set barrier start
397  * Run code in sequence, starting from process 0, and ends on last process.
398  *
399  * It can be only used for testing. Do not use that function as a part of these
400  * code.
401  *
402  */
403 #define BARRIER_MOFEM_RANK_END(MOFEM) \
404  { \
405  for (int i = (MOFEM)->get_comm_rank(); i < (MOFEM)->get_comm_size(); i++) \
406  MPI_Barrier((MOFEM)->get_comm()); \
407  };
408 
409 #ifdef __cplusplus
410 extern "C" {
411 #endif
412 
413 /**
414  * \brief Is used to indicate that macro is deprecated
415  * Do nothing just triggers error at the compilation
416  */
418 
419 #ifdef __cplusplus
420 }
421 #endif
422 
423 /**
424  * \brief First executable line of each MoFEM function, used for error handling.
425  Final line of MoFEM functions should be MoFEMFunctionReturn(0);
426 
427  \node Not collective
428 
429  Example
430  \code
431  PetscErrorCode fun() {
432  int something;
433  MoFEMFunctionBegin;
434  MoFEMFunctionReturn(0);
435  }
436  \endcode
437 
438  */
439 #define MoFEMFunctionBegin \
440  PetscFunctionBegin; \
441  try {
442 
443 /**
444  * @brief \brief Catch errors
445  *
446  * Usage in main functions
447  * \code
448  * int main(int argc, char *argv[]) {
449  *
450  * MoFEM::Core::Initialize(&argc, &argv, (char *)0, help);
451  *
452  * try {
453  *
454  * // More code here
455  *
456  * }
457  * CATCH_ERRORS;
458  *
459  * return MoFEM::Core::Finalize();
460  *
461  * }
462  * \endcode
463  *
464  */
465 #define CATCH_ERRORS \
466  catch (MoFEMExceptionInitial const &ex) { \
467  return PetscError(PETSC_COMM_SELF, ex.lINE, PETSC_FUNCTION_NAME, __FILE__, \
468  ex.errorCode, PETSC_ERROR_INITIAL, ex.what()); \
469  } \
470  catch (MoFEMExceptionRepeat const &ex) { \
471  return PetscError(PETSC_COMM_SELF, ex.lINE, PETSC_FUNCTION_NAME, __FILE__, \
472  ex.errorCode, PETSC_ERROR_REPEAT, " "); \
473  } \
474  catch (MoFEMException const &ex) { \
475  SETERRQ(PETSC_COMM_SELF, ex.errorCode, ex.errorMessage); \
476  } \
477  catch (std::exception const &ex) { \
478  std::string message("Error: " + std::string(ex.what()) + " at " + \
479  boost::lexical_cast<std::string>(__LINE__) + " : " + \
480  std::string(__FILE__) + " in " + \
481  std::string(PETSC_FUNCTION_NAME)); \
482  SETERRQ(PETSC_COMM_SELF, MOFEM_STD_EXCEPTION_THROW, message.c_str()); \
483  }
484 
485 /**
486  * \brief Last executable line of each PETSc function used for error handling.
487  * Replaces return()
488  * @param a error code
489  *
490  * \note MoFEMFunctionReturn has to be used with MoFEMFunctionBegin and can be
491  * used only at the end of the function. If is need to return function in
492  * earlier use MoFEMFunctionReturnHot
493  *
494  */
495 #define MoFEMFunctionReturn(a) \
496  } \
497  CATCH_ERRORS \
498  PetscFunctionReturn(a)
499 
500 /**
501  * \brief First executable line of each MoFEM function, used for error
502  handling. Final line of MoFEM functions should be MoFEMFunctionReturn(0); Use
503  of this function allows for lighter profiling by default.
504 
505  \node Not collective
506 
507  Example:
508  \code
509  PetscErrorCode fun() {
510  int something;
511  MoFEMFunctionBeginHot;
512 
513  // some work here
514 
515  MoFEMFunctionReturnHot(0);
516  }
517  \endcode
518 */
519 #define MoFEMFunctionBeginHot PetscFunctionBeginHot
520 
521 /**
522  * \brief Last executable line of each PETSc function used for error handling.
523  * Replaces return()
524  * @param a error code
525  */
526 #define MoFEMFunctionReturnHot(a) PetscFunctionReturn(a)
527 
528 #define CHKERRQ_PETSC(n) CHKERRQ(n)
529 /**
530  * \brief check error code of MoAB function
531  * @param a MoABErrorCode
532  */
533 #define CHKERRQ_MOAB(a) \
534  if (PetscUnlikely(MB_SUCCESS != (a))) { \
535  std::string error_str = (unsigned)(a) <= (unsigned)MB_FAILURE \
536  ? moab::ErrorCodeStr[a] \
537  : "INVALID ERROR CODE"; \
538  std::string str("MOAB error (" + boost::lexical_cast<std::string>((a)) + \
539  ") " + error_str + " at line " + \
540  boost::lexical_cast<std::string>(__LINE__) + " : " + \
541  std::string(__FILE__)); \
542  SETERRQ(PETSC_COMM_SELF, MOFEM_MOAB_ERROR, str.c_str()); \
543  }
544 
545 /**
546  * \brief Check error code of MoFEM/MOAB/PETSc function
547  * @param a MoFEMErrorCode
548  *
549  * \code
550  * MoFEMErrorCode fun() {
551  * MoFEMFunctionBeginHot;
552  * rval = fun_moab(); CHKERRG(rval);
553  * ierr = fun_petsc(); CHKERRG(ierr);
554  * merr = fun_mofem(); CHKERRG(merr);
555  * MoFEMFunctionReturnHot(0);
556  * \endcode
557  *
558  * \note Function detect type of errocode using specialized template function
559  * getErrorType, i.e. condition is evaluated at compilation time.
560  *
561  */
562 #define CHKERRG(n) \
563  if ((boost::is_same<BOOST_TYPEOF((n)), \
564  MoFEMErrorCodeGeneric<PetscErrorCode>>::value)) { \
565  CHKERRQ_PETSC((n)); \
566  } else if (boost::is_same<BOOST_TYPEOF((n)), \
567  MoFEMErrorCodeGeneric<moab::ErrorCode>>::value) { \
568  CHKERRQ_MOAB((n)); \
569  }
570 
571 /**
572  * @brief Inline error check
573  *
574  * \code
575  *
576  * MoFEMErrorCode foo() {
577  * MoFEMFunctionBegin;
578  *
579  * // Call other functions
580  * CHKERR fun_moab();
581  * CHKERR fun_petsc();
582  * CHKERR fun_mofem();
583  *
584  * // Throw error
585  * SETERRQ(PETSC_COMM_WORLD, MOFEM_DATA_INCONSISTENCY, "Some error message");
586  *
587  * MoFEMFunctionReturn(0);
588  * }
589  *
590  * int main(int argc, char *argv[]) {
591  *
592  * // Initailise MoFEM and Petsc
593  * MoFEM::Core::Initialize(&argc, &argv, (char *)0, help);
594  *
595  * try {
596  *
597  * moab::Core mb_instance; // MoAB database
598  * moab::Interface &moab = mb_instance;
599  * MoFEM::Core core(moab); // MOFEM database
600  * MoFEM::CoreInterface &m_field = core;
601  *
602  * CHKERR foo(); // Call function
603  *
604  * }
605  * CATCH_ERRORS;
606  *
607  * return MoFEM::Core::Finalize();
608  *
609  * }
610  *
611  * \endcode
612  *
613  */
614 #define CHKERR ErrorCheckerCode<__LINE__>() <<
615 
616 /**
617  * \brief Check error code of MoAB function and throw MoFEM exception
618  * @param a MoABErrorCode
619  */
620 #define MOAB_THROW(a) \
621  { \
622  if (PetscUnlikely(MB_SUCCESS != (a))) { \
623  std::string error_str = (unsigned)(a) <= (unsigned)MB_FAILURE \
624  ? moab::ErrorCodeStr[a] \
625  : "INVALID ERROR CODE"; \
626  std::string str("MOAB error (" + boost::lexical_cast<std::string>((a)) + \
627  ") " + error_str + " at line " + \
628  boost::lexical_cast<std::string>(__LINE__) + " : " + \
629  std::string(__FILE__)); \
630  throw MoFEMException(MOFEM_MOAB_ERROR, str.c_str()); \
631  } \
632  }
633 
634 /**
635  * \brief Throw MoFEM exception
636  * @param a message
637  */
638 #define THROW_MESSAGE(a) \
639  { \
640  std::string str("MoFEM error " + boost::lexical_cast<std::string>((a)) + \
641  " at line " + boost::lexical_cast<std::string>(__LINE__) + \
642  " : " + std::string(__FILE__)); \
643  throw MoFEMException(MOFEM_MOFEMEXCEPTION_THROW, str.c_str()); \
644  }
645 
646 /**
647  * \brief Convert number to string
648  * @param x number
649  */
650 #define SSTR(x) toString(x)
651 
652 #define TENSOR1_VEC_PTR(VEC) &VEC[0], &VEC[1], &VEC[2]
653 
654 #define SYMMETRIC_TENSOR4_MAT_PTR(MAT) \
655  &MAT(0, 0), &MAT(0, 1), &MAT(0, 2), &MAT(0, 3), &MAT(0, 4), &MAT(0, 5), \
656  &MAT(1, 0), &MAT(1, 1), &MAT(1, 2), &MAT(1, 3), &MAT(1, 4), &MAT(1, 5), \
657  &MAT(2, 0), &MAT(2, 1), &MAT(2, 2), &MAT(2, 3), &MAT(2, 4), &MAT(2, 5), \
658  &MAT(3, 0), &MAT(3, 1), &MAT(3, 2), &MAT(3, 3), &MAT(3, 4), &MAT(3, 5), \
659  &MAT(4, 0), &MAT(4, 1), &MAT(4, 2), &MAT(4, 3), &MAT(4, 4), &MAT(4, 5), \
660  &MAT(5, 0), &MAT(5, 1), &MAT(5, 2), &MAT(5, 3), &MAT(5, 4), &MAT(5, 5)
661 
662 #define TENSOR4_MAT_PTR(MAT) &MAT(0, 0), MAT.size2()
663 
664 #define TENSOR2_MAT_PTR(MAT) \
665  &MAT(0, 0), &MAT(1, 0), &MAT(2, 0), &MAT(3, 0), &MAT(4, 0), &MAT(5, 0), \
666  &MAT(6, 0), &MAT(7, 0), &MAT(8, 0)
667 
668 #define SYMMETRIC_TENSOR2_MAT_PTR(MAT) \
669  &MAT(0, 0), &MAT(0, 1), &MAT(0, 2), &MAT(0, 3), &MAT(0, 4), &MAT(0, 5)
670 
671 #define SYMMETRIC_TENSOR2_VEC_PTR(VEC) \
672  &VEC[0], &VEC[1], &VEC[2], &VEC[3], &VEC[4], &VEC[5]
673 
674 #endif //__DEFINITONS_H__
field with continuous normal traction
Definition: definitions.h:181
user implemented approximation base
Definition: definitions.h:151
block name is "MAT_MOISTURE"
Definition: definitions.h:234
scalar or vector of scalars describe (no true field)
Definition: definitions.h:178
HCurlFormatting
Format in rows of Hcurl base functions.
Definition: definitions.h:282
static const char *const MoFEMErrorCodesNames[]
Definition: definitions.h:126
RowColData
RowColData.
Definition: definitions.h:194
DMInterfaces
interfaces for PETSc DM interfaces
Definition: definitions.h:80
FieldSpace in [ 0, LASTSPACE )
Definition: definitions.h:183
static const char *const ApproximationBaseNames[]
Definition: definitions.h:155
Interfaces
Interfaces IDs.
Definition: definitions.h:40
FieldApproximationBase
approximation base
Definition: definitions.h:140
VERBOSITY_LEVELS
Verbosity levels.
Definition: definitions.h:302
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:142
block name is "MAT_THERMAL"
Definition: definitions.h:232
ByWhat
Definition: definitions.h:201
block name is "BODY_FORCES"
Definition: definitions.h:233
static const char *const FieldSpaceNames[]
Definition: definitions.h:186
field with continuous tangents
Definition: definitions.h:180
BaseIntefaces
Interfaces uses to manage base functions.
Definition: definitions.h:88
CubitBC
Types of sets and boundary conditions.
Definition: definitions.h:215
FieldSpace
approximation spaces
Definition: definitions.h:176
block name is "MAT_ELASTIC"
Definition: definitions.h:230
#define DEPRECATED
Definition: definitions.h:29
LoopInterfaces
Definition: definitions.h:66
HCurlDiffFormatting
Format in rows of Hcurl gradients of base functions.
Definition: definitions.h:287
H1DiffFormating
Format of rows in gradients of H1 base functions.
Definition: definitions.h:257
HDivDiffFormatting
Format in rows of Hdiv gradients of base functions.
Definition: definitions.h:267
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: Core.cpp:20
continuous field
Definition: definitions.h:179
MoFEMErrorCodes
Error handling.
Definition: definitions.h:111
static const char *const CubitBCNames[]
Names of types of sets and boundary conditions.
Definition: definitions.h:246
MoFEMTypes
Those types control how functions respond on arguments, f.e. error handling.
Definition: definitions.h:191
field with C-1 continuity
Definition: definitions.h:182
HDivFormatting
Format in rows of Hdiv base functions.
Definition: definitions.h:262