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.
conservative_element_rv.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_CONSERVATIVE_ELEMENT_RV_H_INCLUDED
14 #define KRATOS_CONSERVATIVE_ELEMENT_RV_H_INCLUDED
15 
16 // System includes
17 
18 
19 // External includes
20 
21 
22 // Project includes
23 #include "conservative_element.h"
24 
25 namespace Kratos
26 {
29 
32 
36 
40 
44 
48 
50 template<std::size_t TNumNodes>
51 class ConservativeElementRV : public ConservativeElement<TNumNodes>
52 {
53 public:
56 
57  typedef std::size_t IndexType;
58 
59  typedef Node NodeType;
60 
62 
64 
66 
68 
70 
72 
74 
76 
78 
82 
84 
88 
93 
97  ConservativeElementRV(IndexType NewId, const NodesArrayType& ThisNodes) : ConservativeElementType(NewId, ThisNodes){}
98 
102  ConservativeElementRV(IndexType NewId, GeometryType::Pointer pGeometry) : ConservativeElementType(NewId, pGeometry){}
103 
107  ConservativeElementRV(IndexType NewId, GeometryType::Pointer pGeometry, typename PropertiesType::Pointer pProperties) : ConservativeElementType(NewId, pGeometry, pProperties){}
108 
112  ~ ConservativeElementRV() override {};
113 
117 
125  Element::Pointer Create(IndexType NewId, NodesArrayType const& ThisNodes, typename PropertiesType::Pointer pProperties) const override
126  {
127  return Kratos::make_intrusive<ConservativeElementRV<TNumNodes>>(NewId, this->GetGeometry().Create(ThisNodes), pProperties);
128  }
129 
137  Element::Pointer Create(IndexType NewId, GeometryType::Pointer pGeom, typename PropertiesType::Pointer pProperties) const override
138  {
139  return Kratos::make_intrusive<ConservativeElementRV<TNumNodes>>(NewId, pGeom, pProperties);
140  }
141 
148  Element::Pointer Clone(IndexType NewId, NodesArrayType const& ThisNodes) const override
149  {
150  Element::Pointer p_new_elem = Create(NewId, this->GetGeometry().Create(ThisNodes), this->pGetProperties());
151  p_new_elem->SetData(this->GetData());
152  p_new_elem->Set(Flags(*this));
153  return p_new_elem;
154  }
155 
159 
163  std::string Info() const override
164  {
165  return "ConservativeElementRV";
166  }
167 
169 
170 protected:
173 
175 
179 
180  void GetNodalData(ElementData& rData, const GeometryType& rGeometry, int Step = 0) override;
181 
183  BoundedMatrix<double,3,3>& rViscosity,
184  BoundedMatrix<double,2,2>& rDiffusion,
185  const ElementData& rData,
186  const array_1d<double,TNumNodes>& rN,
187  const BoundedMatrix<double,TNumNodes,2>& rDN_DX) override;
188 
190  double& rArtViscosity,
191  double& rArtDiffusion,
192  const ElementData& rData,
193  const array_1d<double,TNumNodes>& rN,
194  const BoundedMatrix<double,3,2>& rDN_DX);
195 
196  void AlgebraicResidual(
197  array_1d<double,3>& rFlowResidual,
198  double& rHeightresidual,
199  BoundedMatrix<double,3,3>& rFlowGrad,
200  array_1d<double,3>& rHeightGrad,
201  const ElementData& rData,
202  const array_1d<double,TNumNodes>& rN,
203  const BoundedMatrix<double,3,2>& rDN_DX);
204 
206 
207 private:
210 
211  friend class Serializer;
212 
213  void save(Serializer& rSerializer) const override
214  {
216  }
217 
218  void load(Serializer& rSerializer) override
219  {
221  }
222 
226 
227 
231 
232 
234 
235 }; // Class ConservativeElementRV
236 
240 
241 
243 
245 
246 } // namespace Kratos.
247 
248 #endif // KRATOS_CONSERVATIVE_ELEMENT_RV_H_INCLUDED defined
Implementation of a linear element for shallow water problems.
Definition: conservative_element.h:52
static constexpr IndexType mLocalSize
Definition: conservative_element.h:182
Implementation of a linear element for shallow water problems.
Definition: conservative_element_rv.h:52
ConservativeElement< TNumNodes > ConservativeElementType
Definition: conservative_element_rv.h:63
std::string Info() const override
Turn back information as a string.
Definition: conservative_element_rv.h:163
ConservativeElementType::PropertiesType PropertiesType
Definition: conservative_element_rv.h:69
Element::Pointer Clone(IndexType NewId, NodesArrayType const &ThisNodes) const override
Create a new element pointer and clone the previous element data.
Definition: conservative_element_rv.h:148
ConservativeElementRV()
Default constructor.
Definition: conservative_element_rv.h:92
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(ConservativeElementRV)
ConservativeElementRV(IndexType NewId, GeometryType::Pointer pGeometry)
Constructor using Geometry.
Definition: conservative_element_rv.h:102
Node NodeType
Definition: conservative_element_rv.h:59
ConservativeElementType::LocalVectorType LocalVectorType
Definition: conservative_element_rv.h:75
void GetNodalData(ElementData &rData, const GeometryType &rGeometry, int Step=0) override
Definition: conservative_element_rv.cpp:30
std::size_t IndexType
Definition: conservative_element_rv.h:57
Element::Pointer Create(IndexType NewId, GeometryType::Pointer pGeom, typename PropertiesType::Pointer pProperties) const override
Create a new element pointer.
Definition: conservative_element_rv.h:137
void CalculateArtificialViscosity(BoundedMatrix< double, 3, 3 > &rViscosity, BoundedMatrix< double, 2, 2 > &rDiffusion, const ElementData &rData, const array_1d< double, TNumNodes > &rN, const BoundedMatrix< double, TNumNodes, 2 > &rDN_DX) override
Definition: conservative_element_rv.cpp:44
ConservativeElementRV(IndexType NewId, GeometryType::Pointer pGeometry, typename PropertiesType::Pointer pProperties)
Constructor using Geometry and Properties.
Definition: conservative_element_rv.h:107
void ShockCapturingParameters(double &rArtViscosity, double &rArtDiffusion, const ElementData &rData, const array_1d< double, TNumNodes > &rN, const BoundedMatrix< double, 3, 2 > &rDN_DX)
Definition: conservative_element_rv.cpp:67
~ ConservativeElementRV() override
Destructor.
Definition: conservative_element_rv.h:112
Geometry< NodeType > GeometryType
Definition: conservative_element_rv.h:61
ConservativeElementType::ElementData ElementData
Definition: conservative_element_rv.h:71
ConservativeElementType::NodesArrayType NodesArrayType
Definition: conservative_element_rv.h:67
ConservativeElementRV(IndexType NewId, const NodesArrayType &ThisNodes)
Constructor using an array of nodes.
Definition: conservative_element_rv.h:97
static constexpr IndexType mLocalSize
Definition: conservative_element_rv.h:174
void AlgebraicResidual(array_1d< double, 3 > &rFlowResidual, double &rHeightresidual, BoundedMatrix< double, 3, 3 > &rFlowGrad, array_1d< double, 3 > &rHeightGrad, const ElementData &rData, const array_1d< double, TNumNodes > &rN, const BoundedMatrix< double, 3, 2 > &rDN_DX)
Definition: conservative_element_rv.cpp:100
ConservativeElementType::LocalMatrixType LocalMatrixType
Definition: conservative_element_rv.h:73
ConservativeElementType::WaveElementType WaveElementType
Definition: conservative_element_rv.h:65
ConservativeElementType::ShapeFunctionsGradientsType ShapeFunctionsGradientsType
Definition: conservative_element_rv.h:77
Element::Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, typename PropertiesType::Pointer pProperties) const override
Create a new element pointer.
Definition: conservative_element_rv.h:125
Base class for all Elements.
Definition: element.h:60
PropertiesType::Pointer pGetProperties()
returns the pointer to the property of the element. Does not throw an error, to allow copying of elem...
Definition: element.h:1014
std::size_t IndexType
Definition: flags.h:74
Flags()
Default constructor.
Definition: flags.h:119
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
Definition: amatrix_interface.h:41
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
Properties encapsulates data shared by different Elements or Conditions. It can store any type of dat...
Definition: properties.h:69
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 linear element for shallow water problems.
Definition: wave_element.h:55
Short class definition.
Definition: array_1d.h:61
#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
Definition: wave_element.h:299