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