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.
process_info_extensions.hpp
Go to the documentation of this file.
1 //
2 // Project Name: KratosSolidMechanicsApplication $
3 // Created by: $Author: JMCarbonell $
4 // Last modified by: $Co-Author: $
5 // Date: $Date: December 2017 $
6 // Revision: $Revision: 0.0 $
7 //
8 //
9 
10 #if !defined(PROCESS_INFO_EXTENSIONS_H_INCLUDED)
11 #define PROCESS_INFO_EXTENSIONS_H_INCLUDED
12 
13 #if !defined(DECLARE_HAS_THIS_TYPE_PROCESS_INFO)
14 #define DECLARE_HAS_THIS_TYPE_PROCESS_INFO \
15  template<class TVariable> \
16  static bool HasProcessInfo(TVariable const& rV, ProcessInfo::Pointer& p) \
17  { \
18  return p->Has(rV); \
19  }
20 
21 #define DECLARE_HAS_THIS_TYPE_PROCESS_INFO_PYTHON(TClassName) \
22  .def_static("HasProcessInfo", &TClassName::HasProcessInfo< Variable< TClassName > >)
23 
24 #define DECLARE_HAS_THIS_TYPE_PROCESS_INFO_PYTHON_AS_POINTER(TClassName) \
25  .def_static("HasProcessInfo", &TClassName::HasProcessInfo< Variable< TClassName::Pointer > >)
26 #endif
27 
28 #if !defined(DECLARE_ADD_THIS_TYPE_TO_PROCESS_INFO)
29 #define DECLARE_ADD_THIS_TYPE_TO_PROCESS_INFO \
30  template<class TVariable> \
31  static void AddToProcessInfo(TVariable const& rV, typename TVariable::Type const& rValue, ProcessInfo::Pointer& p) \
32  { \
33  p->SetValue(rV, rValue); \
34  }
35 
36 #define DECLARE_ADD_THIS_TYPE_TO_PROCESS_INFO_PYTHON(TClassName) \
37  .def_static("AddToProcessInfo", &TClassName::AddToProcessInfo< Variable< TClassName > >)
38 
39 #define DECLARE_ADD_THIS_TYPE_TO_PROCESS_INFO_PYTHON_AS_POINTER(TClassName) \
40  .def_static("AddToProcessInfo", &TClassName::AddToProcessInfo< Variable< TClassName::Pointer > >)
41 #endif
42 
43 #if !defined(DECLARE_GET_THIS_TYPE_FROM_PROCESS_INFO)
44 #define DECLARE_GET_THIS_TYPE_FROM_PROCESS_INFO \
45  template<class TVariable> \
46  static typename TVariable::Type GetFromProcessInfo(TVariable const& rV, ProcessInfo::Pointer& p) \
47  { \
48  return p->GetValue(rV); \
49  }
50 
51 #define DECLARE_GET_THIS_TYPE_FROM_PROCESS_INFO_PYTHON(TClassName) \
52  .def_static("GetFromProcessInfo", &TClassName::GetFromProcessInfo< Variable< TClassName > >)
53 
54 #define DECLARE_GET_THIS_TYPE_FROM_PROCESS_INFO_PYTHON_AS_POINTER(TClassName) \
55  .def_static("GetFromProcessInfo", &TClassName::GetFromProcessInfo< Variable< TClassName::Pointer > >)
56 #endif
57 
58 #endif // PROCESS_INFO_EXTENSIONS_H_INCLUDED defined