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.
incompressible_potential_flow_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: Inigo Lopez and Riccardo Rossi
11 //
12 
13 #if !defined(KRATOS_INCOMPRESSIBLE_POTENTIAL_FLOW_ELEMENT_H)
14 #define KRATOS_INCOMPRESSIBLE_POTENTIAL_FLOW_ELEMENT_H
15 
16 // Project includes
17 #include "includes/element.h"
18 #include "includes/kratos_flags.h"
19 
20 #include "utilities/geometry_utilities.h"
22 
23 namespace Kratos
24 {
27 
28 template <int Dim, int NumNodes>
30 {
31 public:
32  template <unsigned int TNumNodes, unsigned int TDim>
34  {
36  double vol;
37 
40  };
43 
44  typedef Element BaseType;
45  static constexpr int TNumNodes = NumNodes;
46  static constexpr int TDim = Dim;
47 
52 
56 
57  // Constructors.
58 
60 
64 
69  : Element(NewId, ThisNodes){}
70 
74  IncompressiblePotentialFlowElement(IndexType NewId, GeometryType::Pointer pGeometry)
75  : Element(NewId, pGeometry){}
76 
81  GeometryType::Pointer pGeometry,
82  PropertiesType::Pointer pProperties)
83  : Element(NewId, pGeometry, pProperties){}
84 
89 
94 
99 
103 
106 
109 
113 
114  Element::Pointer Create(IndexType NewId,
115  NodesArrayType const& ThisNodes,
116  PropertiesType::Pointer pProperties) const override;
117 
118  Element::Pointer Create(IndexType NewId,
119  GeometryType::Pointer pGeom,
120  PropertiesType::Pointer pProperties) const override;
121 
122  Element::Pointer Clone(IndexType NewId, NodesArrayType const& ThisNodes) const override;
123 
124  void CalculateLocalSystem(MatrixType& rLeftHandSideMatrix,
125  VectorType& rRightHandSideVector,
126  const ProcessInfo& rCurrentProcessInfo) override;
127 
128  void CalculateRightHandSide(VectorType& rRightHandSideVector,
129  const ProcessInfo& rCurrentProcessInfo) override;
130 
131  void CalculateLeftHandSide(MatrixType& rLeftHandSideMatrix,
132  const ProcessInfo& rCurrentProcessInfo) override;
133 
134  void EquationIdVector(EquationIdVectorType& rResult, const ProcessInfo& CurrentProcessInfo) const override;
135 
136  void GetDofList(DofsVectorType& rElementalDofList, const ProcessInfo& rCurrentProcessInfo) const override;
137 
138  void FinalizeSolutionStep(const ProcessInfo& rCurrentProcessInfo) override;
139 
143 
144  void CalculateOnIntegrationPoints(const Variable<double>& rVariable,
145  std::vector<double>& rValues,
146  const ProcessInfo& rCurrentProcessInfo) override;
147 
148  void CalculateOnIntegrationPoints(const Variable<int>& rVariable,
149  std::vector<int>& rValues,
150  const ProcessInfo& rCurrentProcessInfo) override;
151 
153  std::vector<array_1d<double, 3>>& rValues,
154  const ProcessInfo& rCurrentProcessInfo) override;
155 
159 
160  int Check(const ProcessInfo& rCurrentProcessInfo) const override;
161 
165 
167  std::string Info() const override;
168 
170  void PrintInfo(std::ostream& rOStream) const override;
171 
173  void PrintData(std::ostream& rOStream) const override;
174 
176 
177 private:
180 
181  void GetWakeDistances(array_1d<double, NumNodes>& distances) const;
182 
183  void GetEquationIdVectorNormalElement(EquationIdVectorType& rResult) const;
184 
185  void GetEquationIdVectorKuttaElement(EquationIdVectorType& rResult) const;
186 
187  void GetEquationIdVectorWakeElement(EquationIdVectorType& rResult) const;
188 
189  void GetDofListNormalElement(DofsVectorType& rElementalDofList) const;
190 
191  void GetDofListKuttaElement(DofsVectorType& rElementalDofList) const;
192 
193  void GetDofListWakeElement(DofsVectorType& rElementalDofList) const;
194 
195  void CalculateLocalSystemNormalElement(MatrixType& rLeftHandSideMatrix,
196  VectorType& rRightHandSideVector,
197  const ProcessInfo& rCurrentProcessInfo);
198 
199  void CalculateLocalSystemWakeElement(MatrixType& rLeftHandSideMatrix,
200  VectorType& rRightHandSideVector,
201  const ProcessInfo& rCurrentProcessInfo);
202 
203  void CalculateLocalSystemSubdividedElement(BoundedMatrix<double, NumNodes, NumNodes>& lhs_positive,
205  const ProcessInfo& rCurrentProcessInfo);
206 
207  void ComputeLHSGaussPointContribution(const double weight,
209  const ElementalData<NumNodes, Dim>& data) const;
210 
211  void CalculateBlockLeftHandSideWakeElement(BoundedMatrix<double, NumNodes, NumNodes>& rLhs_total,
212  BoundedMatrix<double, NumNodes, NumNodes>& rLhs_wake_condition,
213  const ElementalData<NumNodes, Dim>& rData,
214  const ProcessInfo& rCurrentProcessInfo);
215 
216  void AssignLocalSystemSubdividedElement(MatrixType& rLeftHandSideMatrix,
220  BoundedMatrix<double, NumNodes, NumNodes>& rLhs_wake_condition,
221  const ElementalData<NumNodes, Dim>& data) const;
222 
223  void AssignLocalSystemWakeElement(MatrixType& rLeftHandSideMatrix,
225  BoundedMatrix<double, NumNodes, NumNodes>& rLhs_wake_condition,
226  const ElementalData<NumNodes, Dim>& data) const;
227 
228  void AssignLocalSystemWakeNode(MatrixType& rLeftHandSideMatrix,
230  BoundedMatrix<double, NumNodes, NumNodes>& rLhs_wake_condition,
232  unsigned int& row) const;
233 
234  void ComputeElementInternalEnergy();
235 
239 
240  friend class Serializer;
241 
242  void save(Serializer& rSerializer) const override;
243 
244  void load(Serializer& rSerializer) override;
245 
247 
248 }; // Class IncompressiblePotentialFlowElement
249 
251 } // namespace Kratos.
252 
253 #endif // KRATOS_INCOMPRESSIBLE_POTENTIAL_FLOW_ELEMENT_H defined
Base class for all Elements.
Definition: element.h:60
std::vector< DofType::Pointer > DofsVectorType
Definition: element.h:100
std::vector< std::size_t > EquationIdVectorType
Definition: element.h:98
std::size_t IndexType
Definition: flags.h:74
Definition: incompressible_potential_flow_element.h:30
IncompressiblePotentialFlowElement(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties)
Definition: incompressible_potential_flow_element.h:80
IncompressiblePotentialFlowElement & operator=(IncompressiblePotentialFlowElement &&rOther)=delete
Move operator.
static constexpr int TNumNodes
Definition: incompressible_potential_flow_element.h:45
std::string Info() const override
Turn back information as a string.
Definition: incompressible_potential_flow_element.cpp:260
IncompressiblePotentialFlowElement(IncompressiblePotentialFlowElement const &rOther)=delete
Element::Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, PropertiesType::Pointer pProperties) const override
It creates a new element pointer.
Definition: incompressible_potential_flow_element.cpp:25
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: incompressible_potential_flow_element.cpp:274
IncompressiblePotentialFlowElement(IncompressiblePotentialFlowElement &&rOther)=delete
static constexpr int TDim
Definition: incompressible_potential_flow_element.h:46
void CalculateRightHandSide(VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Definition: incompressible_potential_flow_element.cpp:68
~IncompressiblePotentialFlowElement() override
Definition: incompressible_potential_flow_element.h:98
void GetDofList(DofsVectorType &rElementalDofList, const ProcessInfo &rCurrentProcessInfo) const override
Definition: incompressible_potential_flow_element.cpp:114
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(IncompressiblePotentialFlowElement)
int Check(const ProcessInfo &rCurrentProcessInfo) const override
Definition: incompressible_potential_flow_element.cpp:151
IncompressiblePotentialFlowElement(IndexType NewId, GeometryType::Pointer pGeometry)
Definition: incompressible_potential_flow_element.h:74
IncompressiblePotentialFlowElement & operator=(IncompressiblePotentialFlowElement const &rOther)=delete
Assignment operator.
void CalculateOnIntegrationPoints(const Variable< double > &rVariable, std::vector< double > &rValues, const ProcessInfo &rCurrentProcessInfo) override
Definition: incompressible_potential_flow_element.cpp:178
void FinalizeSolutionStep(const ProcessInfo &rCurrentProcessInfo) override
Definition: incompressible_potential_flow_element.cpp:142
Element::Pointer Clone(IndexType NewId, NodesArrayType const &ThisNodes) const override
It creates a new element pointer and clones the previous element data.
Definition: incompressible_potential_flow_element.cpp:45
void CalculateLocalSystem(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Definition: incompressible_potential_flow_element.cpp:55
void CalculateLeftHandSide(MatrixType &rLeftHandSideMatrix, const ProcessInfo &rCurrentProcessInfo) override
Definition: incompressible_potential_flow_element.cpp:77
IncompressiblePotentialFlowElement(IndexType NewId=0)
Default constuctor.
Definition: incompressible_potential_flow_element.h:63
Element BaseType
Definition: incompressible_potential_flow_element.h:44
IncompressiblePotentialFlowElement(IndexType NewId, const NodesArrayType &ThisNodes)
Definition: incompressible_potential_flow_element.h:68
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: incompressible_potential_flow_element.cpp:268
void EquationIdVector(EquationIdVectorType &rResult, const ProcessInfo &CurrentProcessInfo) const override
Definition: incompressible_potential_flow_element.cpp:86
Definition: amatrix_interface.h:41
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
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
AMatrix::MatrixRow< const TExpressionType > row(AMatrix::MatrixExpression< TExpressionType, TCategory > const &TheExpression, std::size_t RowIndex)
Definition: amatrix_interface.h:649
lhs
Definition: generate_frictional_mortar_condition.py:297
data
Definition: mesh_to_mdpa_converter.py:59
def load(f)
Definition: ode_solve.py:307
Definition: incompressible_potential_flow_element.h:34
array_1d< double, TNumNodes > N
Definition: incompressible_potential_flow_element.h:39
array_1d< double, TNumNodes > potentials
Definition: incompressible_potential_flow_element.h:35
BoundedMatrix< double, TNumNodes, TDim > DN_DX
Definition: incompressible_potential_flow_element.h:38
array_1d< double, TNumNodes > distances
Definition: incompressible_potential_flow_element.h:35
double vol
Definition: incompressible_potential_flow_element.h:36