KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
define.h
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Pooyan Dadvand
11 //
12 
13 #pragma once
14 
15 /* System includes */
16 #include <stdexcept>
17 #include <sstream>
18 
19 
20 /* External includes */
21 
22 /* Project includes */
25 #include "includes/exception.h"
26 
27 // Defining the OS
28 #if defined(__linux__) || defined(__linux) || defined(linux) || defined(__gnu_linux__)
29  #define KRATOS_COMPILED_IN_LINUX
30 #elif defined(__APPLE__) && defined(__MACH__)
31  #define KRATOS_COMPILED_IN_OS
32 #elif defined(_WIN32) || defined(_WIN64)
33  #define KRATOS_COMPILED_IN_WINDOWS
34 #endif
35 
36 // Defining the architecture (see https://sourceforge.net/p/predef/wiki/Architectures/)
37 // Check Windows
38 #if defined(_WIN32) || defined(_WIN64)
39  #if defined(_WIN64)
40  #define KRATOS_ENV64BIT
41  #else
42  #define KRATOS_ENV32BIT
43  #error 32 bit system are not supported anymore. Please consider a 64 bits system
44  #endif
45 #else // It is POSIX (Linux, MacOSX, BSD...)
46  #if defined(__x86_64__) || defined(__ppc64__) || defined(__aarch64__)
47  #define KRATOS_ENV64BIT
48  #else // This includes __arm__ and __x86__
49  #define KRATOS_ENV32BIT
50  #error 32 bit system are not supported anymore. Please consider a 64 bits system
51  #endif
52 #endif
53 
54 //-----------------------------------------------------------------
55 //
56 // Warnings
57 //
58 //-----------------------------------------------------------------
59 
60 #if defined(_MSC_VER)
61 # pragma warning(disable: 4244 4267)
62 #endif
63 
64 //-----------------------------------------------------------------
65 //
66 // Exceptions
67 //
68 //-----------------------------------------------------------------
69 
70 #define KRATOS_CATCH_AND_THROW(ExceptionType, MoreInfo, Block) \
71 catch(ExceptionType& e) \
72 { \
73 Block \
74 KRATOS_ERROR << e.what(); \
75 }
76 
77 #define KRATOS_THROW_ERROR(ExceptionType, ErrorMessage, MoreInfo) \
78 { \
79 KRATOS_ERROR << ErrorMessage << MoreInfo << std::endl; \
80 }
81 
82 #define KRATOS_CATCH_WITH_BLOCK(MoreInfo,Block) \
83 } \
84 KRATOS_CATCH_AND_THROW(std::overflow_error,MoreInfo,Block) \
85 KRATOS_CATCH_AND_THROW(std::underflow_error,MoreInfo,Block) \
86 KRATOS_CATCH_AND_THROW(std::range_error,MoreInfo,Block) \
87 KRATOS_CATCH_AND_THROW(std::out_of_range,MoreInfo,Block) \
88 KRATOS_CATCH_AND_THROW(std::length_error,MoreInfo,Block) \
89 KRATOS_CATCH_AND_THROW(std::invalid_argument,MoreInfo,Block) \
90 KRATOS_CATCH_AND_THROW(std::domain_error,MoreInfo,Block) \
91 KRATOS_CATCH_AND_THROW(std::logic_error,MoreInfo,Block) \
92 KRATOS_CATCH_AND_THROW(std::runtime_error,MoreInfo,Block) \
93 catch(Exception& e) { Block throw Exception(e) << KRATOS_CODE_LOCATION << MoreInfo << std::endl; } \
94 catch(std::exception& e) { Block KRATOS_THROW_ERROR(std::runtime_error, e.what(), MoreInfo) } \
95 catch(...) { Block KRATOS_THROW_ERROR(std::runtime_error, "Unknown error", MoreInfo) }
96 
97 #define KRATOS_CATCH_BLOCK_BEGIN class ExceptionBlock{public: void operator()(void){
98 #define KRATOS_CATCH_BLOCK_END }} exception_block; exception_block();
99 
100 #ifndef KRATOS_NO_TRY_CATCH
101  #define KRATOS_TRY_IMPL try {
102  #define KRATOS_CATCH_IMPL(MoreInfo) KRATOS_CATCH_WITH_BLOCK(MoreInfo,{})
103 #else
104  #define KRATOS_TRY_IMPL {};
105  #define KRATOS_CATCH_IMPL(MoreInfo) {};
106 #endif
107 
108 #ifndef __SUNPRO_CC
109  #define KRATOS_TRY KRATOS_TRY_IMPL
110  #define KRATOS_CATCH(MoreInfo) KRATOS_CATCH_IMPL(MoreInfo)
111 #else
112  #define KRATOS_TRY {};
113  #define KRATOS_CATCH(MoreInfo) {};
114 #endif
115 
116 //-----------------------------------------------------------------
117 //
118 // variables
119 //
120 //-----------------------------------------------------------------
121 
122 #define KRATOS_EXPORT_MACRO KRATOS_NO_EXPORT
123 
124 #ifdef KRATOS_DEFINE_VARIABLE_IMPLEMENTATION
125 #undef KRATOS_DEFINE_VARIABLE_IMPLEMENTATION
126 #endif
127 #define KRATOS_DEFINE_VARIABLE_IMPLEMENTATION(module, type, name) \
128  KRATOS_EXPORT_MACRO(module) extern Variable<type > name;
129 
130 #ifdef KRATOS_DEFINE_VARIABLE
131 #undef KRATOS_DEFINE_VARIABLE
132 #endif
133 #define KRATOS_DEFINE_VARIABLE(type, name) \
134  KRATOS_DEFINE_VARIABLE_IMPLEMENTATION(KRATOS_CORE, type, name)
135 
136 #ifdef KRATOS_DEFINE_APPLICATION_VARIABLE
137 #undef KRATOS_DEFINE_APPLICATION_VARIABLE
138 #endif
139 #define KRATOS_DEFINE_APPLICATION_VARIABLE(application, type, name) \
140  KRATOS_API(application) extern Variable<type > name;
141 
142 #ifdef KRATOS_DEFINE_3D_VARIABLE_WITH_COMPONENTS
143 #undef KRATOS_DEFINE_3D_VARIABLE_WITH_COMPONENTS
144 #endif
145 #define KRATOS_DEFINE_3D_VARIABLE_WITH_COMPONENTS_IMPLEMENTATION(module, name) \
146  KRATOS_EXPORT_MACRO(module) extern Kratos::Variable<Kratos::array_1d<double, 3> > name; \
147  KRATOS_EXPORT_MACRO(module) extern Kratos::Variable<double> name##_X;\
148  KRATOS_EXPORT_MACRO(module) extern Kratos::Variable<double> name##_Y;\
149  KRATOS_EXPORT_MACRO(module) extern Kratos::Variable<double> name##_Z;
150 
151 #ifdef KRATOS_DEFINE_3D_VARIABLE_WITH_COMPONENTS
152 #undef KRATOS_DEFINE_3D_VARIABLE_WITH_COMPONENTS
153 #endif
154 #define KRATOS_DEFINE_3D_VARIABLE_WITH_COMPONENTS(name) \
155  KRATOS_DEFINE_3D_VARIABLE_WITH_COMPONENTS_IMPLEMENTATION(KRATOS_CORE, name)
156 
157 #ifdef KRATOS_DEFINE_3D_APPLICATION_VARIABLE_WITH_COMPONENTS
158 #undef KRATOS_DEFINE_3D_APPLICATION_VARIABLE_WITH_COMPONENTS
159 #endif
160 #define KRATOS_DEFINE_3D_APPLICATION_VARIABLE_WITH_COMPONENTS(application, name) \
161  KRATOS_API(application) extern Kratos::Variable<Kratos::array_1d<double, 3> > name; \
162  KRATOS_API(application) extern Kratos::Variable<double> name##_X;\
163  KRATOS_API(application) extern Kratos::Variable<double> name##_Y;\
164  KRATOS_API(application) extern Kratos::Variable<double> name##_Z;
165 
166 #ifdef KRATOS_DEFINE_SYMMETRIC_2D_TENSOR_VARIABLE_WITH_COMPONENTS
167 #undef KRATOS_DEFINE_SYMMETRIC_2D_TENSOR_VARIABLE_WITH_COMPONENTS
168 #endif
169 #define KRATOS_DEFINE_SYMMETRIC_2D_TENSOR_VARIABLE_WITH_COMPONENTS_IMPLEMENTATION(module, name) \
170  KRATOS_EXPORT_MACRO(module) extern Kratos::Variable<Kratos::array_1d<double, 3> > name; \
171  KRATOS_EXPORT_MACRO(module) extern Kratos::Variable<double> name##_XX;\
172  KRATOS_EXPORT_MACRO(module) extern Kratos::Variable<double> name##_YY;\
173  KRATOS_EXPORT_MACRO(module) extern Kratos::Variable<double> name##_XY;
174 
175 #ifdef KRATOS_DEFINE_SYMMETRIC_2D_TENSOR_VARIABLE_WITH_COMPONENTS
176 #undef KRATOS_DEFINE_SYMMETRIC_2D_TENSOR_VARIABLE_WITH_COMPONENTS
177 #endif
178 #define KRATOS_DEFINE_SYMMETRIC_2D_TENSOR_VARIABLE_WITH_COMPONENTS(name) \
179  KRATOS_DEFINE_SYMMETRIC_2D_TENSOR_VARIABLE_WITH_COMPONENTS_IMPLEMENTATION(KRATOS_CORE, name)
180 
181 #ifdef KRATOS_DEFINE_SYMMETRIC_2D_TENSOR_APPLICATION_VARIABLE_WITH_COMPONENTS
182 #undef KRATOS_DEFINE_SYMMETRIC_2D_TENSOR_APPLICATION_VARIABLE_WITH_COMPONENTS
183 #endif
184 #define KRATOS_DEFINE_SYMMETRIC_2D_TENSOR_APPLICATION_VARIABLE_WITH_COMPONENTS(application, name) \
185  KRATOS_API(application) extern Kratos::Variable<Kratos::array_1d<double, 3> > name; \
186  KRATOS_API(application) extern Kratos::Variable<double> name##_XX;\
187  KRATOS_API(application) extern Kratos::Variable<double> name##_YY;\
188  KRATOS_API(application) extern Kratos::Variable<double> name##_XY;
189 
190 #ifdef KRATOS_DEFINE_SYMMETRIC_3D_TENSOR_VARIABLE_WITH_COMPONENTS
191 #undef KRATOS_DEFINE_SYMMETRIC_3D_TENSOR_VARIABLE_WITH_COMPONENTS
192 #endif
193 #define KRATOS_DEFINE_SYMMETRIC_3D_TENSOR_VARIABLE_WITH_COMPONENTS_IMPLEMENTATION(module, name) \
194  KRATOS_EXPORT_MACRO(module) extern Kratos::Variable<Kratos::array_1d<double, 6> > name; \
195  KRATOS_EXPORT_MACRO(module) extern Kratos::Variable<double> name##_XX;\
196  KRATOS_EXPORT_MACRO(module) extern Kratos::Variable<double> name##_YY;\
197  KRATOS_EXPORT_MACRO(module) extern Kratos::Variable<double> name##_ZZ;\
198  KRATOS_EXPORT_MACRO(module) extern Kratos::Variable<double> name##_XY;\
199  KRATOS_EXPORT_MACRO(module) extern Kratos::Variable<double> name##_YZ;\
200  KRATOS_EXPORT_MACRO(module) extern Kratos::Variable<double> name##_XZ;
201 
202 #ifdef KRATOS_DEFINE_SYMMETRIC_3D_TENSOR_VARIABLE_WITH_COMPONENTS
203 #undef KRATOS_DEFINE_SYMMETRIC_3D_TENSOR_VARIABLE_WITH_COMPONENTS
204 #endif
205 #define KRATOS_DEFINE_SYMMETRIC_3D_TENSOR_VARIABLE_WITH_COMPONENTS(name) \
206  KRATOS_DEFINE_SYMMETRIC_3D_TENSOR_VARIABLE_WITH_COMPONENTS_IMPLEMENTATION(KRATOS_CORE, name)
207 
208 #ifdef KRATOS_DEFINE_SYMMETRIC_3D_TENSOR_APPLICATION_VARIABLE_WITH_COMPONENTS
209 #undef KRATOS_DEFINE_SYMMETRIC_3D_TENSOR_APPLICATION_VARIABLE_WITH_COMPONENTS
210 #endif
211 #define KRATOS_DEFINE_SYMMETRIC_3D_TENSOR_APPLICATION_VARIABLE_WITH_COMPONENTS(application, name) \
212  KRATOS_API(application) extern Kratos::Variable<Kratos::array_1d<double, 6> > name; \
213  KRATOS_API(application) extern Kratos::Variable<double> name##_XX;\
214  KRATOS_API(application) extern Kratos::Variable<double> name##_YY;\
215  KRATOS_API(application) extern Kratos::Variable<double> name##_ZZ;\
216  KRATOS_API(application) extern Kratos::Variable<double> name##_XY;\
217  KRATOS_API(application) extern Kratos::Variable<double> name##_YZ;\
218  KRATOS_API(application) extern Kratos::Variable<double> name##_XZ;
219 
220 #ifdef KRATOS_DEFINE_2D_TENSOR_VARIABLE_WITH_COMPONENTS
221 #undef KRATOS_DEFINE_2D_TENSOR_VARIABLE_WITH_COMPONENTS
222 #endif
223 #define KRATOS_DEFINE_2D_TENSOR_VARIABLE_WITH_COMPONENTS_IMPLEMENTATION(module, name) \
224  KRATOS_EXPORT_MACRO(module) extern Kratos::Variable<Kratos::array_1d<double, 4> > name; \
225  KRATOS_EXPORT_MACRO(module) extern Kratos::Variable<double> name##_XX;\
226  KRATOS_EXPORT_MACRO(module) extern Kratos::Variable<double> name##_XY;\
227  KRATOS_EXPORT_MACRO(module) extern Kratos::Variable<double> name##_YX;\
228  KRATOS_EXPORT_MACRO(module) extern Kratos::Variable<double> name##_YY;
229 
230 #ifdef KRATOS_DEFINE_2D_TENSOR_VARIABLE_WITH_COMPONENTS
231 #undef KRATOS_DEFINE_2D_TENSOR_VARIABLE_WITH_COMPONENTS
232 #endif
233 #define KRATOS_DEFINE_2D_TENSOR_VARIABLE_WITH_COMPONENTS(name) \
234  KRATOS_DEFINE_2D_TENSOR_VARIABLE_WITH_COMPONENTS_IMPLEMENTATION(KRATOS_CORE, name)
235 
236 #ifdef KRATOS_DEFINE_2D_TENSOR_APPLICATION_VARIABLE_WITH_COMPONENTS
237 #undef KRATOS_DEFINE_2D_TENSOR_APPLICATION_VARIABLE_WITH_COMPONENTS
238 #endif
239 #define KRATOS_DEFINE_2D_TENSOR_APPLICATION_VARIABLE_WITH_COMPONENTS(application, name) \
240  KRATOS_API(application) extern Kratos::Variable<Kratos::array_1d<double, 4> > name; \
241  KRATOS_API(application) extern Kratos::Variable<double> name##_XX;\
242  KRATOS_API(application) extern Kratos::Variable<double> name##_XY;\
243  KRATOS_API(application) extern Kratos::Variable<double> name##_YX;\
244  KRATOS_API(application) extern Kratos::Variable<double> name##_YY;
245 
246 #ifdef KRATOS_DEFINE_3D_TENSOR_VARIABLE_WITH_COMPONENTS
247 #undef KRATOS_DEFINE_3D_TENSOR_VARIABLE_WITH_COMPONENTS
248 #endif
249 #define KRATOS_DEFINE_3D_TENSOR_VARIABLE_WITH_COMPONENTS_IMPLEMENTATION(module, name) \
250  KRATOS_EXPORT_MACRO(module) extern Kratos::Variable<Kratos::array_1d<double, 9> > name; \
251  KRATOS_EXPORT_MACRO(module) extern Kratos::Variable<double> name##_XX;\
252  KRATOS_EXPORT_MACRO(module) extern Kratos::Variable<double> name##_XY;\
253  KRATOS_EXPORT_MACRO(module) extern Kratos::Variable<double> name##_XZ;\
254  KRATOS_EXPORT_MACRO(module) extern Kratos::Variable<double> name##_YX;\
255  KRATOS_EXPORT_MACRO(module) extern Kratos::Variable<double> name##_YY;\
256  KRATOS_EXPORT_MACRO(module) extern Kratos::Variable<double> name##_YZ;\
257  KRATOS_EXPORT_MACRO(module) extern Kratos::Variable<double> name##_ZX;\
258  KRATOS_EXPORT_MACRO(module) extern Kratos::Variable<double> name##_ZY;\
259  KRATOS_EXPORT_MACRO(module) extern Kratos::Variable<double> name##_ZZ;
260 
261 #ifdef KRATOS_DEFINE_3D_TENSOR_VARIABLE_WITH_COMPONENTS
262 #undef KRATOS_DEFINE_3D_TENSOR_VARIABLE_WITH_COMPONENTS
263 #endif
264 #define KRATOS_DEFINE_3D_TENSOR_VARIABLE_WITH_COMPONENTS(name) \
265  KRATOS_DEFINE_3D_TENSOR_VARIABLE_WITH_COMPONENTS_IMPLEMENTATION(KRATOS_CORE, name)
266 
267 #ifdef KRATOS_DEFINE_3D_TENSOR_APPLICATION_VARIABLE_WITH_COMPONENTS
268 #undef KRATOS_DEFINE_3D_TENSOR_APPLICATION_VARIABLE_WITH_COMPONENTS
269 #endif
270 #define KRATOS_DEFINE_3D_TENSOR_APPLICATION_VARIABLE_WITH_COMPONENTS(application, name) \
271  KRATOS_API(application) extern Kratos::Variable<Kratos::array_1d<double, 9> > name; \
272  KRATOS_API(application) extern Kratos::Variable<double> name##_XX;\
273  KRATOS_API(application) extern Kratos::Variable<double> name##_XY;\
274  KRATOS_API(application) extern Kratos::Variable<double> name##_XZ;\
275  KRATOS_API(application) extern Kratos::Variable<double> name##_YX;\
276  KRATOS_API(application) extern Kratos::Variable<double> name##_YY;\
277  KRATOS_API(application) extern Kratos::Variable<double> name##_YZ;\
278  KRATOS_API(application) extern Kratos::Variable<double> name##_ZX;\
279  KRATOS_API(application) extern Kratos::Variable<double> name##_ZY;\
280  KRATOS_API(application) extern Kratos::Variable<double> name##_ZZ;
281 
282 #ifdef KRATOS_CREATE_VARIABLE
283 #undef KRATOS_CREATE_VARIABLE
284 #endif
285 #define KRATOS_CREATE_VARIABLE(type, name) \
286  /*const*/ Kratos::Variable<type > name(#name);
287 
288 #ifdef KRATOS_CREATE_VARIABLE_WITH_ZERO
289 #undef KRATOS_CREATE_VARIABLE_WITH_ZERO
290 #endif
291 #define KRATOS_CREATE_VARIABLE_WITH_ZERO(type, name, zero) \
292  /*const*/ Kratos::Variable<type> name(#name, zero);
293 
294 #ifdef KRATOS_CREATE_3D_VARIABLE_WITH_THIS_COMPONENTS
295 #undef KRATOS_CREATE_3D_VARIABLE_WITH_THIS_COMPONENTS
296 #endif
297 #define KRATOS_CREATE_3D_VARIABLE_WITH_THIS_COMPONENTS(name, component1, component2, component3) \
298  /*const*/ Kratos::Variable<Kratos::array_1d<double, 3> > name(#name, Kratos::array_1d<double, 3>(Kratos::ZeroVector(3))); \
299 \
300  /*const*/ Kratos::Variable<double> \
301  component1(#component1, &name, 0); \
302 \
303  /*const*/ Kratos::Variable<double> \
304  component2(#component2, &name, 1); \
305 \
306  /*const*/ Kratos::Variable<double> \
307  component3(#component3, &name, 2);
308 
309 #ifdef KRATOS_CREATE_3D_VARIABLE_WITH_COMPONENTS
310 #undef KRATOS_CREATE_3D_VARIABLE_WITH_COMPONENTS
311 #endif
312 #define KRATOS_CREATE_3D_VARIABLE_WITH_COMPONENTS(name) \
313  KRATOS_CREATE_3D_VARIABLE_WITH_THIS_COMPONENTS(name, name##_X, name##_Y, name##_Z)
314 
315 #ifdef KRATOS_CREATE_SYMMETRIC_2D_TENSOR_VARIABLE_WITH_THIS_COMPONENTS
316 #undef KRATOS_CREATE_SYMMETRIC_2D_TENSOR_VARIABLE_WITH_THIS_COMPONENTS
317 #endif
318 #define KRATOS_CREATE_SYMMETRIC_2D_TENSOR_VARIABLE_WITH_THIS_COMPONENTS(name, component1, component2, component3) \
319  /*const*/ Kratos::Variable<Kratos::array_1d<double, 3> > name(#name, Kratos::zero_vector<double>(3)); \
320 \
321  /*const*/ Kratos::Variable<double> \
322  component1(#component1, &name, 0); \
323 \
324  /*const*/ Kratos::Variable<double> \
325  component2(#component2, &name, 1); \
326 \
327  /*const*/ Kratos::Variable<double> \
328  component3(#component3, &name, 2);
329 
330 #ifdef KRATOS_CREATE_SYMMETRIC_2D_TENSOR_VARIABLE_WITH_COMPONENTS
331 #undef KRATOS_CREATE_SYMMETRIC_2D_TENSOR_VARIABLE_WITH_COMPONENTS
332 #endif
333 #define KRATOS_CREATE_SYMMETRIC_2D_TENSOR_VARIABLE_WITH_COMPONENTS(name) \
334  KRATOS_CREATE_SYMMETRIC_2D_TENSOR_VARIABLE_WITH_THIS_COMPONENTS(name, name##_XX, name##_YY, name##_XY)
335 
336 #ifdef KRATOS_CREATE_SYMMETRIC_3D_TENSOR_VARIABLE_WITH_THIS_COMPONENTS
337 #undef KRATOS_CREATE_SYMMETRIC_3D_TENSOR_VARIABLE_WITH_THIS_COMPONENTS
338 #endif
339 #define KRATOS_CREATE_SYMMETRIC_3D_TENSOR_VARIABLE_WITH_THIS_COMPONENTS(name, component1, component2, component3, component4, component5, component6) \
340  /*const*/ Kratos::Variable<Kratos::array_1d<double, 6> > name(#name, Kratos::zero_vector<double>(6)); \
341 \
342  /*const*/ Kratos::Variable<double> \
343  component1(#component1, &name, 0); \
344 \
345  /*const*/ Kratos::Variable<double> \
346  component2(#component2, &name, 1); \
347 \
348  /*const*/ Kratos::Variable<double> \
349  component3(#component3, &name, 2); \
350 \
351  /*const*/ Kratos::Variable<double> \
352  component4(#component4, &name, 3); \
353 \
354  /*const*/ Kratos::Variable<double> \
355  component5(#component5, &name, 4); \
356 \
357  /*const*/ Kratos::Variable<double> \
358  component6(#component6, &name, 5);
359 
360 #ifdef KRATOS_CREATE_SYMMETRIC_3D_TENSOR_VARIABLE_WITH_COMPONENTS
361 #undef KRATOS_CREATE_SYMMETRIC_3D_TENSOR_VARIABLE_WITH_COMPONENTS
362 #endif
363 #define KRATOS_CREATE_SYMMETRIC_3D_TENSOR_VARIABLE_WITH_COMPONENTS(name) \
364  KRATOS_CREATE_SYMMETRIC_3D_TENSOR_VARIABLE_WITH_THIS_COMPONENTS(name, name##_XX, name##_YY, name##_ZZ, name##_XY, name##_YZ, name##_XZ)
365 
366 #ifdef KRATOS_CREATE_2D_TENSOR_VARIABLE_WITH_THIS_COMPONENTS
367 #undef KRATOS_CREATE_2D_TENSOR_VARIABLE_WITH_THIS_COMPONENTS
368 #endif
369 #define KRATOS_CREATE_2D_TENSOR_VARIABLE_WITH_THIS_COMPONENTS(name, component1, component2, component3, component4) \
370  /*const*/ Kratos::Variable<Kratos::array_1d<double, 4> > name(#name, Kratos::zero_vector<double>(4)); \
371 \
372  /*const*/ Kratos::Variable<double> \
373  component1(#component1, &name, 0); \
374 \
375  /*const*/ Kratos::Variable<double> \
376  component2(#component2, &name, 1); \
377 \
378  /*const*/ Kratos::Variable<double> \
379  component3(#component3, &name, 2); \
380 \
381  /*const*/ Kratos::Variable<double> \
382  component4(#component4, &name, 3);
383 
384 #ifdef KRATOS_CREATE_2D_TENSOR_VARIABLE_WITH_COMPONENTS
385 #undef KRATOS_CREATE_2D_TENSOR_VARIABLE_WITH_COMPONENTS
386 #endif
387 #define KRATOS_CREATE_2D_TENSOR_VARIABLE_WITH_COMPONENTS(name) \
388  KRATOS_CREATE_2D_TENSOR_VARIABLE_WITH_THIS_COMPONENTS(name, name##_XX, name##_XY, name##_YX, name##_YY)
389 
390 #ifdef KRATOS_CREATE_3D_TENSOR_VARIABLE_WITH_THIS_COMPONENTS
391 #undef KRATOS_CREATE_3D_TENSOR_VARIABLE_WITH_THIS_COMPONENTS
392 #endif
393 #define KRATOS_CREATE_3D_TENSOR_VARIABLE_WITH_THIS_COMPONENTS(name, component1, component2, component3, component4, component5, component6, component7, component8, component9) \
394  /*const*/ Kratos::Variable<Kratos::array_1d<double, 9> > name(#name, Kratos::zero_vector<double>(9)); \
395 \
396  /*const*/ Kratos::Variable<double> \
397  component1(#component1, &name, 0); \
398 \
399  /*const*/ Kratos::Variable<double> \
400  component2(#component2, &name, 1); \
401 \
402  /*const*/ Kratos::Variable<double> \
403  component3(#component3, &name, 2); \
404 \
405  /*const*/ Kratos::Variable<double> \
406  component4(#component4, &name, 3); \
407 \
408  /*const*/ Kratos::Variable<double> \
409  component5(#component5, &name, 4); \
410 \
411  /*const*/ Kratos::Variable<double> \
412  component6(#component6, &name, 5); \
413 \
414  /*const*/ Kratos::Variable<double> \
415  component7(#component7, &name, 6); \
416 \
417  /*const*/ Kratos::Variable<double> \
418  component8(#component8, &name, 7); \
419 \
420  /*const*/ Kratos::Variable<double> \
421  component9(#component9, &name, 8);
422 
423 #ifdef KRATOS_CREATE_3D_TENSOR_VARIABLE_WITH_COMPONENTS
424 #undef KRATOS_CREATE_3D_TENSOR_VARIABLE_WITH_COMPONENTS
425 #endif
426 #define KRATOS_CREATE_3D_TENSOR_VARIABLE_WITH_COMPONENTS(name) \
427  KRATOS_CREATE_3D_TENSOR_VARIABLE_WITH_THIS_COMPONENTS(name, name##_XX, name##_XY, name##_XZ, name##_YX, name##_YY, name##_YZ, name##_ZX, name##_ZY, name##_ZZ)
428 
429 #ifdef KRATOS_REGISTER_VARIABLE
430 #undef KRATOS_REGISTER_VARIABLE
431 #endif
432 #define KRATOS_REGISTER_VARIABLE(name) \
433  AddKratosComponent(name.Name(), name); \
434  KratosComponents<VariableData>::Add(name.Name(), name);
435 
436 #ifdef KRATOS_REGISTER_3D_VARIABLE_WITH_COMPONENTS
437 #undef KRATOS_REGISTER_3D_VARIABLE_WITH_COMPONENTS
438 #endif
439 #define KRATOS_REGISTER_3D_VARIABLE_WITH_COMPONENTS(name) \
440  KRATOS_REGISTER_VARIABLE(name) \
441  KRATOS_REGISTER_VARIABLE(name##_X) \
442  KRATOS_REGISTER_VARIABLE(name##_Y) \
443  KRATOS_REGISTER_VARIABLE(name##_Z)
444 
445 #ifdef KRATOS_REGISTER_SYMMETRIC_2D_TENSOR_VARIABLE_WITH_COMPONENTS
446 #undef KRATOS_REGISTER_SYMMETRIC_2D_TENSOR_VARIABLE_WITH_COMPONENTS
447 #endif
448 #define KRATOS_REGISTER_SYMMETRIC_2D_TENSOR_VARIABLE_WITH_COMPONENTS(name) \
449  KRATOS_REGISTER_VARIABLE(name) \
450  KRATOS_REGISTER_VARIABLE(name##_XX) \
451  KRATOS_REGISTER_VARIABLE(name##_YY) \
452  KRATOS_REGISTER_VARIABLE(name##_XY)
453 
454 #ifdef KRATOS_REGISTER_SYMMETRIC_3D_TENSOR_VARIABLE_WITH_COMPONENTS
455 #undef KRATOS_REGISTER_SYMMETRIC_3D_TENSOR_VARIABLE_WITH_COMPONENTS
456 #endif
457 #define KRATOS_REGISTER_SYMMETRIC_3D_TENSOR_VARIABLE_WITH_COMPONENTS(name) \
458  KRATOS_REGISTER_VARIABLE(name) \
459  KRATOS_REGISTER_VARIABLE(name##_XX) \
460  KRATOS_REGISTER_VARIABLE(name##_YY) \
461  KRATOS_REGISTER_VARIABLE(name##_ZZ) \
462  KRATOS_REGISTER_VARIABLE(name##_XY) \
463  KRATOS_REGISTER_VARIABLE(name##_YZ) \
464  KRATOS_REGISTER_VARIABLE(name##_XZ)
465 
466 #ifdef KRATOS_REGISTER_2D_TENSOR_VARIABLE_WITH_COMPONENTS
467 #undef KRATOS_REGISTER_2D_TENSOR_VARIABLE_WITH_COMPONENTS
468 #endif
469 #define KRATOS_REGISTER_2D_TENSOR_VARIABLE_WITH_COMPONENTS(name) \
470  KRATOS_REGISTER_VARIABLE(name) \
471  KRATOS_REGISTER_VARIABLE(name##_XX) \
472  KRATOS_REGISTER_VARIABLE(name##_XY) \
473  KRATOS_REGISTER_VARIABLE(name##_YX) \
474  KRATOS_REGISTER_VARIABLE(name##_YY)
475 
476 #ifdef KRATOS_REGISTER_3D_TENSOR_VARIABLE_WITH_COMPONENTS
477 #undef KRATOS_REGISTER_3D_TENSOR_VARIABLE_WITH_COMPONENTS
478 #endif
479 #define KRATOS_REGISTER_3D_TENSOR_VARIABLE_WITH_COMPONENTS(name) \
480  KRATOS_REGISTER_VARIABLE(name) \
481  KRATOS_REGISTER_VARIABLE(name##_XX) \
482  KRATOS_REGISTER_VARIABLE(name##_XY) \
483  KRATOS_REGISTER_VARIABLE(name##_XZ) \
484  KRATOS_REGISTER_VARIABLE(name##_YX) \
485  KRATOS_REGISTER_VARIABLE(name##_YY) \
486  KRATOS_REGISTER_VARIABLE(name##_YZ) \
487  KRATOS_REGISTER_VARIABLE(name##_ZX) \
488  KRATOS_REGISTER_VARIABLE(name##_ZY) \
489  KRATOS_REGISTER_VARIABLE(name##_ZZ)
490 
491 //-----------------------------------------------------------------
492 //
493 // Variables time derivatives
494 //
495 //-----------------------------------------------------------------
496 
497 #ifdef KRATOS_CREATE_VARIABLE_WITH_TIME_DERIVATIVE
498 #undef KRATOS_CREATE_VARIABLE_WITH_TIME_DERIVATIVE
499 #endif
500 #define KRATOS_CREATE_VARIABLE_WITH_TIME_DERIVATIVE(type, name, variable_derivative) \
501  /*const*/ Kratos::Variable<type > name(#name, &variable_derivative);
502 
503 #ifdef KRATOS_CREATE_3D_VARIABLE_WITH_THIS_COMPONENTS_WITH_TIME_DERIVATIVE
504 #undef KRATOS_CREATE_3D_VARIABLE_WITH_THIS_COMPONENTS_WITH_TIME_DERIVATIVE
505 #endif
506 #define KRATOS_CREATE_3D_VARIABLE_WITH_THIS_COMPONENTS_WITH_TIME_DERIVATIVE(name, component1, component2, component3, variable_derivative) \
507  /*const*/ Kratos::Variable<Kratos::array_1d<double, 3> > name(#name, Kratos::array_1d<double, 3>(Kratos::ZeroVector(3)), &variable_derivative); \
508 \
509  /*const*/ Kratos::Variable<double> \
510  component1(#component1, &name, 0, &variable_derivative##_X); \
511 \
512  /*const*/ Kratos::Variable<double> \
513  component2(#component2, &name, 1, &variable_derivative##_Y); \
514 \
515  /*const*/ Kratos::Variable<double> \
516  component3(#component3, &name, 2, &variable_derivative##_Z);
517 
518 #ifdef KRATOS_CREATE_3D_VARIABLE_WITH_COMPONENTS_WITH_TIME_DERIVATIVE
519 #undef KRATOS_CREATE_3D_VARIABLE_WITH_COMPONENTS_WITH_TIME_DERIVATIVE
520 #endif
521 #define KRATOS_CREATE_3D_VARIABLE_WITH_COMPONENTS_WITH_TIME_DERIVATIVE(name, variable_derivative) \
522  KRATOS_CREATE_3D_VARIABLE_WITH_THIS_COMPONENTS_WITH_TIME_DERIVATIVE(name, name##_X, name##_Y, name##_Z, variable_derivative)
523 
524 #ifdef KRATOS_CREATE_SYMMETRIC_2D_TENSOR_VARIABLE_WITH_THIS_COMPONENTS_WITH_TIME_DERIVATIVE
525 #undef KRATOS_CREATE_SYMMETRIC_2D_TENSOR_VARIABLE_WITH_THIS_COMPONENTS_WITH_TIME_DERIVATIVE
526 #endif
527 #define KRATOS_CREATE_SYMMETRIC_2D_TENSOR_VARIABLE_WITH_THIS_COMPONENTS_WITH_TIME_DERIVATIVE(name, component1, component2, component3, variable_derivative) \
528  /*const*/ Kratos::Variable<Kratos::array_1d<double, 3> > name(#name, Kratos::zero_vector<double>(3), &variable_derivative); \
529 \
530  /*const*/ Kratos::Variable<double> \
531  component1(#component1, &name, 0, &variable_derivative##_XX); \
532 \
533  /*const*/ Kratos::Variable<double> \
534  component2(#component2, &name, 1, &variable_derivative##_YY); \
535 \
536  /*const*/ Kratos::Variable<double> \
537  component3(#component3, &name, 2, &variable_derivative##_XY);
538 
539 #ifdef KRATOS_CREATE_SYMMETRIC_2D_TENSOR_VARIABLE_WITH_COMPONENTS_WITH_TIME_DERIVATIVE
540 #undef KRATOS_CREATE_SYMMETRIC_2D_TENSOR_VARIABLE_WITH_COMPONENTS_WITH_TIME_DERIVATIVE
541 #endif
542 #define KRATOS_CREATE_SYMMETRIC_2D_TENSOR_VARIABLE_WITH_COMPONENTS_WITH_TIME_DERIVATIVE(name, variable_derivative) \
543  KRATOS_CREATE_SYMMETRIC_2D_TENSOR_VARIABLE_WITH_THIS_COMPONENTS_WITH_TIME_DERIVATIVE(name, name##_XX, name##_YY, name##_XY, variable_derivative)
544 
545 #ifdef KRATOS_CREATE_SYMMETRIC_3D_TENSOR_VARIABLE_WITH_THIS_COMPONENTS_WITH_TIME_DERIVATIVE
546 #undef KRATOS_CREATE_SYMMETRIC_3D_TENSOR_VARIABLE_WITH_THIS_COMPONENTS_WITH_TIME_DERIVATIVE
547 #endif
548 #define KRATOS_CREATE_SYMMETRIC_3D_TENSOR_VARIABLE_WITH_THIS_COMPONENTS_WITH_TIME_DERIVATIVE(name, component1, component2, component3, component4, component5, component6, variable_derivative) \
549  /*const*/ Kratos::Variable<Kratos::array_1d<double, 6> > name(#name, Kratos::zero_vector<double>(6), &variable_derivative); \
550 \
551  /*const*/ Kratos::Variable<double> \
552  component1(#component1, &name, 0, &variable_derivative##_XX); \
553 \
554  /*const*/ Kratos::Variable<double> \
555  component2(#component2, &name, 1, &variable_derivative##_YY); \
556 \
557  /*const*/ Kratos::Variable<double> \
558  component3(#component3, &name, 2, &variable_derivative##_ZZ); \
559 \
560  /*const*/ Kratos::Variable<double> \
561  component4(#component4, &name, 3, &variable_derivative##_XY); \
562 \
563  /*const*/ Kratos::Variable<double> \
564  component5(#component5, &name, 4, &variable_derivative##_YZ); \
565 \
566  /*const*/ Kratos::Variable<double> \
567  component6(#component6, &name, 5, &variable_derivative##_XZ);
568 
569 #ifdef KRATOS_CREATE_SYMMETRIC_3D_TENSOR_VARIABLE_WITH_COMPONENTS_WITH_TIME_DERIVATIVE
570 #undef KRATOS_CREATE_SYMMETRIC_3D_TENSOR_VARIABLE_WITH_COMPONENTS_WITH_TIME_DERIVATIVE
571 #endif
572 #define KRATOS_CREATE_SYMMETRIC_3D_TENSOR_VARIABLE_WITH_COMPONENTS_WITH_TIME_DERIVATIVE(name, variable_derivative) \
573  KRATOS_CREATE_SYMMETRIC_3D_TENSOR_VARIABLE_WITH_THIS_COMPONENTS_WITH_TIME_DERIVATIVE(name, name##_XX, name##_YY, name##_ZZ, name##_XY, name##_YZ, name##_XZ, variable_derivative)
574 
575 #ifdef KRATOS_CREATE_2D_TENSOR_VARIABLE_WITH_THIS_COMPONENTS_WITH_TIME_DERIVATIVE
576 #undef KRATOS_CREATE_2D_TENSOR_VARIABLE_WITH_THIS_COMPONENTS_WITH_TIME_DERIVATIVE
577 #endif
578 #define KRATOS_CREATE_2D_TENSOR_VARIABLE_WITH_THIS_COMPONENTS_WITH_TIME_DERIVATIVE(name, component1, component2, component3, component4, variable_derivative) \
579  /*const*/ Kratos::Variable<Kratos::array_1d<double, 4> > name(#name, Kratos::zero_vector<double>(4), &variable_derivative); \
580 \
581  /*const*/ Kratos::Variable<double> \
582  component1(#component1, &name, 0, &variable_derivative##_XX); \
583 \
584  /*const*/ Kratos::Variable<double> \
585  component2(#component2, &name, 1, &variable_derivative##_XY); \
586 \
587  /*const*/ Kratos::Variable<double> \
588  component3(#component3, &name, 2, &variable_derivative##_YX); \
589 \
590  /*const*/ Kratos::Variable<double> \
591  component4(#component4, &name, 3, &variable_derivative##_YY);
592 
593 #ifdef KRATOS_CREATE_2D_TENSOR_VARIABLE_WITH_COMPONENTS_WITH_TIME_DERIVATIVE
594 #undef KRATOS_CREATE_2D_TENSOR_VARIABLE_WITH_COMPONENTS_WITH_TIME_DERIVATIVE
595 #endif
596 #define KRATOS_CREATE_2D_TENSOR_VARIABLE_WITH_COMPONENTS_WITH_TIME_DERIVATIVE(name, variable_derivative) \
597  KRATOS_CREATE_2D_TENSOR_VARIABLE_WITH_THIS_COMPONENTS_WITH_TIME_DERIVATIVE(name, name##_XX, name##_XY, name##_YX, name##_YY, variable_derivative)
598 
599 #ifdef KRATOS_CREATE_3D_TENSOR_VARIABLE_WITH_THIS_COMPONENTS_WITH_TIME_DERIVATIVE
600 #undef KRATOS_CREATE_3D_TENSOR_VARIABLE_WITH_THIS_COMPONENTS_WITH_TIME_DERIVATIVE
601 #endif
602 #define KRATOS_CREATE_3D_TENSOR_VARIABLE_WITH_THIS_COMPONENTS_WITH_TIME_DERIVATIVE(name, component1, component2, component3, component4, component5, component6, component7, component8, component9, variable_derivative) \
603  /*const*/ Kratos::Variable<Kratos::array_1d<double, 9> > name(#name, Kratos::zero_vector<double>(9), &variable_derivative); \
604 \
605  /*const*/ Kratos::Variable<double> \
606  component1(#component1, &name, 0, &variable_derivative##_XX); \
607 \
608  /*const*/ Kratos::Variable<double> \
609  component2(#component2, &name, 1, &variable_derivative##_XY); \
610 \
611  /*const*/ Kratos::Variable<double> \
612  component3(#component3, &name, 2, &variable_derivative##_XZ); \
613 \
614  /*const*/ Kratos::Variable<double> \
615  component4(#component4, &name, 3, &variable_derivative##_YX); \
616 \
617  /*const*/ Kratos::Variable<double> \
618  component5(#component5, &name, 4, &variable_derivative##_YY); \
619 \
620  /*const*/ Kratos::Variable<double> \
621  component6(#component6, &name, 5, &variable_derivative##_YZ); \
622 \
623  /*const*/ Kratos::Variable<double> \
624  component7(#component7, &name, 6, &variable_derivative##_ZX); \
625 \
626  /*const*/ Kratos::Variable<double> \
627  component8(#component8, &name, 7, &variable_derivative##_ZY); \
628 \
629  /*const*/ Kratos::Variable<double> \
630  component9(#component9, &name, 8, &variable_derivative##_ZZ);
631 
632 #ifdef KRATOS_CREATE_3D_TENSOR_VARIABLE_WITH_COMPONENTS_WITH_TIME_DERIVATIVE
633 #undef KRATOS_CREATE_3D_TENSOR_VARIABLE_WITH_COMPONENTS_WITH_TIME_DERIVATIVE
634 #endif
635 #define KRATOS_CREATE_3D_TENSOR_VARIABLE_WITH_COMPONENTS_WITH_TIME_DERIVATIVE(name, variable_derivative) \
636  KRATOS_CREATE_3D_TENSOR_VARIABLE_WITH_THIS_COMPONENTS_WITH_TIME_DERIVATIVE(name, name##_XX, name##_XY, name##_XZ, name##_YX, name##_YY, name##_YZ, name##_ZX, name##_ZY, name##_ZZ, variable_derivative)
637 
638 //-----------------------------------------------------------------
639 //
640 // Flags
641 //
642 //-----------------------------------------------------------------
643 
644 #ifdef KRATOS_DEFINE_FLAG
645 #undef KRATOS_DEFINE_FLAG
646 #endif
647 #define KRATOS_DEFINE_FLAG(name) \
648  extern const Kratos::Flags name;
649 
650 #ifdef KRATOS_ADD_FLAG_TO_KRATOS_COMPONENTS
651 #undef KRATOS_ADD_FLAG_TO_KRATOS_COMPONENTS
652 #endif
653 #define KRATOS_ADD_FLAG_TO_KRATOS_COMPONENTS(name) \
654  Kratos::KratosComponents<Kratos::Flags>::Add(#name, name)
655 
656 #ifdef KRATOS_CREATE_FLAG
657 #undef KRATOS_CREATE_FLAG
658 #endif
659 #define KRATOS_CREATE_FLAG(name, position) \
660  const Kratos::Flags name(Kratos::Flags::Create(position));
661 
662 #ifdef KRATOS_REGISTER_FLAG
663 #undef KRATOS_REGISTER_FLAG
664 #endif
665 #define KRATOS_REGISTER_FLAG(name) \
666  KRATOS_ADD_FLAG_TO_KRATOS_COMPONENTS(name);
667 
668 
669 
670 #ifdef KRATOS_DEFINE_LOCAL_FLAG
671 #undef KRATOS_DEFINE_LOCAL_FLAG
672 #endif
673 #define KRATOS_DEFINE_LOCAL_FLAG(name) \
674  static const Kratos::Flags name;
675 
676 #ifdef KRATOS_DEFINE_LOCAL_APPLICATION_FLAG
677 #undef KRATOS_DEFINE_LOCAL_APPLICATION_FLAG
678 #endif
679 #define KRATOS_DEFINE_LOCAL_APPLICATION_FLAG(application, name) \
680  static KRATOS_API(application) const Kratos::Flags name;
681 
682 #ifdef KRATOS_CREATE_LOCAL_FLAG
683 #undef KRATOS_CREATE_LOCAL_FLAG
684 #endif
685 #define KRATOS_CREATE_LOCAL_FLAG(class_name, name, position) \
686  const Kratos::Flags class_name::name(Kratos::Flags::Create(position));
687 
688 
689 
690 //-----------------------------------------------------------------
691 //
692 // components
693 //
694 //-----------------------------------------------------------------
695 
696 #ifdef KRATOS_REGISTER_GEOMETRY
697 #undef KRATOS_REGISTER_GEOMETRY
698 #endif
699 #define KRATOS_REGISTER_GEOMETRY(name, reference) \
700  KratosComponents<Geometry<Node>>::Add(name, reference); \
701  Serializer::Register(name, reference);
702 
703 #ifdef KRATOS_REGISTER_ELEMENT
704 #undef KRATOS_REGISTER_ELEMENT
705 #endif
706 #define KRATOS_REGISTER_ELEMENT(name, reference) \
707  KratosComponents<Element >::Add(name, reference); \
708  Serializer::Register(name, reference);
709 
710 #ifdef KRATOS_REGISTER_CONDITION
711 #undef KRATOS_REGISTER_CONDITION
712 #endif
713 #define KRATOS_REGISTER_CONDITION(name, reference) \
714  KratosComponents<Condition >::Add(name, reference); \
715  Serializer::Register(name, reference);
716 
717 #ifdef KRATOS_REGISTER_CONSTRAINT
718 #undef KRATOS_REGISTER_CONSTRAINT
719 #endif
720 #define KRATOS_REGISTER_CONSTRAINT(name, reference) \
721  KratosComponents<MasterSlaveConstraint >::Add(name, reference); \
722  Serializer::Register(name, reference);
723 
724 #ifdef KRATOS_REGISTER_MODELER
725 #undef KRATOS_REGISTER_MODELER
726 #endif
727 #define KRATOS_REGISTER_MODELER(name, reference) \
728  KratosComponents<Modeler>::Add(name, reference); \
729  Serializer::Register(name, reference);
730 
731 #ifdef KRATOS_REGISTER_CONSTITUTIVE_LAW
732 #undef KRATOS_REGISTER_CONSTITUTIVE_LAW
733 #endif
734 #define KRATOS_REGISTER_CONSTITUTIVE_LAW(name, reference) \
735  KratosComponents<ConstitutiveLaw >::Add(name, reference); \
736  Serializer::Register(name, reference);
737 
738 #define KRATOS_DEPRECATED [[deprecated]]
739 #define KRATOS_DEPRECATED_MESSAGE(deprecated_message) [[deprecated(deprecated_message)]]
740 
741 // The following block defines the macro KRATOS_START_IGNORING_DEPRECATED_FUNCTION_WARNING
742 // If written in a file, for the following lines of code the compiler will not print warnings of type 'deprecated function'.
743 // The scope ends where KRATOS_STOP_IGNORING_DEPRECATED_FUNCTION_WARNING is called.
744 // NOTE!! this macro is not intended for extensive use, it's just for temporary use in methods exported to Python which
745 // are still calling a C++ deprecated function.
746 #if defined(__clang__)
747 #define KRATOS_PRAGMA_INSIDE_MACRO_DEFINITION(x) _Pragma(#x)
748 #define KRATOS_START_IGNORING_DEPRECATED_FUNCTION_WARNING \
749 KRATOS_PRAGMA_INSIDE_MACRO_DEFINITION(clang diagnostic push) \
750 KRATOS_PRAGMA_INSIDE_MACRO_DEFINITION(clang diagnostic ignored "-Wdeprecated-declarations")
751 #elif defined(__GNUG__) && !defined(__INTEL_COMPILER)
752 #define KRATOS_PRAGMA_INSIDE_MACRO_DEFINITION(x) _Pragma(#x)
753 #define KRATOS_START_IGNORING_DEPRECATED_FUNCTION_WARNING \
754 KRATOS_PRAGMA_INSIDE_MACRO_DEFINITION(GCC diagnostic push) \
755 KRATOS_PRAGMA_INSIDE_MACRO_DEFINITION(GCC diagnostic ignored "-Wdeprecated-declarations")
756 #elif defined(_MSC_VER)
757 #define KRATOS_START_IGNORING_DEPRECATED_FUNCTION_WARNING \
758 __pragma(warning(push))\
759 __pragma(warning(disable: 4996))
760 #else
761 #define KRATOS_START_IGNORING_DEPRECATED_FUNCTION_WARNING // not implemented for other compilers, hence does nothing
762 #endif
763 
764 // The following block defines the macro KRATOS_STOP_IGNORING_DEPRECATED_FUNCTION_WARNING which ends the scope for
765 // ignoring the warnings of type 'deprecated function'.
766 #if defined(__clang__)
767 #define KRATOS_STOP_IGNORING_DEPRECATED_FUNCTION_WARNING \
768 _Pragma("clang diagnostic pop")
769 #elif defined(__GNUG__) && !defined(__INTEL_COMPILER)
770 #define KRATOS_STOP_IGNORING_DEPRECATED_FUNCTION_WARNING \
771 _Pragma("GCC diagnostic pop")
772 #elif defined(_MSC_VER)
773 #define KRATOS_STOP_IGNORING_DEPRECATED_FUNCTION_WARNING \
774 __pragma(warning(pop))
775 #else
776 #define KRATOS_STOP_IGNORING_DEPRECATED_FUNCTION_WARNING // not implemented for other compilers, hence does nothing
777 #endif
778 
779 
780 namespace Kratos
781 {
784 
785 #if defined(_MSC_VER)
786 #pragma warning (disable: 4355)
787 #pragma warning (disable: 4503)
788 #pragma warning (disable: 4786)
789 #endif
790 
791 //Exception handling
792 #define KRATOS_TYPE_NAME_OF(name) name##Type
793 #define KRATOS_NOT_EXCLUDED(filename) !defined(KRATOS_##filename##_EXCLUDED)
794 
795 #define KRATOS_DECLEAR_TYPE namespace KratosComponents{ typedef
796 #define KRATOS_FOR_COMPONENT_NAMED(name) KRATOS_TYPE_NAME_OF(name);}
797 
798 // Kratos variable registering
799 /* #define KRATOS_REGISTER_VARIABLE_WITH_ZERO(type, name, zero) const Variable<type > name(#name, __LINE__, zero) */
800 /* #define KRATOS_REGISTER_VARIABLE(type, name) const Variable<type > name(#name, __LINE__) */
801 
802 /* #define KRATOS_REGISTER_LINEAR_SOLVER_BEGIN \ */
803 /* template<class TFunction> ApplyToLinearSolver(String Name){ */
804 
805 //Print Trace if defined
806 #define KRATOS_WATCH(variable) std::cout << #variable << " : " << variable << std::endl;
807 #define KRATOS_WATCH_CERR(variable) std::cerr << #variable << " : " << variable << std::endl;
808 #define KRATOS_WATCH_MPI(variable, mpi_data_comm) std::cout << "RANK " << mpi_data_comm.Rank() << "/" << mpi_data_comm.Size() << " "; KRATOS_WATCH(variable);
809 
810 } /* namespace Kratos.*/
811 
812 #define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType) \
813  Serializer.save_base("BaseClass",*static_cast<const BaseType *>(this));
814 
815 #define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType) \
816  Serializer.load_base("BaseClass",*static_cast<BaseType *>(this));
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21