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.
boussinesq_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 #ifndef KRATOS_BOUSSINESQ_CONDITION_H_INCLUDED
14 #define KRATOS_BOUSSINESQ_CONDITION_H_INCLUDED
15 
16 // System includes
17 
18 
19 // External includes
20 
21 
22 // Project includes
23 #include "primitive_condition.h"
24 
25 namespace Kratos
26 {
29 
32 
36 
40 
47 template<std::size_t TNumNodes>
48 class BoussinesqCondition : public PrimitiveCondition<TNumNodes>
49 {
50 public:
53 
54  typedef std::size_t IndexType;
55 
56  typedef Node NodeType;
57 
59 
61 
63 
65 
67 
69 
71 
73 
75 
79 
81 
85 
90 
94  BoussinesqCondition(IndexType NewId, const NodesArrayType& ThisNodes) : BaseType(NewId, ThisNodes){}
95 
99  BoussinesqCondition(IndexType NewId, GeometryType::Pointer pGeometry) : BaseType(NewId, pGeometry){}
100 
104  BoussinesqCondition(IndexType NewId, GeometryType::Pointer pGeometry, typename PropertiesType::Pointer pProperties) : BaseType(NewId, pGeometry, pProperties){}
105 
109  ~ BoussinesqCondition() override {};
110 
114 
122  Condition::Pointer Create(IndexType NewId, NodesArrayType const& ThisNodes, typename PropertiesType::Pointer pProperties) const override
123  {
124  return Kratos::make_intrusive<BoussinesqCondition<TNumNodes>>(NewId, this->GetGeometry().Create(ThisNodes), pProperties);
125  }
126 
134  Condition::Pointer Create(IndexType NewId, GeometryType::Pointer pGeom, typename PropertiesType::Pointer pProperties) const override
135  {
136  return Kratos::make_intrusive<BoussinesqCondition<TNumNodes>>(NewId, pGeom, pProperties);
137  }
138 
145  Condition::Pointer Clone(IndexType NewId, NodesArrayType const& ThisNodes) const override
146  {
147  Condition::Pointer p_new_cond = Create(NewId, this->GetGeometry().Create(ThisNodes), this->pGetProperties());
148  p_new_cond->SetData(this->GetData());
149  p_new_cond->Set(Flags(*this));
150  return p_new_cond;
151  }
152 
157  void InitializeNonLinearIteration(const ProcessInfo& rCurrentProcessInfo) override;
158 
162 
167  const Parameters GetSpecifications() const override;
168 
172 
176  std::string Info() const override
177  {
178  return "BoussinesqCondition";
179  }
180 
184 
185 
187 
188 protected:
191 
193 
197 
199  LocalVectorType& rDispersionH,
200  LocalVectorType& rDispersionU,
201  const GeometryType& rParentGeometry,
202  const ConditionData& rData,
203  const array_1d<double,TNumNodes>& rN,
204  const Matrix& rDN_DX,
205  const double Weight = 1.0);
206 
208  Matrix& rDN_DX,
209  const GeometryType& rParentGeometry,
210  const Point& rPoint);
211 
213 
214 private:
217 
218 
222 
223 
227 
228  friend class Serializer;
229 
230  void save(Serializer& rSerializer) const override
231  {
233  }
234 
235  void load(Serializer& rSerializer) override
236  {
238  }
239 
243 
244 
246 
247 }; // Class BoussinesqCondition
248 
252 
253 
257 
258 
260 
262 
263 } // namespace Kratos.
264 
265 #endif // KRATOS_BOUSSINESQ_CONDITION_H_INCLUDED defined
Implementation of a condition for shallow water waves problems.
Definition: boussinesq_condition.h:49
BaseType::DofsVectorType DofsVectorType
Definition: boussinesq_condition.h:68
std::size_t IndexType
Definition: boussinesq_condition.h:54
static constexpr IndexType mLocalSize
Definition: boussinesq_condition.h:192
PrimitiveCondition< TNumNodes > BaseType
Definition: boussinesq_condition.h:60
BaseType::PropertiesType PropertiesType
Definition: boussinesq_condition.h:64
Condition::Pointer Create(IndexType NewId, GeometryType::Pointer pGeom, typename PropertiesType::Pointer pProperties) const override
Create a new condition pointer.
Definition: boussinesq_condition.h:134
const Parameters GetSpecifications() const override
This method provides the specifications/requirements of the element.
Definition: boussinesq_condition.cpp:29
BaseType::LocalMatrixType LocalMatrixType
Definition: boussinesq_condition.h:74
BaseType::ConditionData ConditionData
Definition: boussinesq_condition.h:70
BaseType::LocalVectorType LocalVectorType
Definition: boussinesq_condition.h:72
Node NodeType
Definition: boussinesq_condition.h:56
std::string Info() const override
Turn back information as a string.
Definition: boussinesq_condition.h:176
void InitializeNonLinearIteration(const ProcessInfo &rCurrentProcessInfo) override
Calculate the velocity laplacian projection.
Definition: boussinesq_condition.cpp:122
BaseType::EquationIdVectorType EquationIdVectorType
Definition: boussinesq_condition.h:66
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(BoussinesqCondition)
BoussinesqCondition()
Default constructor.
Definition: boussinesq_condition.h:89
BoussinesqCondition(IndexType NewId, GeometryType::Pointer pGeometry)
Constructor using Geometry.
Definition: boussinesq_condition.h:99
Condition::Pointer Clone(IndexType NewId, NodesArrayType const &ThisNodes) const override
Create a new condition pointer and clone the previous condition data.
Definition: boussinesq_condition.h:145
~ BoussinesqCondition() override
Destructor.
Definition: boussinesq_condition.h:109
BaseType::NodesArrayType NodesArrayType
Definition: boussinesq_condition.h:62
Condition::Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, typename PropertiesType::Pointer pProperties) const override
Create a new condition pointer.
Definition: boussinesq_condition.h:122
Geometry< NodeType > GeometryType
Definition: boussinesq_condition.h:58
BoussinesqCondition(IndexType NewId, GeometryType::Pointer pGeometry, typename PropertiesType::Pointer pProperties)
Constructor using Geometry and Properties.
Definition: boussinesq_condition.h:104
void AddDispersionProjection(LocalVectorType &rDispersionH, LocalVectorType &rDispersionU, const GeometryType &rParentGeometry, const ConditionData &rData, const array_1d< double, TNumNodes > &rN, const Matrix &rDN_DX, const double Weight=1.0)
Definition: boussinesq_condition.cpp:42
BoussinesqCondition(IndexType NewId, const NodesArrayType &ThisNodes)
Constructor using an array of nodes.
Definition: boussinesq_condition.h:94
void CalculateShapeFunctionDerivatives(Matrix &rDN_DX, const GeometryType &rParentGeometry, const Point &rPoint)
Definition: boussinesq_condition.cpp:91
Base class for all Conditions.
Definition: condition.h:59
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
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
Point class.
Definition: point.h:59
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
static constexpr IndexType mLocalSize
Definition: primitive_condition.h:171
BaseType::LocalVectorType LocalVectorType
Definition: primitive_condition.h:71
BaseType::DofsVectorType DofsVectorType
Definition: primitive_condition.h:67
BaseType::ConditionData ConditionData
Definition: primitive_condition.h:69
BaseType::PropertiesType PropertiesType
Definition: primitive_condition.h:63
BaseType::EquationIdVectorType EquationIdVectorType
Definition: primitive_condition.h:65
BaseType::NodesArrayType NodesArrayType
Definition: primitive_condition.h:61
BaseType::LocalMatrixType LocalMatrixType
Definition: primitive_condition.h:73
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
#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