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_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: Suneth Warnakulasuriya
11 //
12 
13 #if !defined(KRATOS_INCOMPRESSIBLE_POTENTIAL_FLOW_VELOCITY_ELEMENT_H_INCLUDED)
14 #define KRATOS_INCOMPRESSIBLE_POTENTIAL_FLOW_VELOCITY_ELEMENT_H_INCLUDED
15 
16 // System includes
17 
18 // External includes
19 
20 // Project includes
21 #include "includes/define.h"
22 
23 // Application includes
25 
26 namespace Kratos
27 {
30 
31 template <unsigned int TDim, unsigned int TNumNodes>
33 : public LaplaceElement<TDim, TNumNodes>
34 {
35 public:
38 
40 
41  using NodeType = Node;
42 
45 
47 
50 
52 
53  using IndexType = std::size_t;
54 
59 
63 
68  IndexType NewId = 0)
69  : BaseType(NewId)
70  {
71  }
72 
77  IndexType NewId,
78  const NodesArrayType& ThisNodes)
79  : BaseType(NewId, ThisNodes)
80  {
81  }
82 
87  IndexType NewId,
88  GeometryType::Pointer pGeometry)
89  : BaseType(NewId, pGeometry)
90  {
91  }
92 
97  IndexType NewId,
98  GeometryType::Pointer pGeometry,
99  PropertiesType::Pointer pProperties)
100  : BaseType(NewId, pGeometry, pProperties)
101  {
102  }
103 
109  : BaseType(rOther)
110  {
111  }
112 
117 
121 
134  Element::Pointer Create(
135  IndexType NewId,
136  NodesArrayType const& ThisNodes,
137  PropertiesType::Pointer pProperties) const override
138  {
139  KRATOS_TRY
140  return Kratos::make_intrusive<IncompressiblePotentialFlowVelocityElement>(
141  NewId, this->GetGeometry().Create(ThisNodes), pProperties);
142  KRATOS_CATCH("");
143  }
144 
152  Element::Pointer Create(
153  IndexType NewId,
154  GeometryType::Pointer pGeom,
155  PropertiesType::Pointer pProperties) const override
156  {
157  KRATOS_TRY
158  return Kratos::make_intrusive<IncompressiblePotentialFlowVelocityElement>(
159  NewId, pGeom, pProperties);
160  KRATOS_CATCH("");
161  }
162 
170  Element::Pointer Clone(
171  IndexType NewId,
172  NodesArrayType const& ThisNodes) const override
173  {
174  KRATOS_TRY
175  return Kratos::make_intrusive<IncompressiblePotentialFlowVelocityElement>(
176  NewId, this->GetGeometry().Create(ThisNodes), this->pGetProperties());
177  KRATOS_CATCH("");
178  }
179 
180  const Variable<double>& GetVariable() const override;
181 
183  const Variable<array_1d<double, 3>>& rVariable,
184  std::vector<array_1d<double, 3>>& rValues,
185  const ProcessInfo& rCurrentProcessInfo) override;
186 
190 
192  std::string Info() const override
193  {
194  std::stringstream buffer;
195  buffer << "IncompressiblePotentialFlowVelocityElement #" << this->Id();
196  return buffer.str();
197  }
199  void PrintInfo(std::ostream& rOStream) const override
200  {
201  rOStream << "IncompressiblePotentialFlowVelocityElement #" << this->Id();
202  }
203 
205 
206 private:
209 
210  friend class Serializer;
211 
212  void save(Serializer& rSerializer) const override
213  {
214  KRATOS_TRY
215 
217 
218  KRATOS_CATCH("");
219  }
220  void load(Serializer& rSerializer) override
221  {
222  KRATOS_TRY
223 
225 
226  KRATOS_CATCH("");
227  }
228 
230 }; // Class IncompressiblePotentialFlowVelocityElement
231 
235 
236 template <unsigned int TDim, unsigned int TNumNodes>
237 inline std::istream& operator>>(
238  std::istream& rIStream,
240 
242 template <unsigned int TDim, unsigned int TNumNodes>
243 inline std::ostream& operator<<(
244  std::ostream& rOStream,
246 {
247  rThis.PrintInfo(rOStream);
248  rOStream << " : " << std::endl;
249  rThis.PrintData(rOStream);
250  return rOStream;
251 }
252 
254 
255 } // namespace Kratos.
256 
257 #endif // KRATOS_INCOMPRESSIBLE_POTENTIAL_FLOW_VELOCITY_ELEMENT_H_INCLUDED defined
Base class for all Elements.
Definition: element.h:60
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: element.h:1135
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
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
Geometry base class.
Definition: geometry.h:71
PointerVector< TPointType > PointsArrayType
Definition: geometry.h:118
GeometryData::ShapeFunctionsGradientsType ShapeFunctionsGradientsType
Definition: geometry.h:189
Definition: incompressible_potential_flow_velocity_element.h:34
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: incompressible_potential_flow_velocity_element.h:199
void CalculateOnIntegrationPoints(const Variable< array_1d< double, 3 >> &rVariable, std::vector< array_1d< double, 3 >> &rValues, const ProcessInfo &rCurrentProcessInfo) override
Definition: incompressible_potential_flow_velocity_element.cpp:32
IncompressiblePotentialFlowVelocityElement(IndexType NewId=0)
Definition: incompressible_potential_flow_velocity_element.h:67
std::string Info() const override
Turn back information as a string.
Definition: incompressible_potential_flow_velocity_element.h:192
Element::Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, PropertiesType::Pointer pProperties) const override
Definition: incompressible_potential_flow_velocity_element.h:134
Element::Pointer Create(IndexType NewId, GeometryType::Pointer pGeom, PropertiesType::Pointer pProperties) const override
Definition: incompressible_potential_flow_velocity_element.h:152
IncompressiblePotentialFlowVelocityElement(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties)
Definition: incompressible_potential_flow_velocity_element.h:96
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(IncompressiblePotentialFlowVelocityElement)
Element::Pointer Clone(IndexType NewId, NodesArrayType const &ThisNodes) const override
Definition: incompressible_potential_flow_velocity_element.h:170
IncompressiblePotentialFlowVelocityElement(IndexType NewId, GeometryType::Pointer pGeometry)
Definition: incompressible_potential_flow_velocity_element.h:86
IncompressiblePotentialFlowVelocityElement(IndexType NewId, const NodesArrayType &ThisNodes)
Definition: incompressible_potential_flow_velocity_element.h:76
const Variable< double > & GetVariable() const override
Definition: incompressible_potential_flow_velocity_element.cpp:71
IncompressiblePotentialFlowVelocityElement(IncompressiblePotentialFlowVelocityElement const &rOther)
Definition: incompressible_potential_flow_velocity_element.h:107
IndexType Id() const
Definition: indexed_object.h:107
Definition: amatrix_interface.h:41
Definition: laplace_element.h:33
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
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
#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
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