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