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