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