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_element.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_element.h"
23 
24 namespace Kratos
25 {
28 
31 
35 
39 
43 
47 
49 template<std::size_t TNumNodes>
50 class PrimitiveElement : public WaveElement<TNumNodes>
51 {
52 public:
55 
56  typedef std::size_t IndexType;
57 
58  typedef Node NodeType;
59 
61 
63 
65 
67 
68  typedef typename BaseType::ElementData ElementData;
69 
71 
73 
75 
79 
81 
85 
90 
94  PrimitiveElement(IndexType NewId, const NodesArrayType& ThisNodes) : BaseType(NewId, ThisNodes) {}
95 
99  PrimitiveElement(IndexType NewId, GeometryType::Pointer pGeometry) : BaseType(NewId, pGeometry) {}
100 
104  PrimitiveElement(IndexType NewId, GeometryType::Pointer pGeometry, typename PropertiesType::Pointer pProperties) : BaseType(NewId, pGeometry, pProperties) {}
105 
109  ~ PrimitiveElement() override {};
110 
114 
122  Element::Pointer Create(IndexType NewId, NodesArrayType const& ThisNodes, typename PropertiesType::Pointer pProperties) const override
123  {
124  return Kratos::make_intrusive<PrimitiveElement<TNumNodes>>(NewId, this->GetGeometry().Create(ThisNodes), pProperties);
125  }
126 
134  Element::Pointer Create(IndexType NewId, GeometryType::Pointer pGeom, typename PropertiesType::Pointer pProperties) const override
135  {
136  return Kratos::make_intrusive<PrimitiveElement<TNumNodes>>(NewId, pGeom, pProperties);
137  }
138 
145  Element::Pointer Clone(IndexType NewId, NodesArrayType const& ThisNodes) const override
146  {
147  Element::Pointer p_new_elem = Create(NewId, this->GetGeometry().Create(ThisNodes), this->pGetProperties());
148  p_new_elem->SetData(this->GetData());
149  p_new_elem->Set(Flags(*this));
150  return p_new_elem;
151  }
152 
156 
160  std::string Info() const override
161  {
162  return "PrimitiveElement";
163  }
164 
166 
167 protected:
170 
172 
176 
178  ElementData& rData,
179  const array_1d<double,TNumNodes>& rN) override;
180 
181  double StabilizationParameter(const ElementData& rData) const override;
182 
184 
185 private:
188 
189  friend class Serializer;
190 
191  void save(Serializer& rSerializer) const override
192  {
194  }
195 
196  void load(Serializer& rSerializer) override
197  {
199  }
200 
204 
205 
209 
210 
212 
213 }; // Class PrimitiveElement
214 
218 
219 
221 
223 
224 } // namespace Kratos.
Base class for all Elements.
Definition: element.h:60
Properties PropertiesType
Definition: element.h:80
Geometry< NodeType >::PointsArrayType NodesArrayType
definition of nodes container type, redefined from GeometryType
Definition: element.h:86
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
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 linear element for shallow water problems.
Definition: primitive_element.h:51
Element::Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, typename PropertiesType::Pointer pProperties) const override
Create a new element pointer.
Definition: primitive_element.h:122
BaseType::ShapeFunctionsGradientsType ShapeFunctionsGradientsType
Definition: primitive_element.h:74
double StabilizationParameter(const ElementData &rData) const override
Definition: primitive_element.cpp:76
std::string Info() const override
Turn back information as a string.
Definition: primitive_element.h:160
~ PrimitiveElement() override
Destructor.
Definition: primitive_element.h:109
BaseType::LocalVectorType LocalVectorType
Definition: primitive_element.h:72
Geometry< NodeType > GeometryType
Definition: primitive_element.h:60
void UpdateGaussPointData(ElementData &rData, const array_1d< double, TNumNodes > &rN) override
Definition: primitive_element.cpp:29
PrimitiveElement(IndexType NewId, GeometryType::Pointer pGeometry, typename PropertiesType::Pointer pProperties)
Constructor using Geometry and Properties.
Definition: primitive_element.h:104
PrimitiveElement()
Default constructor.
Definition: primitive_element.h:89
Element::Pointer Create(IndexType NewId, GeometryType::Pointer pGeom, typename PropertiesType::Pointer pProperties) const override
Create a new element pointer.
Definition: primitive_element.h:134
static constexpr IndexType mLocalSize
Definition: primitive_element.h:171
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(PrimitiveElement)
std::size_t IndexType
Definition: primitive_element.h:56
BaseType::NodesArrayType NodesArrayType
Definition: primitive_element.h:64
WaveElement< TNumNodes > BaseType
Definition: primitive_element.h:62
BaseType::LocalMatrixType LocalMatrixType
Definition: primitive_element.h:70
BaseType::ElementData ElementData
Definition: primitive_element.h:68
Element::Pointer Clone(IndexType NewId, NodesArrayType const &ThisNodes) const override
Create a new element pointer and clone the previous element data.
Definition: primitive_element.h:145
Node NodeType
Definition: primitive_element.h:58
PrimitiveElement(IndexType NewId, const NodesArrayType &ThisNodes)
Constructor using an array of nodes.
Definition: primitive_element.h:94
BaseType::PropertiesType PropertiesType
Definition: primitive_element.h:66
PrimitiveElement(IndexType NewId, GeometryType::Pointer pGeometry)
Constructor using Geometry.
Definition: primitive_element.h:99
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
GeometryType::ShapeFunctionsGradientsType ShapeFunctionsGradientsType
Definition: wave_element.h:68
static constexpr IndexType mLocalSize
Definition: wave_element.h:287
BoundedMatrix< double, 3 *TNumNodes, 3 *TNumNodes > LocalMatrixType
Definition: wave_element.h:66
array_1d< double, 3 *TNumNodes > LocalVectorType
Definition: wave_element.h:64
#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