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.
mesh_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: Vicente Mataix Ferrandiz
11 //
12 
13 #pragma once
14 
15 // System includes
16 
17 // External includes
18 
19 // Project includes
20 #include "includes/element.h"
21 
22 namespace Kratos
23 {
38 
46  : public Element
47 {
48 public:
49 
52 
54  typedef Element BaseType;
55 
58 
61 
64 
67 
70 
73 
76 
78 
79 public:
80 
83 
88  MeshElement(IndexType NewId = 0);
89 
96  IndexType NewId,
97  const NodesArrayType& rThisNodes
98  );
99 
105  MeshElement(
106  IndexType NewId,
107  GeometryType::Pointer pGeometry
108  );
109 
116  MeshElement(
117  IndexType NewId,
118  GeometryType::Pointer pGeometry,
119  PropertiesType::Pointer pProperties
120  );
121 
123  MeshElement(MeshElement const& rOther);
124 
126  ~MeshElement() override;
127 
131 
133  MeshElement& operator=(MeshElement const& rOther);
134 
138 
146  Element::Pointer Create(
147  IndexType NewId,
148  NodesArrayType const& ThisNodes,
149  PropertiesType::Pointer pProperties
150  ) const override;
151 
159  Element::Pointer Create(
160  IndexType NewId,
161  GeometryType::Pointer pGeom,
162  PropertiesType::Pointer pProperties
163  ) const override;
164 
172  Element::Pointer Clone (
173  IndexType NewId,
174  NodesArrayType const& ThisNodes
175  ) const override;
176 
186  const VectorType& rRHSVector,
187  const Variable<VectorType>& rRHSVariable,
188  const Variable<double >& rDestinationVariable,
189  const ProcessInfo& rCurrentProcessInfo
190  ) override;
191 
201  const VectorType& rRHS,
202  const Variable<VectorType>& rRHSVariable,
203  const Variable<array_1d<double,3> >& rDestinationVariable,
204  const ProcessInfo& rCurrentProcessInfo
205  ) override;
206 
216  const MatrixType& rLHSMatrix,
217  const Variable<MatrixType>& rLHSVariable,
218  const Variable<Matrix>& rDestinationVariable,
219  const ProcessInfo& rCurrentProcessInfo
220  ) override;
221 
229  const Variable<bool>& rVariable,
230  std::vector<bool>& rOutput,
231  const ProcessInfo& rCurrentProcessInfo
232  ) override;
233 
241  const Variable<int>& rVariable,
242  std::vector<int>& rOutput,
243  const ProcessInfo& rCurrentProcessInfo
244  ) override;
245 
253  const Variable<double>& rVariable,
254  std::vector<double>& rOutput,
255  const ProcessInfo& rCurrentProcessInfo
256  ) override;
257 
265  const Variable<array_1d<double, 3 > >& rVariable,
266  std::vector< array_1d<double, 3 > >& rOutput,
267  const ProcessInfo& rCurrentProcessInfo
268  ) override;
269 
277  const Variable<array_1d<double, 6 > >& rVariable,
278  std::vector< array_1d<double, 6 > >& rOutput,
279  const ProcessInfo& rCurrentProcessInfo
280  ) override;
281 
289  const Variable<Vector >& rVariable,
290  std::vector< Vector >& rOutput,
291  const ProcessInfo& rCurrentProcessInfo
292  ) override;
293 
301  const Variable<Matrix >& rVariable,
302  std::vector< Matrix >& rOutput,
303  const ProcessInfo& rCurrentProcessInfo
304  ) override;
305 
313  const Variable<ConstitutiveLaw::Pointer>& rVariable,
314  std::vector<ConstitutiveLaw::Pointer>& rOutput,
315  const ProcessInfo& rCurrentProcessInfo
316  ) override;
317 
321 
327  const Parameters GetSpecifications() const override;
328 
330  std::string Info() const override
331  {
332  std::stringstream buffer;
333  buffer << "Geometrical Element #" << Id();
334  return buffer.str();
335  }
336 
338 
339  void PrintInfo(std::ostream& rOStream) const override
340  {
341  rOStream << "Geometrical Element #" << Id();
342  }
343 
345  void PrintData(std::ostream& rOStream) const override
346  {
347  pGetGeometry()->PrintData(rOStream);
348  }
349 
351 
352 private:
353 
356  friend class Serializer;
357 
358  void save(Serializer& rSerializer) const override;
359 
360  void load(Serializer& rSerializer) override;
361 
363 
364 }; // Class MeshElement
365 
373 
374 } // namespace Kratos.
Base class for all Elements.
Definition: element.h:60
std::size_t SizeType
Definition: element.h:94
std::size_t IndexType
Definition: element.h:92
std::size_t IndexType
Definition: flags.h:74
GeometryType::Pointer pGetGeometry()
Returns the pointer to the geometry.
Definition: geometrical_object.h:140
Geometry base class.
Definition: geometry.h:71
IndexType Id() const
Definition: indexed_object.h:107
This is pure geometric element. The only purpose for this definition is to create dummy elements.
Definition: mesh_element.h:47
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: mesh_element.h:345
void CalculateOnIntegrationPoints(const Variable< bool > &rVariable, std::vector< bool > &rOutput, const ProcessInfo &rCurrentProcessInfo) override
Calculate a boolean Variable on the Element integration points.
Definition: mesh_element.cpp:170
BaseType::IndexType IndexType
Dfinition of the index type.
Definition: mesh_element.h:57
BaseType::SizeType SizeType
Definition of the size type.
Definition: mesh_element.h:60
MeshElement & operator=(MeshElement const &rOther)
Assignment operator.
Definition: mesh_element.cpp:76
MeshElement(IndexType NewId=0)
Constructor.
Definition: mesh_element.cpp:22
void AddExplicitContribution(const VectorType &rRHSVector, const Variable< VectorType > &rRHSVariable, const Variable< double > &rDestinationVariable, const ProcessInfo &rCurrentProcessInfo) override
This function is designed to make the element to assemble an rRHS vector identified by a variable rRH...
Definition: mesh_element.cpp:134
Element BaseType
We define the base class Element.
Definition: mesh_element.h:54
~MeshElement() override
Destructor.
Definition: mesh_element.cpp:69
BaseType::NodeType NodeType
Definition of the node type.
Definition: mesh_element.h:63
Element::Pointer Clone(IndexType NewId, NodesArrayType const &ThisNodes) const override
Creates a new element pointer and clones the previous element data.
Definition: mesh_element.cpp:116
Element::Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, PropertiesType::Pointer pProperties) const override
Creates a new element pointer.
Definition: mesh_element.cpp:88
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(MeshElement)
Counted pointer of MeshElement.
const Parameters GetSpecifications() const override
This method provides the specifications/requirements of the element.
Definition: mesh_element.cpp:306
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: mesh_element.h:339
BaseType::GeometryType GeometryType
Definition of the geometry type with given NodeType.
Definition: mesh_element.h:69
BaseType::PropertiesType PropertiesType
Definition of the properties type.
Definition: mesh_element.h:66
std::string Info() const override
Turn back information as a string.
Definition: mesh_element.h:330
BaseType::NodesArrayType NodesArrayType
Definition of nodes container type, redefined from GeometryType.
Definition: mesh_element.h:72
This class defines the node.
Definition: node.h:65
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
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
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
def load(f)
Definition: ode_solve.py:307