v0.8.16
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_SUCCESS",
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 /// \brief approximation spaces
166  NOSPACE = 0,
167  NOFIELD = 1, ///< scalar or vector of scalars describe (no true field)
168  H1, ///< continuous field
169  HCURL, ///< field with continuous tangents
170  HDIV, ///< field with continuous normal traction
171  L2, ///< field with C-1 continuity
172  LASTSPACE ///< FieldSpace in [ 0, LASTSPACE )
173 };
174 
175 const static char *const FieldSpaceNames[] = {
176  "NOSPACE", "NOFIELD", "H1", "HCURL", "HDIV", "L2", "LASTSPACE"};
177 
178 /// \brief Those types control how functions respond on arguments, f.e. error
179 /// handling
180 enum MoFEMTypes { MF_ZERO = 0, MF_EXCL = 1 << 0, MF_EXIST = 1 << 1 };
181 
182 /// \brief RowColData
184 
185 /**
186  * Controls adjency multi_index container (e.g. BYROW is adjacenciecy by field
187  * on on rows), see \ref MoFEM::FieldEntityEntFiniteElementAdjacencyMap
188  *
189  */
190 enum ByWhat {
191  BYROW = 1 << 0,
192  BYCOL = 1 << 1,
193  BYDATA = 1 << 2,
194  BYROWDATA = 1 << 0 | 1 << 2,
195  BYCOLDATA = 1 << 1 | 1 << 2,
196  BYROWCOL = 1 << 0 | 1 << 1,
197  BYALL = 1 << 0 | 1 << 1 | 1 << 2
198 };
199 
200 /**
201  * \brief Types of sets and boundary conditions
202  *
203  */
204 enum CubitBC {
206  NODESET = 1 << 0,
207  SIDESET = 1 << 1,
208  BLOCKSET = 1 << 2,
209  MATERIALSET = 1 << 3,
210  DISPLACEMENTSET = 1 << 4,
211  FORCESET = 1 << 5,
212  PRESSURESET = 1 << 6,
213  VELOCITYSET = 1 << 7,
214  ACCELERATIONSET = 1 << 8,
215  TEMPERATURESET = 1 << 9,
216  HEATFLUXSET = 1 << 10,
217  INTERFACESET = 1 << 11,
218  UNKNOWNNAME = 1 << 12,
219  MAT_ELASTICSET = 1 << 13, ///< block name is "MAT_ELASTIC"
220  MAT_INTERFSET = 1 << 14,
221  MAT_THERMALSET = 1 << 15, ///< block name is "MAT_THERMAL"
222  BODYFORCESSET = 1 << 16, ///< block name is "BODY_FORCES"
223  MAT_MOISTURESET = 1 << 17, ///< block name is "MAT_MOISTURE"
224  DIRICHLET_BC = 1 << 18,
225  NEUMANN_BC = 1 << 19,
226  LASTSET_BC = 1 << 20
227 };
228 
229 // OFF_DEPRECATED static const unsigned int UNKNOWNCUBITNAME = UNKNOWNNAME;
230 // OFF_DEPRECATED static const unsigned int LASTCUBITSET = LASTSET_BC;
231 
232 /**
233  * \brief Names of types of sets and boundary conditions
234  */
235 const static char *const CubitBCNames[] = {
236  "UNKNOWNSET", "NODESET", "SIDESET", "BLOCKSET",
237  "MATERIALSET", "DISPLACEMENTSET", "FORCESET", "PRESSURESET",
238  "VELOCITYSET", "ACCELERATIONSET", "TEMPERATURESET", "HEATFLUXSET",
239  "INTERFACESET", "UNKNOWNNAME", "MAT_ELASTICSET", "MAT_INTERFSET",
240  "MAT_THERMALSET", "BODYFORCESSET", "MAT_MOISTURESET", "DIRICHLET_BC",
241  "NEUMANN_BC", "LASTSET_BC"};
242 
243 /**
244  * \brief Format in rows of vectorial base functions
245  */
247 
248 /**
249  * \brief Format in rows of vectorial base gradients of base functions
250  */
252  HVEC0_0 = 0,
261 };
262 
263 /**
264  * \brief Verbosity levels
265  */
268  QUIET = 0,
273 };
274 
275 #define BITREFEDGES_SIZE 6 ///< number of edges on tetrahedral
276 #define BITREFLEVEL_SIZE 128 ///< max number of refinements
277 #define BITFIELDID_SIZE 32 ///< max number of fields
278 #define BITFEID_SIZE 32 ///< max number of finite elements
279 #define BITPROBLEMID_SIZE 32 ///< max number of problems
280 #define BITINTERFACEUID_SIZE 32
281 
282 #define MYPCOMM_INDEX 0 ///< default communicator number PCOMM
283 
284 // This Is form MOAB
285 #define MB_TYPE_WIDTH 4
286 #define MB_ID_WIDTH (8 * sizeof(EntityHandle) - MB_TYPE_WIDTH)
287 #define MB_TYPE_MASK ((EntityHandle)0xF << MB_ID_WIDTH)
288 // 2^MB_TYPE_WIDTH-1 ------^
289 
290 #define MB_START_ID ((EntityID)1) ///< All entity id's currently start at 1
291 #define MB_END_ID \
292  ((EntityID)MB_ID_MASK) ///< Last id is the complement of the MASK
293 #define MB_ID_MASK (~MB_TYPE_MASK)
294 
295 #define MAX_DOFS_ON_ENTITY 512 ///< Maximal number of DOFs on entity
296 #define DOF_UID_MASK_ON_ENTITY \
297  (MAX_DOFS_ON_ENTITY - 1) ///< Mask for DOF number on entity form UId
298 
299 #define NOT_USED(x) ((void)(x))
300 
301 /** \brief set barrier start
302  * Run code in sequence, starting from process 0, and ends on last process.
303  *
304  * It can be only used for testing. Do not use that function as a part of these
305  * code.
306  *
307  */
308 #define BARRIER_PCOMM_RANK_START(PCMB) \
309  { \
310  for (unsigned int i = 0; i < PCMB->proc_config().proc_rank(); i++) \
311  MPI_Barrier(PCMB->proc_config().proc_comm()); \
312  };
313 
314 /** \deprecated Do use this macro, instead use BARRIER_PCOMM_RANK_START
315  */
316 #define BARRIER_RANK_START(PCMB) \
317  { \
318  macro_is_deprecated_using_deprecated_function(); \
319  for (unsigned int i = 0; i < PCMB->proc_config().proc_rank(); i++) \
320  MPI_Barrier(PCMB->proc_config().proc_comm()); \
321  };
322 
323 /** \brief set barrier start
324  * Run code in sequence, starting from process 0, and ends on last process.
325  *
326  * It can be only used for testing. Do not use that function as a part of these
327  * code.
328  *
329  */
330 #define BARRIER_PCOMM_RANK_END(PCMB) \
331  { \
332  for (unsigned int i = PCMB->proc_config().proc_rank(); \
333  i < PCMB->proc_config().proc_size(); i++) \
334  MPI_Barrier(PCMB->proc_config().proc_comm()); \
335  };
336 
337 /** \deprecated Do use this macro, instead use BARRIER_PCOMM_RANK_START
338  */
339 #define BARRIER_RANK_END(PCMB) \
340  { \
341  macro_is_deprecated_using_deprecated_function(); \
342  for (unsigned int i = PCMB->proc_config().proc_rank(); \
343  i < PCMB->proc_config().proc_size(); i++) \
344  MPI_Barrier(PCMB->proc_config().proc_comm()); \
345  };
346 
347 /** \brief set barrier start
348  * Run code in sequence, starting from process 0, and ends on last process.
349  *
350  * It can be only used for testing. Do not use that function as a part of these
351  * code.
352  *
353  */
354 #define BARRIER_MOFEM_RANK_START(MOFEM) \
355  { \
356  for (int i = 0; i < (MOFEM)->get_comm_rank(); i++) \
357  MPI_Barrier((MOFEM)->get_comm()); \
358  };
359 
360 /** \brief set barrier start
361  * Run code in sequence, starting from process 0, and ends on last process.
362  *
363  * It can be only used for testing. Do not use that function as a part of these
364  * code.
365  *
366  */
367 #define BARRIER_MOFEM_RANK_END(MOFEM) \
368  { \
369  for (int i = (MOFEM)->get_comm_rank(); i < (MOFEM)->get_comm_size(); i++) \
370  MPI_Barrier((MOFEM)->get_comm()); \
371  };
372 
373 #ifdef __cplusplus
374 extern "C" {
375 #endif
376 
377 /**
378  * \brief Is used to indicate that macro is deprecated
379  * Do nothing just triggers error at the compilation
380  */
382 
383 #ifdef __cplusplus
384 }
385 #endif
386 
387 /**
388  * \brief First executable line of each MoFEM function, used for error handling.
389  Final line of MoFEM functions should be MoFEMFunctionReturn(0);
390 
391  \node Not collective
392 
393  Example
394  \code
395  PetscErrorCode fun() {
396  int something;
397  MoFEMFunctionBegin;
398  MoFEMFunctionReturn(0);
399  }
400  \endcode
401 
402  */
403 #define MoFEMFunctionBegin \
404  PetscFunctionBegin; \
405  try {
406 
407 /**
408  * @brief \brief Catch errors
409  *
410  * Usage in main functions
411  * \code
412  * int main(int argc, char *argv[]) {
413  *
414  * MoFEM::Core::Initialize(&argc, &argv, (char *)0, help);
415  *
416  * try {
417  *
418  * // More code here
419  *
420  * }
421  * CATCH_ERRORS;
422  *
423  * return MoFEM::Core::Finalize();
424  *
425  * }
426  * \endcode
427  *
428  */
429 #define CATCH_ERRORS \
430  catch (MoFEMExceptionInitial const &ex) { \
431  return PetscError(PETSC_COMM_SELF, ex.lINE, PETSC_FUNCTION_NAME, __FILE__, \
432  ex.errorCode, PETSC_ERROR_INITIAL, ex.what()); \
433  } \
434  catch (MoFEMExceptionRepeat const &ex) { \
435  return PetscError(PETSC_COMM_SELF, ex.lINE, PETSC_FUNCTION_NAME, __FILE__, \
436  ex.errorCode, PETSC_ERROR_REPEAT, " "); \
437  } \
438  catch (MoFEMException const &ex) { \
439  SETERRQ(PETSC_COMM_SELF, ex.errorCode, ex.errorMessage); \
440  } \
441  catch (std::exception const &ex) { \
442  std::string message("Error: " + std::string(ex.what()) + " at " + \
443  boost::lexical_cast<std::string>(__LINE__) + " : " + \
444  std::string(__FILE__) + " in " + \
445  std::string(PETSC_FUNCTION_NAME)); \
446  SETERRQ(PETSC_COMM_SELF, MOFEM_STD_EXCEPTION_THROW, message.c_str()); \
447  }
448 
449 /**
450  * \brief Last executable line of each PETSc function used for error handling.
451  * Replaces return()
452  * @param a error code
453  *
454  * \note MoFEMFunctionReturn has to be used with MoFEMFunctionBegin and can be
455  * used only at the end of the function. If is need to return function in
456  * earlier use MoFEMFunctionReturnHot
457  *
458  */
459 #define MoFEMFunctionReturn(a) \
460  } \
461  CATCH_ERRORS \
462  PetscFunctionReturn(a)
463 
464 /**
465  * \brief First executable line of each MoFEM function, used for error
466  handling. Final line of MoFEM functions should be MoFEMFunctionReturn(0); Use
467  of this function allows for lighter profiling by default.
468 
469  \node Not collective
470 
471  Example:
472  \code
473  PetscErrorCode fun() {
474  int something;
475  MoFEMFunctionBeginHot;
476 
477  // some work here
478 
479  MoFEMFunctionReturnHot(0);
480  }
481  \endcode
482 */
483 #define MoFEMFunctionBeginHot PetscFunctionBeginHot
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 #define MoFEMFunctionReturnHot(a) PetscFunctionReturn(a)
491 
492 #define CHKERRQ_PETSC(n) CHKERRQ(n)
493 /**
494  * \brief check error code of MoAB function
495  * @param a MoABErrorCode
496  */
497 #define CHKERRQ_MOAB(a) \
498  if (PetscUnlikely(MB_SUCCESS != (a))) { \
499  std::string error_str = (unsigned)(a) <= (unsigned)MB_FAILURE \
500  ? moab::ErrorCodeStr[a] \
501  : "INVALID ERROR CODE"; \
502  std::string str("MOAB error (" + boost::lexical_cast<std::string>((a)) + \
503  ") " + error_str + " at line " + \
504  boost::lexical_cast<std::string>(__LINE__) + " : " + \
505  std::string(__FILE__)); \
506  SETERRQ(PETSC_COMM_SELF, MOFEM_MOAB_ERROR, str.c_str()); \
507  }
508 
509 /**
510  * \brief Check error code of MoFEM/MOAB/PETSc function
511  * @param a MoFEMErrorCode
512  *
513  * \code
514  * MoFEMErrorCode fun() {
515  * MoFEMFunctionBeginHot;
516  * rval = fun_moab(); CHKERRG(rval);
517  * ierr = fun_petsc(); CHKERRG(ierr);
518  * merr = fun_mofem(); CHKERRG(merr);
519  * MoFEMFunctionReturnHot(0);
520  * \endcode
521  *
522  * \note Function detect type of errocode using specialized template function
523  * getErrorType, i.e. condition is evaluated at compilation time.
524  *
525  */
526 #define CHKERRG(n) \
527  if ((boost::is_same<BOOST_TYPEOF((n)), \
528  MoFEMErrorCodeGeneric<PetscErrorCode>>::value)) { \
529  CHKERRQ_PETSC((n)); \
530  } else if (boost::is_same<BOOST_TYPEOF((n)), \
531  MoFEMErrorCodeGeneric<moab::ErrorCode>>::value) { \
532  CHKERRQ_MOAB((n)); \
533  }
534 
535 /**
536  * @brief Inline error check
537  *
538  * \code
539  *
540  * MoFEMErrorCode foo() {
541  * MoFEMFunctionBegin;
542  *
543  * // Call other functions
544  * CHKERR fun_moab();
545  * CHKERR fun_petsc();
546  * CHKERR fun_mofem();
547  *
548  * // Throw error
549  * SETERRQ(PETSC_COMM_WORLD, MOFEM_DATA_INCONSISTENCY, "Some error message");
550  *
551  * MoFEMFunctionReturn(0);
552  * }
553  *
554  * int main(int argc, char *argv[]) {
555  *
556  * // Initailise MoFEM and Petsc
557  * MoFEM::Core::Initialize(&argc, &argv, (char *)0, help);
558  *
559  * try {
560  *
561  * moab::Core mb_instance; // MoAB database
562  * moab::Interface &moab = mb_instance;
563  * MoFEM::Core core(moab); // MOFEM database
564  * MoFEM::CoreInterface &m_field = core;
565  *
566  * CHKERR foo(); // Call function
567  *
568  * }
569  * CATCH_ERRORS;
570  *
571  * return MoFEM::Core::Finalize();
572  *
573  * }
574  *
575  * \endcode
576  *
577  */
578 #define CHKERR ErrorCheckerCode<__LINE__>() <<
579 
580 /**
581  * \brief Check error code of MoAB function and throw MoFEM exception
582  * @param a MoABErrorCode
583  */
584 #define MOAB_THROW(a) \
585  { \
586  if (PetscUnlikely(MB_SUCCESS != (a))) { \
587  std::string error_str = (unsigned)(a) <= (unsigned)MB_FAILURE \
588  ? moab::ErrorCodeStr[a] \
589  : "INVALID ERROR CODE"; \
590  std::string str("MOAB error (" + boost::lexical_cast<std::string>((a)) + \
591  ") " + error_str + " at line " + \
592  boost::lexical_cast<std::string>(__LINE__) + " : " + \
593  std::string(__FILE__)); \
594  throw MoFEMException(MOFEM_MOAB_ERROR, str.c_str()); \
595  } \
596  }
597 
598 /**
599  * \brief Throw MoFEM exception
600  * @param a message
601  */
602 #define THROW_MESSAGE(a) \
603  { \
604  std::string str("MoFEM error " + boost::lexical_cast<std::string>((a)) + \
605  " at line " + boost::lexical_cast<std::string>(__LINE__) + \
606  " : " + std::string(__FILE__)); \
607  throw MoFEMException(MOFEM_MOFEMEXCEPTION_THROW, str.c_str()); \
608  }
609 
610 /**
611  * \brief Convert number to string
612  * @param x number
613  */
614 #define SSTR(x) toString(x)
615 
616 #define TENSOR1_VEC_PTR(VEC) &VEC[0], &VEC[1], &VEC[2]
617 
618 #define SYMMETRIC_TENSOR4_MAT_PTR(MAT) \
619  &MAT(0, 0), &MAT(0, 1), &MAT(0, 2), &MAT(0, 3), &MAT(0, 4), &MAT(0, 5), \
620  &MAT(1, 0), &MAT(1, 1), &MAT(1, 2), &MAT(1, 3), &MAT(1, 4), &MAT(1, 5), \
621  &MAT(2, 0), &MAT(2, 1), &MAT(2, 2), &MAT(2, 3), &MAT(2, 4), &MAT(2, 5), \
622  &MAT(3, 0), &MAT(3, 1), &MAT(3, 2), &MAT(3, 3), &MAT(3, 4), &MAT(3, 5), \
623  &MAT(4, 0), &MAT(4, 1), &MAT(4, 2), &MAT(4, 3), &MAT(4, 4), &MAT(4, 5), \
624  &MAT(5, 0), &MAT(5, 1), &MAT(5, 2), &MAT(5, 3), &MAT(5, 4), &MAT(5, 5)
625 
626 #define TENSOR4_MAT_PTR(MAT) &MAT(0, 0), MAT.size2()
627 
628 #define TENSOR2_MAT_PTR(MAT) \
629  &MAT(0, 0), &MAT(1, 0), &MAT(2, 0), &MAT(3, 0), &MAT(4, 0), &MAT(5, 0), \
630  &MAT(6, 0), &MAT(7, 0), &MAT(8, 0)
631 
632 #define SYMMETRIC_TENSOR2_MAT_PTR(MAT) \
633  &MAT(0, 0), &MAT(0, 1), &MAT(0, 2), &MAT(0, 3), &MAT(0, 4), &MAT(0, 5)
634 
635 #define SYMMETRIC_TENSOR2_VEC_PTR(VEC) \
636  &VEC[0], &VEC[1], &VEC[2], &VEC[3], &VEC[4], &VEC[5]
637 
638 #endif //__DEFINITONS_H__
field with continuous normal traction
Definition: definitions.h:170
user implemented approximation base
Definition: definitions.h:151
block name is "MAT_MOISTURE"
Definition: definitions.h:223
HVecFormatting
Format in rows of vectorial base functions.
Definition: definitions.h:246
scalar or vector of scalars describe (no true field)
Definition: definitions.h:167
static const char *const MoFEMErrorCodesNames[]
Definition: definitions.h:126
RowColData
RowColData.
Definition: definitions.h:183
DMInterfaces
interfaces for PETSc DM interfaces
Definition: definitions.h:80
FieldSpace in [ 0, LASTSPACE )
Definition: definitions.h:172
static const char *const ApproximationBaseNames[]
Definition: definitions.h:155
Interfaces
Interfaces IDs.
Definition: definitions.h:40
HVecDiffFormatting
Format in rows of vectorial base gradients of base functions.
Definition: definitions.h:251
FieldApproximationBase
approximation base
Definition: definitions.h:140
VERBOSITY_LEVELS
Verbosity levels.
Definition: definitions.h:266
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:142
block name is "MAT_THERMAL"
Definition: definitions.h:221
ByWhat
Definition: definitions.h:190
block name is "BODY_FORCES"
Definition: definitions.h:222
static const char *const FieldSpaceNames[]
Definition: definitions.h:175
field with continuous tangents
Definition: definitions.h:169
BaseIntefaces
Interfaces uses to manage base functions.
Definition: definitions.h:88
CubitBC
Types of sets and boundary conditions.
Definition: definitions.h:204
FieldSpace
approximation spaces
Definition: definitions.h:165
block name is "MAT_ELASTIC"
Definition: definitions.h:219
#define DEPRECATED
Definition: definitions.h:29
LoopInterfaces
Definition: definitions.h:66
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:168
MoFEMErrorCodes
Error handling.
Definition: definitions.h:111
static const char *const CubitBCNames[]
Names of types of sets and boundary conditions.
Definition: definitions.h:235
MoFEMTypes
Those types control how functions respond on arguments, f.e. error handling.
Definition: definitions.h:180
field with C-1 continuity
Definition: definitions.h:171