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.
properties_variable_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"
22 #include "expression/traits.h"
23 #include "containers/variable.h"
24 #include "includes/define.h"
25 #include "includes/model_part.h"
27 
28 namespace Kratos {
29 
30 
31 class KRATOS_API(OPTIMIZATION_APPLICATION) PropertiesVariableExpressionIO
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 
50 
51  class KRATOS_API(OPTIMIZATION_APPLICATION) Input : public ExpressionInput
52  {
53  public:
56 
58 
62 
63  Input(
64  const ModelPart& rModelPart,
65  const VariableType& rVariable,
66  Globals::DataLocation CurrentLocation);
67 
71 
72  Expression::Pointer Execute() const override;
73 
75 
76  private:
79 
80  ModelPart const * mpModelPart;
81 
82  VariableType mpVariable;
83 
84  Globals::DataLocation mDataLocation;
85 
87 
88  };
89 
90  class KRATOS_API(OPTIMIZATION_APPLICATION) Output : public ExpressionOutput
91  {
92  public:
95 
97 
101 
102  Output(
103  ModelPart& rModelPart,
104  const VariableType& rVariable,
105  Globals::DataLocation CurrentLocation);
106 
110 
111  void Execute(const Expression& rExpression) override;
112 
114 
115  private:
118 
119  ModelPart * mpModelPart;
120 
121  VariableType mpVariable;
122 
123  Globals::DataLocation mDataLocation;
124 
126 
127  };
128 
132 
133  template<class TContainerType, MeshType TMeshType = MeshType::Local>
134  static void Read(
136  const VariableType& rVariable);
137 
138  template<class TContainerType, MeshType TMeshType = MeshType::Local>
139  static void Check(
140  const ContainerExpression<TContainerType, TMeshType>& rContainerExpression,
141  const VariableType& rVariable);
142 
143  template<class TContainerType, MeshType TMeshType = MeshType::Local>
144  static void Write(
145  const ContainerExpression<TContainerType, TMeshType>& rContainerExpression,
146  const VariableType& rVariable);
147 
149 
150 }; // class ExpressionIO
151 
152 
153 } // 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
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
Definition: properties_variable_expression_io.h:52
Definition: properties_variable_expression_io.h:91
Definition: properties_variable_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: properties_variable_expression_io.h:45
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