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.
collective_expression.h
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // license: OptimizationApplication/license.txt
9 //
10 // Main author: Suneth Warnakulasuriya
11 //
12 
13 #pragma once
14 
15 // System includes
16 #include <string>
17 #include <vector>
18 #include <variant>
19 
20 // Project includes
22 #include "expression/traits.h"
23 #include "includes/define.h"
24 #include "includes/model_part.h"
25 
26 // Application includes
28 
29 namespace Kratos {
30 
33 
41 class KRATOS_API(OPTIMIZATION_APPLICATION) CollectiveExpression {
42 public:
45 
46  using IndexType = std::size_t;
47 
48  using CollectiveExpressionType = std::variant<
52 
54 
58 
59  // Default constructor
61 
62 
68  CollectiveExpression(const std::vector<CollectiveExpressionType>& rExpressionPointersList);
69 
70  // Copy consttructor
72 
75 
76  // destructor
78 
82 
92 
98  void Add(const CollectiveExpressionType& pExpression);
99 
108  void Add(const CollectiveExpression& rCollectiveExpression);
109 
117  void Clear();
118 
126  IndexType GetCollectiveFlattenedDataSize() const;
127 
128  std::vector<CollectiveExpressionType> GetContainerExpressions();
129 
130  std::vector<CollectiveExpressionType> GetContainerExpressions() const;
131 
132  bool IsCompatibleWith(const CollectiveExpression& rOther) const;
133 
137 
139 
141 
143 
145 
147 
149 
151 
153 
157 
158  std::string Info() const;
159 
161 private:
164 
165  std::vector<CollectiveExpressionType> mExpressionPointersList;
166 
168 };
169 
173 
175 inline std::ostream& operator<<(
176  std::ostream& rOStream,
178 {
179  return rOStream << rThis.Info();
180 }
181 
183 
184 } // namespace Kratos
std::string Info() const override
Turn back information as a string.
Definition: periodic_interface_process.hpp:93
Construct a new CollectiveExpression instance.
Definition: collective_expression.h:41
std::variant< ContainerExpression< ModelPart::NodesContainerType >::Pointer, ContainerExpression< ModelPart::ConditionsContainerType >::Pointer, ContainerExpression< ModelPart::ElementsContainerType >::Pointer > CollectiveExpressionType
Definition: collective_expression.h:51
std::size_t IndexType
Definition: collective_expression.h:46
KRATOS_CLASS_POINTER_DEFINITION(CollectiveExpression)
CollectiveExpression() noexcept=default
Container variable data holder.
Definition: container_expression.h:80
std::string Info() const override
Turn back information as a string.
Definition: periodic_interface_process.hpp:123
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
Kratos::PeriodicInterfaceProcess Process operator(std::istream &rIStream, PeriodicInterfaceProcess &rThis)
input stream function
default
Definition: generate_gid_list_file.py:35
tuple const
Definition: ode_solve.py:403
namespace
Definition: array_1d.h:793