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.
crank_nicolson_wave_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 #ifndef KRATOS_CRANK_NICOLSON_WAVE_ELEMENT_H_INCLUDED
14 #define KRATOS_CRANK_NICOLSON_WAVE_ELEMENT_H_INCLUDED
15 
16 // System includes
17 
18 
19 // External includes
20 
21 
22 // Project includes
23 #include "wave_element.h"
24 
25 namespace Kratos
26 {
29 
32 
36 
40 
44 
48 
50 template<std::size_t TNumNodes>
51 class CrankNicolsonWaveElement : public WaveElement<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  CrankNicolsonWaveElement(IndexType NewId, const NodesArrayType& ThisNodes) : WaveElementType(NewId, ThisNodes){}
98 
102  CrankNicolsonWaveElement(IndexType NewId, GeometryType::Pointer pGeometry) : WaveElementType(NewId, pGeometry){}
103 
107  CrankNicolsonWaveElement(IndexType NewId, GeometryType::Pointer pGeometry, typename PropertiesType::Pointer pProperties) : WaveElementType(NewId, pGeometry, pProperties){}
108 
113 
117 
125  Element::Pointer Create(IndexType NewId, NodesArrayType const& ThisNodes, typename PropertiesType::Pointer pProperties) const override
126  {
127  return Kratos::make_intrusive<CrankNicolsonWaveElement<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<CrankNicolsonWaveElement<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 
162  void CalculateLocalSystem(MatrixType& rLeftHandSideMatrix, VectorType& rRightHandSideVector, const ProcessInfo& rCurrentProcessInfo) override;
163 
169  void CalculateMassMatrix(MatrixType& rMassMatrix, const ProcessInfo& rCurrentProcessInfo) override;
170 
174 
175 
179 
180 
184 
188  std::string Info() const override
189  {
190  return "CrankNicolsonWaveElement";
191  }
192 
194 
195 private:
198 
199  friend class Serializer;
200 
201  void save(Serializer& rSerializer) const override
202  {
204  }
205 
206  void load(Serializer& rSerializer) override
207  {
209  }
210 
214 
215 
219 
220 
222 
223 }; // Class CrankNicolsonWaveElement
224 
228 
229 
231 
233 
234 } // namespace Kratos.
235 
236 #endif // KRATOS_CRANK_NICOLSON_WAVE_ELEMENT_H_INCLUDED defined
Implementation of a linear element for shallow water problems.
Definition: crank_nicolson_wave_element.h:52
Element::Pointer Clone(IndexType NewId, NodesArrayType const &ThisNodes) const override
Create a new element pointer and clone the previous element data.
Definition: crank_nicolson_wave_element.h:148
WaveElementType::ShapeFunctionsGradientsType ShapeFunctionsGradientsType
Definition: crank_nicolson_wave_element.h:77
std::string Info() const override
Turn back information as a string.
Definition: crank_nicolson_wave_element.h:188
WaveElementType::MatrixType MatrixType
Definition: crank_nicolson_wave_element.h:65
WaveElementType::LocalVectorType LocalVectorType
Definition: crank_nicolson_wave_element.h:75
CrankNicolsonWaveElement(IndexType NewId, const NodesArrayType &ThisNodes)
Constructor using an array of nodes.
Definition: crank_nicolson_wave_element.h:97
Element::Pointer Create(IndexType NewId, GeometryType::Pointer pGeom, typename PropertiesType::Pointer pProperties) const override
Create a new element pointer.
Definition: crank_nicolson_wave_element.h:137
Geometry< NodeType > GeometryType
Definition: crank_nicolson_wave_element.h:61
CrankNicolsonWaveElement(IndexType NewId, GeometryType::Pointer pGeometry, typename PropertiesType::Pointer pProperties)
Constructor using Geometry and Properties.
Definition: crank_nicolson_wave_element.h:107
WaveElementType::VectorType VectorType
Definition: crank_nicolson_wave_element.h:67
Node NodeType
Definition: crank_nicolson_wave_element.h:59
void CalculateLocalSystem(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Calculate the elemental contribution to the problem.
CrankNicolsonWaveElement(IndexType NewId, GeometryType::Pointer pGeometry)
Constructor using Geometry.
Definition: crank_nicolson_wave_element.h:102
WaveElementType::LocalMatrixType LocalMatrixType
Definition: crank_nicolson_wave_element.h:73
WaveElementType::PropertiesType PropertiesType
Definition: crank_nicolson_wave_element.h:71
void CalculateMassMatrix(MatrixType &rMassMatrix, const ProcessInfo &rCurrentProcessInfo) override
Calculate the elemental mass matrix.
Definition: crank_nicolson_wave_element.cpp:90
WaveElementType::NodesArrayType NodesArrayType
Definition: crank_nicolson_wave_element.h:69
CrankNicolsonWaveElement()
Default constructor.
Definition: crank_nicolson_wave_element.h:92
WaveElement< TNumNodes > WaveElementType
Definition: crank_nicolson_wave_element.h:63
~ CrankNicolsonWaveElement() override
Destructor.
Definition: crank_nicolson_wave_element.h:112
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(CrankNicolsonWaveElement)
std::size_t IndexType
Definition: crank_nicolson_wave_element.h:57
Element::Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, typename PropertiesType::Pointer pProperties) const override
Create a new element pointer.
Definition: crank_nicolson_wave_element.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
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
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
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