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.
edge_based_gradient_recovery_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: Ruben Zorrilla
11 //
12 //
13 
14 #if !defined(KRATOS_EDGE_BASED_GRADIENT_RECOVIERY_ELEMENT_H_INCLUDED )
15 #define KRATOS_EDGE_BASED_GRADIENT_RECOVIERY_ELEMENT_H_INCLUDED
16 
17 // System includes
18 
19 
20 // External includes
21 
22 
23 // Project includes
24 #include "includes/define.h"
25 #include "includes/element.h"
26 
27 namespace Kratos
28 {
29 
32 
35 
39 
43 
47 
51 
53 
64 template<std::size_t TDim>
65 class KRATOS_API(KRATOS_CORE) EdgeBasedGradientRecoveryElement : public Element
66 {
67 public:
70 
73 
75  constexpr static std::size_t NumNodes = 2;
76 
78  constexpr static std::size_t BlockSize = TDim;
79 
81  constexpr static std::size_t LocalSize = NumNodes * BlockSize;
82 
84  using NodeType = Node;
85 
88 
91 
93  using VectorType = Vector;
94 
96  using MatrixType = Matrix;
97 
103 
107 
108  //Constructors.
109 
111 
115  : Element(NewId)
116  {}
117 
119 
124  IndexType NewId,
125  const NodesArrayType& ThisNodes)
126  : Element(NewId, ThisNodes)
127  {}
128 
130 
135  IndexType NewId,
136  GeometryType::Pointer pGeometry)
137  : Element(NewId, pGeometry)
138  {}
139 
141 
147  IndexType NewId,
148  GeometryType::Pointer pGeometry,
149  PropertiesType::Pointer pProperties)
150  : Element(NewId, pGeometry, pProperties)
151  {}
152 
154  ~EdgeBasedGradientRecoveryElement() override = default;
155 
159 
160 
164 
166 
173  Element::Pointer Create(
174  IndexType NewId,
175  NodesArrayType const& ThisNodes,
176  PropertiesType::Pointer pProperties) const override
177  {
178  return Kratos::make_intrusive<EdgeBasedGradientRecoveryElement<TDim>>(NewId, GetGeometry().Create(ThisNodes), pProperties);
179  }
180 
188  void CalculateLocalSystem(
189  MatrixType& rLeftHandSideMatrix,
190  VectorType& rRightHandSideVector,
191  const ProcessInfo& rCurrentProcessInfo) override;
192 
199  void CalculateLeftHandSide(
200  MatrixType &rLeftHandSideMatrix,
201  const ProcessInfo &rCurrentProcessInfo) override;
202 
209  void CalculateRightHandSide(
210  VectorType &rRightHandSideVector,
211  const ProcessInfo &rCurrentProcessInfo) override;
212 
222  int Check(const ProcessInfo &rCurrentProcessInfo) const override;
223 
231  EquationIdVectorType& rResult,
232  const ProcessInfo& rCurrentProcessInfo) const override;
233 
241  DofsVectorType& rElementalDofList,
242  const ProcessInfo& rCurrentProcessInfo) const override;
243 
247 
251 
252 
256 
257 
261 
263  std::string Info() const override
264  {
265  std::stringstream buffer;
266  buffer << "EdgeBasedGradientRecoveryElement #" << Id();
267  return buffer.str();
268  }
269 
271  void PrintInfo(std::ostream& rOStream) const override
272  {
273  rOStream << "EdgeBasedGradientRecoveryElement";
274  }
275 
277  virtual void PrintData(std::ostream& rOStream) const override
278  {}
279 
283 
284 
286 protected:
289 
290 
294 
295 
299 
300 
304 
305 
309 
310 
314 
315 
319 
320 
322 private:
325 
326 
330 
331 
335 
336  friend class Serializer;
337 
338  void save(Serializer& rSerializer) const override
339  {
341  }
342 
343  void load(Serializer& rSerializer) override
344  {
346  }
347 
351 
352 
356 
357 
361 
362 
366 
367 
371 
373  EdgeBasedGradientRecoveryElement & operator=(EdgeBasedGradientRecoveryElement const& rOther) = delete;
374 
376  EdgeBasedGradientRecoveryElement(EdgeBasedGradientRecoveryElement const& rOther) = delete;
377 
379 
380 }; // Class EdgeBasedGradientRecoveryElement
381 
383 
386 
387 
391 
393 template<std::size_t TDim>
394 inline std::istream &operator>>(
395  std::istream &rIStream,
397 {
398  return rIStream;
399 }
400 
402 template<std::size_t TDim>
403 inline std::ostream &operator<<(
404  std::ostream &rOStream,
406 {
407  rThis.PrintInfo(rOStream);
408  rOStream << std::endl;
409  rThis.PrintData(rOStream);
410 
411  return rOStream;
412 }
414 
416 
417 } // namespace Kratos.
418 
419 #endif // KRATOS_EDGE_BASED_GRADIENT_RECOVIERY_ELEMENT_H_INCLUDED defined
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
An element to compute the a nodal variable from an embedded skin.
Definition: edge_based_gradient_recovery_element.h:66
EdgeBasedGradientRecoveryElement(IndexType NewId, GeometryType::Pointer pGeometry)
Constructor using a geometry object.
Definition: edge_based_gradient_recovery_element.h:134
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: edge_based_gradient_recovery_element.h:271
void EquationIdVector(EquationIdVectorType &rResult, const ProcessInfo &rCurrentProcessInfo) const override
Provides the global indices for each one of this element's local rows This determines the elemental e...
~EdgeBasedGradientRecoveryElement() override=default
Destructor.
Element::EquationIdVectorType EquationIdVectorType
Definition: edge_based_gradient_recovery_element.h:102
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(EdgeBasedGradientRecoveryElement)
Pointer definition of EdgeBasedGradientRecoveryElement.
Element::Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, PropertiesType::Pointer pProperties) const override
Create a new element of this type.
Definition: edge_based_gradient_recovery_element.h:173
std::string Info() const override
Turn back information as a string.
Definition: edge_based_gradient_recovery_element.h:263
virtual void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: edge_based_gradient_recovery_element.h:277
void GetDofList(DofsVectorType &rElementalDofList, const ProcessInfo &rCurrentProcessInfo) const override
Get the Dof List object Returns a list of the element's Dofs.
EdgeBasedGradientRecoveryElement(IndexType NewId, const NodesArrayType &ThisNodes)
Constructor using an array of nodes.
Definition: edge_based_gradient_recovery_element.h:123
EdgeBasedGradientRecoveryElement(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties)
Constuctor using geometry and properties.
Definition: edge_based_gradient_recovery_element.h:146
EdgeBasedGradientRecoveryElement(IndexType NewId=0)
Default constuctor.
Definition: edge_based_gradient_recovery_element.h:114
Element::DofsVectorType DofsVectorType
Definition: edge_based_gradient_recovery_element.h:101
Base class for all Elements.
Definition: element.h:60
PointerVectorSet< DofType > DofsArrayType
Definition: element.h:102
std::vector< DofType::Pointer > DofsVectorType
Definition: element.h:100
std::vector< std::size_t > EquationIdVectorType
Definition: element.h:98
std::size_t IndexType
Definition: element.h:92
std::size_t IndexType
Definition: flags.h:74
Geometry base class.
Definition: geometry.h:71
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
A sorted associative container similar to an STL set, but uses a vector to store pointers to its data...
Definition: pointer_vector_set.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
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
Matrix MatrixType
Definition: geometrical_transformation_utilities.h:55
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