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_velocity_inlet_condition.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: Suneth Warnakulasuriya
11 //
12 
13 #if !defined(KRATOS_INCOMPRESSIBLE_POTENTIAL_FLOW_VELOCITY_INLET_CONDITION_H_INCLUDED)
14 #define KRATOS_INCOMPRESSIBLE_POTENTIAL_FLOW_VELOCITY_INLET_CONDITION_H_INCLUDED
15 
16 // System includes
17 
18 // External includes
19 
20 // Project includes
21 
22 // Application includes
23 #include "includes/condition.h"
24 
25 namespace Kratos
26 {
31 
38 template <
39  unsigned int TDim,
40  unsigned int TNumNodes = TDim>
42 {
43 public:
46 
49 
51  using NodeType = Node;
55  using VectorType = Vector;
56  using MatrixType = Matrix;
57  using IndexType = std::size_t;
59 
63 
65 
69  IndexType NewId = 0)
70  : BaseType(NewId)
71  {
72  }
73 
75 
80  IndexType NewId,
81  const NodesArrayType& ThisNodes)
82  : BaseType(NewId, ThisNodes)
83  {
84  }
85 
87 
92  IndexType NewId,
93  GeometryType::Pointer pGeometry)
94  : BaseType(NewId, pGeometry)
95  {
96  }
97 
99 
105  IndexType NewId,
106  GeometryType::Pointer pGeometry,
107  PropertiesType::Pointer pProperties)
108  : BaseType(NewId, pGeometry, pProperties)
109  {
110  }
111 
115  : BaseType(rOther)
116  {
117  }
118 
121 
125 
129  {
130  Condition::operator=(rOther);
131  return *this;
132  }
133 
137 
139 
144  Condition::Pointer Create(
145  IndexType NewId,
146  NodesArrayType const& ThisNodes,
147  PropertiesType::Pointer pProperties) const override
148  {
149  return Kratos::make_intrusive<IncompressiblePotentialFlowVelocityInletCondition>(
150  NewId, this->GetGeometry().Create(ThisNodes), pProperties);
151  }
152 
153  Condition::Pointer Create(
154  IndexType NewId,
155  GeometryType::Pointer pGeom,
156  PropertiesType::Pointer pProperties) const override
157  {
158  return Kratos::make_intrusive<IncompressiblePotentialFlowVelocityInletCondition>(
159  NewId, pGeom, pProperties);
160  }
161 
170  Condition::Pointer Clone(
171  IndexType NewId,
172  NodesArrayType const& rThisNodes) const override
173  {
174  Condition::Pointer p_new_condition = Create(
175  NewId, this->GetGeometry().Create(rThisNodes), this->pGetProperties());
176 
177  p_new_condition->SetData(this->GetData());
178  p_new_condition->SetFlags(this->GetFlags());
179 
180  return p_new_condition;
181  }
182 
183  int Check(const ProcessInfo& rCurrentProcessInfo) const override;
184 
185  void Initialize(const ProcessInfo& rCurrentProcessInfo) override;
186 
187  void EquationIdVector(
188  EquationIdVectorType& rResult,
189  const ProcessInfo& rCurrentProcessInfo) const override;
190 
192 
196  void GetDofList(
197  DofsVectorType& ConditionDofList,
198  const ProcessInfo& CurrentProcessInfo) const override;
199 
200  void GetValuesVector(
201  VectorType& rValues,
202  int Step = 0) const override;
203 
205 
207  MatrixType& rLeftHandSideMatrix,
208  VectorType& rRightHandSideVector,
209  const ProcessInfo& rCurrentProcessInfo) override;
210 
212  MatrixType& rLeftHandSideMatrix,
213  const ProcessInfo& rCurrentProcessInfo) override;
214 
216  VectorType& rRightHandSideVector,
217  const ProcessInfo& rCurrentProcessInfo) override;
218 
222 
224  std::string Info() const override;
225 
227  void PrintInfo(std::ostream& rOStream) const override;
228 
230  void PrintData(std::ostream& rOStream) const override;
231 
233 
234 private:
237 
238  friend class Serializer;
239 
240  void save(Serializer& rSerializer) const override;
241 
242  void load(Serializer& rSerializer) override;
243 
245 
246 }; // Class IncompressiblePotentialFlowVelocityInletCondition
247 
251 
253 template <unsigned int TDim, unsigned int TNumNodes>
254 inline std::istream& operator>>(
255  std::istream& rIStream,
257 {
258  return rIStream;
259 }
260 
262 template <unsigned int TDim, unsigned int TNumNodes>
263 inline std::ostream& operator<<(
264  std::ostream& rOStream,
266 {
267  rThis.PrintInfo(rOStream);
268  rOStream << std::endl;
269  rThis.PrintData(rOStream);
270 
271  return rOStream;
272 }
273 
275 
277 
278 } // namespace Kratos.
279 
280 #endif // KRATOS_INCOMPRESSIBLE_POTENTIAL_FLOW_VELOCITY_INLET_CONDITION_H_INCLUDED
Base class for all Conditions.
Definition: condition.h:59
std::vector< std::size_t > EquationIdVectorType
Definition: condition.h:98
std::vector< DofType::Pointer > DofsVectorType
Definition: condition.h:100
Condition & operator=(Condition const &rOther)
Assignment operator.
Definition: condition.h:181
PropertiesType::Pointer pGetProperties()
returns the pointer to the property of the condition. Does not throw an error, to allow copying of co...
Definition: condition.h:964
Condition(IndexType NewId=0)
Definition: condition.h:123
std::size_t IndexType
Definition: flags.h:74
This defines the geometrical object, base definition of the element and condition entities.
Definition: geometrical_object.h:58
Flags & GetFlags()
Returns the flags of the object.
Definition: geometrical_object.h:176
GeometryType & GetGeometry()
Returns the reference of the geometry.
Definition: geometrical_object.h:158
DataValueContainer & GetData()
Definition: geometrical_object.h:212
IntegrationMethod
Definition: geometry_data.h:76
Geometry base class.
Definition: geometry.h:71
GeometryData::ShapeFunctionsGradientsType ShapeFunctionsGradientsType
Definition: geometry.h:189
Definition: incompressible_potential_flow_velocity_inlet_condition.h:42
void CalculateLeftHandSide(MatrixType &rLeftHandSideMatrix, const ProcessInfo &rCurrentProcessInfo) override
Definition: incompressible_potential_flow_velocity_inlet_condition.cpp:135
Matrix MatrixType
Definition: incompressible_potential_flow_velocity_inlet_condition.h:56
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: incompressible_potential_flow_velocity_inlet_condition.cpp:208
std::string Info() const override
Turn back information as a string.
Definition: incompressible_potential_flow_velocity_inlet_condition.cpp:200
Condition::Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, PropertiesType::Pointer pProperties) const override
Create a new IncompressiblePotentialFlowVelocityInletCondition object.
Definition: incompressible_potential_flow_velocity_inlet_condition.h:144
Condition::Pointer Clone(IndexType NewId, NodesArrayType const &rThisNodes) const override
Definition: incompressible_potential_flow_velocity_inlet_condition.h:170
void CalculateLocalSystem(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Definition: incompressible_potential_flow_velocity_inlet_condition.cpp:122
void CalculateRightHandSide(VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Definition: incompressible_potential_flow_velocity_inlet_condition.cpp:151
GeometryData::IntegrationMethod GetIntegrationMethod() const override
Definition: incompressible_potential_flow_velocity_inlet_condition.cpp:116
void GetValuesVector(VectorType &rValues, int Step=0) const override
Definition: incompressible_potential_flow_velocity_inlet_condition.cpp:99
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: incompressible_potential_flow_velocity_inlet_condition.cpp:215
IncompressiblePotentialFlowVelocityInletCondition(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties)
Constructor using Properties.
Definition: incompressible_potential_flow_velocity_inlet_condition.h:104
IncompressiblePotentialFlowVelocityInletCondition(IndexType NewId, const NodesArrayType &ThisNodes)
Constructor using an array of nodes.
Definition: incompressible_potential_flow_velocity_inlet_condition.h:79
IncompressiblePotentialFlowVelocityInletCondition(IndexType NewId, GeometryType::Pointer pGeometry)
Constructor using Geometry.
Definition: incompressible_potential_flow_velocity_inlet_condition.h:91
void EquationIdVector(EquationIdVectorType &rResult, const ProcessInfo &rCurrentProcessInfo) const override
Definition: incompressible_potential_flow_velocity_inlet_condition.cpp:71
int Check(const ProcessInfo &rCurrentProcessInfo) const override
Definition: incompressible_potential_flow_velocity_inlet_condition.cpp:34
void Initialize(const ProcessInfo &rCurrentProcessInfo) override
Definition: incompressible_potential_flow_velocity_inlet_condition.cpp:57
Condition::Pointer Create(IndexType NewId, GeometryType::Pointer pGeom, PropertiesType::Pointer pProperties) const override
It creates a new condition pointer.
Definition: incompressible_potential_flow_velocity_inlet_condition.h:153
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(IncompressiblePotentialFlowVelocityInletCondition)
Pointer definition of IncompressiblePotentialFlowVelocityInletCondition.
IncompressiblePotentialFlowVelocityInletCondition & operator=(IncompressiblePotentialFlowVelocityInletCondition const &rOther)
Assignment operator.
Definition: incompressible_potential_flow_velocity_inlet_condition.h:127
void GetDofList(DofsVectorType &ConditionDofList, const ProcessInfo &CurrentProcessInfo) const override
Returns a list of the element's Dofs.
Definition: incompressible_potential_flow_velocity_inlet_condition.cpp:85
~IncompressiblePotentialFlowVelocityInletCondition() override=default
Destructor.
IncompressiblePotentialFlowVelocityInletCondition(IncompressiblePotentialFlowVelocityInletCondition const &rOther)
Copy constructor.
Definition: incompressible_potential_flow_velocity_inlet_condition.h:113
IncompressiblePotentialFlowVelocityInletCondition(IndexType NewId=0)
Default constructor.
Definition: incompressible_potential_flow_velocity_inlet_condition.h:68
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
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
Internals::Matrix< double, AMatrix::dynamic, 1 > Vector
Definition: amatrix_interface.h:472
Internals::Matrix< double, AMatrix::dynamic, AMatrix::dynamic > Matrix
Definition: amatrix_interface.h:470
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
def load(f)
Definition: ode_solve.py:307