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_perturbation_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_PERTURBATION_POTENTIAL_FLOW_ELEMENT_H)
14 #define KRATOS_INCOMPRESSIBLE_PERTURBATION_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  IncompressiblePerturbationPotentialFlowElement(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 
141 
142  void CalculateOnIntegrationPoints(const Variable<double>& rVariable,
143  std::vector<double>& rValues,
144  const ProcessInfo& rCurrentProcessInfo) override;
145 
146  void CalculateOnIntegrationPoints(const Variable<int>& rVariable,
147  std::vector<int>& rValues,
148  const ProcessInfo& rCurrentProcessInfo) override;
149 
151  std::vector<array_1d<double, 3>>& rValues,
152  const ProcessInfo& rCurrentProcessInfo) override;
153 
157 
158  int Check(const ProcessInfo& rCurrentProcessInfo) const override;
159 
163 
165  std::string Info() const override;
166 
168  void PrintInfo(std::ostream& rOStream) const override;
169 
171  void PrintData(std::ostream& rOStream) const override;
172 
174 
175 private:
178 
179  void GetEquationIdVectorNormalElement(EquationIdVectorType& rResult) const;
180 
181  void GetEquationIdVectorKuttaElement(EquationIdVectorType& rResult) const;
182 
183  void GetEquationIdVectorWakeElement(EquationIdVectorType& rResult) const;
184 
185  void GetDofListNormalElement(DofsVectorType& rElementalDofList) const;
186 
187  void GetDofListKuttaElement(DofsVectorType& rElementalDofList) const;
188 
189  void GetDofListWakeElement(DofsVectorType& rElementalDofList) const;
190 
191  void CalculateLeftHandSideNormalElement(MatrixType& rLeftHandSideMatrix,
192  const ProcessInfo& rCurrentProcessInfo);
193 
194  void CalculateRightHandSideNormalElement(VectorType& rRightHandSideVector,
195  const ProcessInfo& rCurrentProcessInfo);
196 
197  void CalculateLeftHandSideWakeElement(MatrixType& rLeftHandSideMatrix,
198  const ProcessInfo& rCurrentProcessInfo);
199 
200  void CalculateBlockLeftHandSideWakeElement(BoundedMatrix<double, NumNodes, NumNodes>& rLhs_total,
201  BoundedMatrix<double, NumNodes, NumNodes>& rLhs_wake_condition,
202  const ElementalData<NumNodes, Dim>& rData,
203  const ProcessInfo& rCurrentProcessInfo);
204 
205  void CalculateRightHandSideWakeElement(VectorType& rRightHandSideVector,
206  const ProcessInfo& rCurrentProcessInfo);
207 
208  BoundedVector<double, NumNodes> CalculateRightHandSideWakeCondition(const ElementalData<NumNodes, Dim>& rData,
209  const ProcessInfo& rCurrentProcessInfo,
210  const array_1d<double, Dim>& rDiff_velocity);
211 
212  void CalculateLeftHandSideSubdividedElement(BoundedMatrix<double, NumNodes, NumNodes>& lhs_positive,
214  const ProcessInfo& rCurrentProcessInfo);
215 
216  void CalculateVolumesSubdividedElement(double& rUpper_vol,
217  double& rLower_vol,
218  const ProcessInfo& rCurrentProcessInfo);
219 
220  void ComputeLHSGaussPointContribution(const double weight,
222  const ElementalData<NumNodes, Dim>& data) const;
223 
224  void AssignLeftHandSideSubdividedElement(MatrixType& rLeftHandSideMatrix,
228  BoundedMatrix<double, NumNodes, NumNodes>& rLhs_wake_condition,
229  const ElementalData<NumNodes, Dim>& data) const;
230 
231  void AssignLeftHandSideWakeElement(MatrixType& rLeftHandSideMatrix,
233  BoundedMatrix<double, NumNodes, NumNodes>& rLhs_wake_condition,
234  const ElementalData<NumNodes, Dim>& data) const;
235 
236  void AssignLeftHandSideWakeNode(MatrixType& rLeftHandSideMatrix,
238  BoundedMatrix<double, NumNodes, NumNodes>& rLhs_wake_condition,
240  unsigned int& row) const;
241 
242  void AssignRightHandSideWakeNode(VectorType& rRightHandSideVector,
243  const BoundedVector<double, NumNodes>& rUpper_rhs,
244  const BoundedVector<double, NumNodes>& rLower_rhs,
245  const BoundedVector<double, NumNodes>& rWake_rhs,
246  const ElementalData<NumNodes, Dim>& rData,
247  unsigned int& rRow) const;
248 
252 
253  friend class Serializer;
254 
255  void save(Serializer& rSerializer) const override;
256 
257  void load(Serializer& rSerializer) override;
258 
260 
261 }; // Class IncompressiblePerturbationPotentialFlowElement
262 
264 } // namespace Kratos.
265 
266 #endif // KRATOS_INCOMPRESSIBLE_PERTURBATION_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_perturbation_potential_flow_element.h:30
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: incompressible_perturbation_potential_flow_element.cpp:273
IncompressiblePerturbationPotentialFlowElement(IndexType NewId, const NodesArrayType &ThisNodes)
Definition: incompressible_perturbation_potential_flow_element.h:68
IncompressiblePerturbationPotentialFlowElement(IndexType NewId, GeometryType::Pointer pGeometry)
Definition: incompressible_perturbation_potential_flow_element.h:74
IncompressiblePerturbationPotentialFlowElement(IncompressiblePerturbationPotentialFlowElement &&rOther)=delete
std::string Info() const override
Turn back information as a string.
Definition: incompressible_perturbation_potential_flow_element.cpp:259
IncompressiblePerturbationPotentialFlowElement & operator=(IncompressiblePerturbationPotentialFlowElement const &rOther)=delete
Assignment operator.
IncompressiblePerturbationPotentialFlowElement(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties)
Definition: incompressible_perturbation_potential_flow_element.h:80
IncompressiblePerturbationPotentialFlowElement(IncompressiblePerturbationPotentialFlowElement const &rOther)=delete
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(IncompressiblePerturbationPotentialFlowElement)
Element BaseType
Definition: incompressible_perturbation_potential_flow_element.h:44
int Check(const ProcessInfo &rCurrentProcessInfo) const override
Definition: incompressible_perturbation_potential_flow_element.cpp:148
Element::Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, PropertiesType::Pointer pProperties) const override
It creates a new element pointer.
Definition: incompressible_perturbation_potential_flow_element.cpp:25
void GetDofList(DofsVectorType &rElementalDofList, const ProcessInfo &rCurrentProcessInfo) const override
Definition: incompressible_perturbation_potential_flow_element.cpp:117
~IncompressiblePerturbationPotentialFlowElement() override
Definition: incompressible_perturbation_potential_flow_element.h:98
void EquationIdVector(EquationIdVectorType &rResult, const ProcessInfo &CurrentProcessInfo) const override
Definition: incompressible_perturbation_potential_flow_element.cpp:89
Element::Pointer Clone(IndexType NewId, NodesArrayType const &ThisNodes) const override
It creates a new element pointer and clones the previous element data.
Definition: incompressible_perturbation_potential_flow_element.cpp:45
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: incompressible_perturbation_potential_flow_element.cpp:267
static constexpr int TDim
Definition: incompressible_perturbation_potential_flow_element.h:46
void CalculateLeftHandSide(MatrixType &rLeftHandSideMatrix, const ProcessInfo &rCurrentProcessInfo) override
Definition: incompressible_perturbation_potential_flow_element.cpp:76
void CalculateOnIntegrationPoints(const Variable< double > &rVariable, std::vector< double > &rValues, const ProcessInfo &rCurrentProcessInfo) override
Definition: incompressible_perturbation_potential_flow_element.cpp:175
void CalculateLocalSystem(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Definition: incompressible_perturbation_potential_flow_element.cpp:55
static constexpr int TNumNodes
Definition: incompressible_perturbation_potential_flow_element.h:45
IncompressiblePerturbationPotentialFlowElement(IndexType NewId=0)
Default constuctor.
Definition: incompressible_perturbation_potential_flow_element.h:63
void CalculateRightHandSide(VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Definition: incompressible_perturbation_potential_flow_element.cpp:63
IncompressiblePerturbationPotentialFlowElement & operator=(IncompressiblePerturbationPotentialFlowElement &&rOther)=delete
Move operator.
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_perturbation_potential_flow_element.h:34
array_1d< double, TNumNodes > distances
Definition: incompressible_perturbation_potential_flow_element.h:35
array_1d< double, TNumNodes > potentials
Definition: incompressible_perturbation_potential_flow_element.h:35
array_1d< double, TNumNodes > N
Definition: incompressible_perturbation_potential_flow_element.h:39
BoundedMatrix< double, TNumNodes, TDim > DN_DX
Definition: incompressible_perturbation_potential_flow_element.h:38
double vol
Definition: incompressible_perturbation_potential_flow_element.h:36