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.
calculate_velocity_laplacian_component.h
Go to the documentation of this file.
1 //
2 // Project Name: Kratos
3 // Last Modified by: $Author: gcasas $
4 // Date: $Date: 2016-03-12
5 //
6 
7 #if !defined(KRATOS_COMPUTE_VELOCITY_LAPLACIAN_COMPONENT_SIMPLEX_ELEMENT_H_INCLUDED )
8 #define KRATOS_COMPUTE_VELOCITY_LAPLACIAN_COMPONENT_SIMPLEX_ELEMENT_H_INCLUDED
9 
10 // System includes
11 #include <string>
12 #include <iostream>
13 
14 
15 // External includes
16 
17 
18 // Project includes
19 #include "containers/array_1d.h"
20 #include "includes/define.h"
21 #include "includes/element.h"
22 #include "includes/serializer.h"
23 #include "geometries/geometry.h"
24 #include "utilities/math_utils.h"
25 #include "utilities/geometry_utilities.h"
26 
27 // Application includes
28 #include "includes/variables.h"
31 
32 namespace Kratos
33 {
34 
37 
40 
44 
48 
52 
56 
58 
60 template< unsigned int TDim,
61  unsigned int TNumNodes = TDim + 1 >
62 class KRATOS_API(SWIMMING_DEM_APPLICATION) ComputeVelocityLaplacianComponentSimplex : public ComputeMaterialDerivativeSimplex<TDim, TNumNodes>
63 {
64 public:
67 
70 
72 
74  typedef Node NodeType;
75 
78 
81 
83  typedef Vector VectorType;
84 
86  typedef Matrix MatrixType;
87 
89 
90  typedef std::size_t IndexType;
91 
92  typedef std::size_t SizeType;
93 
94  typedef std::vector<std::size_t> EquationIdVectorType;
95 
96  typedef std::vector< Dof<double>::Pointer > DofsVectorType;
97 
99 
102 
105 
108 
112 
113  //Constructors.
114 
116 
120  BaseType(NewId), mCurrentComponent('X')
121  {}
122 
124 
129  BaseType(NewId, ThisNodes), mCurrentComponent('X')
130  {}
131 
133 
137  ComputeVelocityLaplacianComponentSimplex(IndexType NewId, GeometryType::Pointer pGeometry) :
138  BaseType(NewId, pGeometry), mCurrentComponent('X')
139  {}
140 
142 
147  ComputeVelocityLaplacianComponentSimplex(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties) :
148  BaseType(NewId, pGeometry, pProperties), mCurrentComponent('X')
149  {}
150 
153  {}
154 
155 
159 
160 
164 
166 
173  Element::Pointer Create(IndexType NewId, NodesArrayType const& ThisNodes,
174  PropertiesType::Pointer pProperties) const override
175  {
176  return Element::Pointer(new ComputeVelocityLaplacianComponentSimplex(NewId, this->GetGeometry().Create(ThisNodes), pProperties));
177  }
178 
180  virtual void CalculateLocalSystem(MatrixType& rLeftHandSideMatrix,
181  VectorType& rRightHandSideVector,
182  const ProcessInfo& rCurrentProcessInfo) override;
183 
184 
186 
192  virtual void EquationIdVector(EquationIdVectorType& rResult, const ProcessInfo& rCurrentProcessInfo) const override;
193 
195 
199  virtual void GetDofList(DofsVectorType& rElementalDofList, const ProcessInfo& rCurrentProcessInfo) const override;
200 
204 
208 
210 
218  virtual int Check(const ProcessInfo& rCurrentProcessInfo) const override;
219 
223 
224 
228 
230  virtual std::string Info() const override
231  {
232  std::stringstream buffer;
233  buffer << "ComputeVelocityLaplacianComponentSimplex #" << this->Id();
234  return buffer.str();
235  }
236 
238  virtual void PrintInfo(std::ostream& rOStream) const override
239  {
240  rOStream << "ComputeVelocityLaplacianComponentSimplex" << TDim << "D";
241  }
242 
243 // /// Print object's data.
244 // virtual void PrintData(std::ostream& rOStream) const;
245 
249 
250 
252 
253 protected:
256 
257 
262 
263  void CalculateMassMatrix(MatrixType& rMassMatrix, const ProcessInfo& rCurrentProcessInfo) override;
264 
265  void CalculateLumpedMassMatrix(MatrixType& rLHSMatrix, const double Mass) override;
266 
267  void AddConsistentMassMatrixContribution(MatrixType& rLHSMatrix, const array_1d<double,TNumNodes>& rShapeFunc, const double Weight) override;
268 
272 
273 
277 
278 
282 
283 
287 
288 
292 
293 
295 
296 private:
299 
303 
307 
308  friend class Serializer;
309 
313 
314  void AddIntegrationPointRHSContribution(VectorType& F,
315  const array_1d<double,TNumNodes>& rShapeFunc,
316  const BoundedMatrix<double, TNumNodes, TDim>& rShapeDeriv,
317  const double Weight) override;
318 
319 // Variable<array_1d<double, 3> > GetCurrentVariable();
320 
324 
325 
329 
330 
334 
335 
339 
342 
345 
347 
348 }; // Class ComputeVelocityLaplacianComponentSimplex
349 
351 
354 
355 
359 
360 
362 template< unsigned int TDim >
363 inline std::istream& operator >>(std::istream& rIStream,
365 {
366  return rIStream;
367 }
368 
370 template< unsigned int TDim >
371 inline std::ostream& operator <<(std::ostream& rOStream,
373 {
374  rThis.PrintInfo(rOStream);
375  rOStream << std::endl;
376  rThis.PrintData(rOStream);
377 
378  return rOStream;
379 }
381 
383 
384 } // namespace Kratos.
385 
386 #endif // KRATOS_COMPUTE_VELOCITY_LAPLACIAN_COMPONENT_SIMPLEX_ELEMENT_H_INCLUDED defined
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
A post-processing element to recover the Laplacian from the velocity solution.
Definition: calculate_mat_deriv_simplex_element.h:62
A post-processing element to recover the Laplacian from the velocity solution.
Definition: calculate_velocity_laplacian_component.h:63
virtual void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: calculate_velocity_laplacian_component.h:238
GeometryType::ShapeFunctionsGradientsType ShapeFunctionDerivativesArrayType
Type for an array of shape function gradient matrices.
Definition: calculate_velocity_laplacian_component.h:107
virtual std::string Info() const override
Turn back information as a string.
Definition: calculate_velocity_laplacian_component.h:230
ComputeVelocityLaplacianComponentSimplex(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties)
Constuctor using geometry and properties.
Definition: calculate_velocity_laplacian_component.h:147
std::size_t IndexType
Definition: calculate_velocity_laplacian_component.h:90
Element::Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, PropertiesType::Pointer pProperties) const override
Create a new element of this type.
Definition: calculate_velocity_laplacian_component.h:173
ComputeVelocityLaplacianComponentSimplex(IndexType NewId, GeometryType::Pointer pGeometry)
Constructor using a geometry object.
Definition: calculate_velocity_laplacian_component.h:137
Kratos::Matrix ShapeFunctionDerivativesType
Type for a matrix containing the shape function gradients.
Definition: calculate_velocity_laplacian_component.h:104
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(ComputeVelocityLaplacianComponentSimplex)
Pointer definition of ComputeVelocityLaplacianComponentSimplex.
char mCurrentComponent
Definition: calculate_velocity_laplacian_component.h:261
Vector VectorType
Vector type for local contributions to the linear system.
Definition: calculate_velocity_laplacian_component.h:83
virtual ~ComputeVelocityLaplacianComponentSimplex()
Destructor.
Definition: calculate_velocity_laplacian_component.h:152
std::size_t SizeType
Definition: calculate_velocity_laplacian_component.h:92
Kratos::Vector ShapeFunctionsType
Type for shape function values container.
Definition: calculate_velocity_laplacian_component.h:101
Matrix MatrixType
Matrix type for local contributions to the linear system.
Definition: calculate_velocity_laplacian_component.h:86
ComputeMaterialDerivativeSimplex< TDim, TNumNodes > BaseType
Definition: calculate_velocity_laplacian_component.h:71
Properties PropertiesType
Definition: calculate_velocity_laplacian_component.h:88
Geometry< NodeType >::PointsArrayType NodesArrayType
Definition of nodes container type, redefined from GeometryType.
Definition: calculate_velocity_laplacian_component.h:80
std::vector< Dof< double >::Pointer > DofsVectorType
Definition: calculate_velocity_laplacian_component.h:96
std::vector< std::size_t > EquationIdVectorType
Definition: calculate_velocity_laplacian_component.h:94
ComputeVelocityLaplacianComponentSimplex(IndexType NewId=0)
Default constuctor.
Definition: calculate_velocity_laplacian_component.h:119
PointerVectorSet< Dof< double >, IndexedObject > DofsArrayType
Definition: calculate_velocity_laplacian_component.h:98
Geometry< NodeType > GeometryType
Geometry type (using with given NodeType)
Definition: calculate_velocity_laplacian_component.h:77
Node NodeType
Node type (default is: Node)
Definition: calculate_velocity_laplacian_component.h:74
ComputeVelocityLaplacianComponentSimplex(IndexType NewId, const NodesArrayType &ThisNodes)
Constructor using an array of nodes.
Definition: calculate_velocity_laplacian_component.h:128
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: element.h:1135
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
Geometry base class.
Definition: geometry.h:71
This object defines an indexed object.
Definition: indexed_object.h:54
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
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
Matrix MatrixType
Definition: geometrical_transformation_utilities.h:55
Modeler::Pointer Create(const std::string &ModelerName, Model &rModel, const Parameters ModelParameters)
Checks if the modeler is registered.
Definition: modeler_factory.cpp:30
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
F
Definition: hinsberg_optimization.py:144