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.
primitive_condition.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: Miguel Maso Sotomayor
11 //
12 
13 #pragma once
14 
15 // System includes
16 
17 
18 // External includes
19 
20 
21 // Project includes
22 #include "wave_condition.h"
23 
24 namespace Kratos
25 {
28 
31 
35 
39 
46 template<std::size_t TNumNodes>
47 class PrimitiveCondition : public WaveCondition<TNumNodes>
48 {
49 public:
52 
53  typedef std::size_t IndexType;
54 
55  typedef Node NodeType;
56 
58 
60 
62 
64 
66 
68 
69  typedef typename BaseType::ConditionData ConditionData;
70 
72 
74 
78 
80 
84 
89 
93  PrimitiveCondition(IndexType NewId, const NodesArrayType& ThisNodes) : BaseType(NewId, ThisNodes){}
94 
98  PrimitiveCondition(IndexType NewId, GeometryType::Pointer pGeometry) : BaseType(NewId, pGeometry){}
99 
103  PrimitiveCondition(IndexType NewId, GeometryType::Pointer pGeometry, typename PropertiesType::Pointer pProperties) : BaseType(NewId, pGeometry, pProperties){}
104 
108  ~ PrimitiveCondition() override {};
109 
113 
121  Condition::Pointer Create(IndexType NewId, NodesArrayType const& ThisNodes, typename PropertiesType::Pointer pProperties) const override
122  {
123  return Kratos::make_intrusive<PrimitiveCondition<TNumNodes>>(NewId, this->GetGeometry().Create(ThisNodes), pProperties);
124  }
125 
133  Condition::Pointer Create(IndexType NewId, GeometryType::Pointer pGeom, typename PropertiesType::Pointer pProperties) const override
134  {
135  return Kratos::make_intrusive<PrimitiveCondition<TNumNodes>>(NewId, pGeom, pProperties);
136  }
137 
144  Condition::Pointer Clone(IndexType NewId, NodesArrayType const& ThisNodes) const override
145  {
146  Condition::Pointer p_new_elem = Create(NewId, this->GetGeometry().Create(ThisNodes), this->pGetProperties());
147  p_new_elem->SetData(this->GetData());
148  p_new_elem->Set(Flags(*this));
149  return p_new_elem;
150  }
151 
155  std::string Info() const override
156  {
157  return "PrimitiveCondition";
158  }
159 
163 
164 
166 
167 protected:
170 
172 
176 
178  ConditionData& rData,
179  const IndexType PointIndex,
180  const array_1d<double,TNumNodes>& rN) override;
181 
183 
184 private:
187 
188 
192 
193 
197 
198  friend class Serializer;
199 
200  void save(Serializer& rSerializer) const override
201  {
203  }
204 
205  void load(Serializer& rSerializer) override
206  {
208  }
209 
213 
214 
216 
217 }; // Class PrimitiveCondition
218 
222 
223 
227 
228 
230 
232 
233 } // namespace Kratos.
Base class for all Conditions.
Definition: condition.h:59
Geometry< NodeType >::PointsArrayType NodesArrayType
definition of nodes container type, redefined from GeometryType
Definition: condition.h:86
std::vector< std::size_t > EquationIdVectorType
Definition: condition.h:98
std::vector< DofType::Pointer > DofsVectorType
Definition: condition.h:100
Properties PropertiesType
Definition: condition.h:80
PropertiesType::Pointer pGetProperties()
returns the pointer to the property of the condition. Does not throw an error, to allow copying of co...
Definition: condition.h:964
std::size_t IndexType
Definition: flags.h:74
Flags()
Default constructor.
Definition: flags.h:119
This defines the geometrical object, base definition of the element and condition entities.
Definition: geometrical_object.h:58
GeometryType & GetGeometry()
Returns the reference of the geometry.
Definition: geometrical_object.h:158
DataValueContainer & GetData()
Definition: geometrical_object.h:212
Geometry base class.
Definition: geometry.h:71
virtual Pointer Create(PointsArrayType const &rThisPoints) const
Creates a new geometry pointer.
Definition: geometry.h:813
This class defines the node.
Definition: node.h:65
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
Implementation of a condition for shallow water waves problems.
Definition: primitive_condition.h:48
PrimitiveCondition()
Default constructor.
Definition: primitive_condition.h:88
static constexpr IndexType mLocalSize
Definition: primitive_condition.h:171
BaseType::LocalVectorType LocalVectorType
Definition: primitive_condition.h:71
Node NodeType
Definition: primitive_condition.h:55
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(PrimitiveCondition)
PrimitiveCondition(IndexType NewId, GeometryType::Pointer pGeometry, typename PropertiesType::Pointer pProperties)
Constructor using Geometry and Properties.
Definition: primitive_condition.h:103
BaseType::DofsVectorType DofsVectorType
Definition: primitive_condition.h:67
Condition::Pointer Create(IndexType NewId, GeometryType::Pointer pGeom, typename PropertiesType::Pointer pProperties) const override
Create a new condition pointer.
Definition: primitive_condition.h:133
Condition::Pointer Clone(IndexType NewId, NodesArrayType const &ThisNodes) const override
Create a new condition pointer and clone the previous condition data.
Definition: primitive_condition.h:144
WaveCondition< TNumNodes > BaseType
Definition: primitive_condition.h:59
BaseType::ConditionData ConditionData
Definition: primitive_condition.h:69
PrimitiveCondition(IndexType NewId, GeometryType::Pointer pGeometry)
Constructor using Geometry.
Definition: primitive_condition.h:98
BaseType::PropertiesType PropertiesType
Definition: primitive_condition.h:63
BaseType::EquationIdVectorType EquationIdVectorType
Definition: primitive_condition.h:65
Condition::Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, typename PropertiesType::Pointer pProperties) const override
Create a new condition pointer.
Definition: primitive_condition.h:121
std::size_t IndexType
Definition: primitive_condition.h:53
std::string Info() const override
Turn back information as a string.
Definition: primitive_condition.h:155
Geometry< NodeType > GeometryType
Definition: primitive_condition.h:57
BaseType::NodesArrayType NodesArrayType
Definition: primitive_condition.h:61
BaseType::LocalMatrixType LocalMatrixType
Definition: primitive_condition.h:73
~ PrimitiveCondition() override
Destructor.
Definition: primitive_condition.h:108
PrimitiveCondition(IndexType NewId, const NodesArrayType &ThisNodes)
Constructor using an array of nodes.
Definition: primitive_condition.h:93
void CalculateGaussPointData(ConditionData &rData, const IndexType PointIndex, const array_1d< double, TNumNodes > &rN) override
Definition: primitive_condition.cpp:33
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
Implementation of a condition for shallow water waves problems.
Definition: wave_condition.h:51
static constexpr IndexType mLocalSize
Definition: wave_condition.h:261
array_1d< double, 3 *TNumNodes > LocalVectorType
Definition: wave_condition.h:60
BoundedMatrix< double, 3 *TNumNodes, 3 *TNumNodes > LocalMatrixType
Definition: wave_condition.h:62
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
def load(f)
Definition: ode_solve.py:307