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.
integration_point_expression_io.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: Suneth Warnakulasuriya
11 //
12 
13 #pragma once
14 
15 // System incldues
16 #include <variant>
17 
18 // Project includes
19 #include "containers/array_1d.h"
21 #include "expression/traits.h"
22 #include "containers/variable.h"
23 #include "expression_io.h"
24 #include "includes/define.h"
25 #include "includes/model_part.h"
27 
28 namespace Kratos {
29 
30 
31 class KRATOS_API(KRATOS_CORE) IntegrationPointExpressionIO
32 {
33 public:
36 
37  using VariableType = std::variant<
38  const Variable<int>*,
39  const Variable<double>*,
44  const Variable<Vector>*,
45  const Variable<Matrix>*>;
46 
47 
51 
52  class KRATOS_API(KRATOS_CORE) Input : public ExpressionInput
53  {
54  public:
57 
59 
63 
64  Input(
65  ModelPart& rModelPart,
66  const VariableType& rVariable,
67  Globals::DataLocation CurrentLocation,
68  MeshType CurrentMeshType = MeshType::Local);
69 
70  ~Input() override = default;
71 
75 
76  Expression::Pointer Execute() const override;
77 
79 
80  private:
83 
84  ModelPart* mpModelPart;
85 
86  VariableType mpVariable;
87 
88  Globals::DataLocation mDataLocation;
89 
90  MeshType mMeshType;
91 
93 
94  };
95 
96  class KRATOS_API(KRATOS_CORE) Output : public ExpressionOutput
97  {
98  public:
101 
103 
107 
108  Output(
109  ModelPart& rModelPart,
110  const VariableType& rVariable,
111  Globals::DataLocation CurrentLocation,
112  MeshType CurrentMeshType = MeshType::Local);
113 
114  ~Output() override = default;
115 
119 
120  void Execute(const Expression& rExpression) override;
121 
123 
124  private:
127 
128  ModelPart* mpModelPart;
129 
130  VariableType mpVariable;
131 
132  Globals::DataLocation mDataLocation;
133 
134  MeshType mMeshType;
135 
137 
138  };
139 
143 
144  template<class TContainerType, MeshType TMeshType>
145  KRATOS_API(KRATOS_CORE) static void Read(
147  const VariableType& rVariable);
148 
149  template<class TContainerType, MeshType TMeshType>
150  KRATOS_API(KRATOS_CORE) static void Write(
151  const ContainerExpression<TContainerType, TMeshType>& rContainerExpression,
152  const VariableType& rVariable);
153 
155 
156 }; // class ExpressionIO
157 
158 
159 } // namespace Kratos
Container variable data holder.
Definition: container_expression.h:80
Base class or all the expression types.
Definition: expression.h:38
Kratos::intrusive_ptr< Expression > Pointer
Definition: expression.h:44
Definition: expression_io.h:25
Definition: expression_io.h:69
Definition: integration_point_expression_io.h:53
Definition: integration_point_expression_io.h:97
Definition: integration_point_expression_io.h:32
std::variant< const Variable< int > *, const Variable< double > *, const Variable< array_1d< double, 3 > > *, const Variable< array_1d< double, 4 > > *, const Variable< array_1d< double, 6 > > *, const Variable< array_1d< double, 9 > > *, const Variable< Vector > *, const Variable< Matrix > * > VariableType
Definition: integration_point_expression_io.h:45
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
#define KRATOS_API(...)
Definition: kratos_export_api.h:40
DataLocation
Enum for location of data.
Definition: global_variables.h:48
void Read(LiteralFlatExpression< std::conditional_t< std::is_same_v< TDataType, int >, int, double >> &rExpression, const IndexType EntityDataBeginIndex, const TDataType &rValue, std::index_sequence< TIndex... >)
Definition: variable_expression_data_io.cpp:31
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
MeshType
Definition: traits.h:19
@ Local
Definition: traits.h:20