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_mat_deriv_simplex_element.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_MATERIAL_DERIVATIVE_SIMPLEX_ELEMENT_H_INCLUDED )
8 #define KRATOS_COMPUTE_MATERIAL_DERIVATIVE_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"
30 
31 namespace Kratos
32 {
33 
36 
39 
43 
47 
51 
55 
57 
59 template< unsigned int TDim,
60  unsigned int TNumNodes = TDim + 1 >
61 class KRATOS_API(SWIMMING_DEM_APPLICATION) ComputeMaterialDerivativeSimplex : public Element
62 {
63 public:
66 
69 
71  typedef Node NodeType;
72 
75 
78 
80  typedef Vector VectorType;
81 
83  typedef Matrix MatrixType;
84 
85  typedef std::size_t IndexType;
86 
87  typedef std::size_t SizeType;
88 
89  typedef std::vector<std::size_t> EquationIdVectorType;
90 
91  typedef std::vector< Dof<double>::Pointer > DofsVectorType;
92 
94 
97 
100 
103 
107 
108  //Constructors.
109 
111 
115  Element(NewId)
116  {}
117 
119 
124  Element(NewId, ThisNodes)
125  {}
126 
128 
132  ComputeMaterialDerivativeSimplex(IndexType NewId, GeometryType::Pointer pGeometry) :
133  Element(NewId, pGeometry)
134  {}
135 
137 
142  ComputeMaterialDerivativeSimplex(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties) :
143  Element(NewId, pGeometry, pProperties)
144  {}
145 
148  {}
149 
150 
154 
155 
159 
161 
168  Element::Pointer Create(IndexType NewId, NodesArrayType const& ThisNodes,
169  PropertiesType::Pointer pProperties) const override
170  {
171  return Element::Pointer(new ComputeMaterialDerivativeSimplex(NewId, GetGeometry().Create(ThisNodes), pProperties));
172  }
173 
175  void CalculateLocalSystem(MatrixType& rLeftHandSideMatrix,
176  VectorType& rRightHandSideVector,
177  const ProcessInfo& rCurrentProcessInfo) override;
178 
180 
186  virtual void EquationIdVector(EquationIdVectorType& rResult, const ProcessInfo& rCurrentProcessInfo) const override;
187 
189 
193  virtual void GetDofList(DofsVectorType& rElementalDofList, const ProcessInfo& rCurrentProcessInfo) const override;
194 
198 
202 
204 
212  int Check(const ProcessInfo& rCurrentProcessInfo) const override;
213 
214 
218 
219 
223 
225  virtual std::string Info() const override
226  {
227  std::stringstream buffer;
228  buffer << "ComputeMaterialDerivativeSimplex #" << Id();
229  return buffer.str();
230  }
231 
233  virtual void PrintInfo(std::ostream& rOStream) const override
234  {
235  rOStream << "ComputeMaterialDerivativeSimplex" << TDim << "D";
236  }
237 
238 // /// Print object's data.
239 // virtual void PrintData(std::ostream& rOStream) const;
240 
244 
245 
247 
248 protected:
251 
252 
256 
257 
261 
262 
266 
267 
272  virtual void CalculateMassMatrix(MatrixType& rMassMatrix, const ProcessInfo& rCurrentProcessInfo) override;
273 
274  virtual void CalculateRHS(VectorType& F, const ProcessInfo& rCurrentProcessInfo);
275 
276  virtual void CalculateLumpedMassMatrix(MatrixType& rLHSMatrix, const double Mass);
277 
278  virtual void AddConsistentMassMatrixContribution(MatrixType& rLHSMatrix, const array_1d<double,TNumNodes>& rShapeFunc, const double Weight);
279 
280  void CalculateWeights(ShapeFunctionDerivativesArrayType& rDN_DX, Matrix& rNContainer, Vector& rGaussWeights);
281 
282  void EvaluateInPoint(array_1d< double, 3 > & rResult, const Variable< array_1d< double, 3 > >& rVariable, const array_1d< double, TNumNodes >& rShapeFunc);
283 
284  virtual void AddIntegrationPointRHSContribution(VectorType& F, const array_1d<double,TNumNodes>& rShapeFunc, const BoundedMatrix<double, TNumNodes, TDim>& rShapeDeriv, const double Weight);
285 
289 
290 
294 
295 
297 
298 private:
301 
305 
309 
310  friend class Serializer;
311 
312  void save(Serializer& rSerializer) const override
313  {
315  }
316 
317  void load(Serializer& rSerializer) override
318  {
320  }
321 
325 
327 
337 
338 
342 
343 
347 
348 
352 
354  ComputeMaterialDerivativeSimplex & operator=(ComputeMaterialDerivativeSimplex const& rOther);
355 
357  ComputeMaterialDerivativeSimplex(ComputeMaterialDerivativeSimplex const& rOther);
358 
360 
361 }; // Class ComputeMaterialDerivativeSimplex
362 
364 
367 
368 
372 
373 
375 template< unsigned int TDim >
376 inline std::istream& operator >>(std::istream& rIStream,
378 {
379  return rIStream;
380 }
381 
383 template< unsigned int TDim >
384 inline std::ostream& operator <<(std::ostream& rOStream,
386 {
387  rThis.PrintInfo(rOStream);
388  rOStream << std::endl;
389  rThis.PrintData(rOStream);
390 
391  return rOStream;
392 }
394 
396 
397 } // namespace Kratos.
398 
399 #endif // KRATOS_COMPUTE_MATERIAL_DERIVATIVE_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
ComputeMaterialDerivativeSimplex(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties)
Constuctor using geometry and properties.
Definition: calculate_mat_deriv_simplex_element.h:142
PointerVectorSet< Dof< double >, IndexedObject > DofsArrayType
Definition: calculate_mat_deriv_simplex_element.h:93
Node NodeType
Node type (default is: Node)
Definition: calculate_mat_deriv_simplex_element.h:71
ComputeMaterialDerivativeSimplex(IndexType NewId, const NodesArrayType &ThisNodes)
Constructor using an array of nodes.
Definition: calculate_mat_deriv_simplex_element.h:123
ComputeMaterialDerivativeSimplex(IndexType NewId=0)
Default constuctor.
Definition: calculate_mat_deriv_simplex_element.h:114
Element::Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, PropertiesType::Pointer pProperties) const override
Create a new element of this type.
Definition: calculate_mat_deriv_simplex_element.h:168
Kratos::Vector ShapeFunctionsType
Type for shape function values container.
Definition: calculate_mat_deriv_simplex_element.h:96
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(ComputeMaterialDerivativeSimplex)
Pointer definition of ComputeMaterialDerivativeSimplex.
virtual ~ComputeMaterialDerivativeSimplex()
Destructor.
Definition: calculate_mat_deriv_simplex_element.h:147
Matrix MatrixType
Matrix type for local contributions to the linear system.
Definition: calculate_mat_deriv_simplex_element.h:83
GeometryType::ShapeFunctionsGradientsType ShapeFunctionDerivativesArrayType
Type for an array of shape function gradient matrices.
Definition: calculate_mat_deriv_simplex_element.h:102
Geometry< NodeType >::PointsArrayType NodesArrayType
Definition of nodes container type, redefined from GeometryType.
Definition: calculate_mat_deriv_simplex_element.h:77
Vector VectorType
Vector type for local contributions to the linear system.
Definition: calculate_mat_deriv_simplex_element.h:80
virtual std::string Info() const override
Turn back information as a string.
Definition: calculate_mat_deriv_simplex_element.h:225
virtual void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: calculate_mat_deriv_simplex_element.h:233
ComputeMaterialDerivativeSimplex(IndexType NewId, GeometryType::Pointer pGeometry)
Constructor using a geometry object.
Definition: calculate_mat_deriv_simplex_element.h:132
std::vector< std::size_t > EquationIdVectorType
Definition: calculate_mat_deriv_simplex_element.h:89
Geometry< NodeType > GeometryType
Geometry type (using with given NodeType)
Definition: calculate_mat_deriv_simplex_element.h:74
std::size_t SizeType
Definition: calculate_mat_deriv_simplex_element.h:87
Kratos::Matrix ShapeFunctionDerivativesType
Type for a matrix containing the shape function gradients.
Definition: calculate_mat_deriv_simplex_element.h:99
std::vector< Dof< double >::Pointer > DofsVectorType
Definition: calculate_mat_deriv_simplex_element.h:91
std::size_t IndexType
Definition: calculate_mat_deriv_simplex_element.h:85
Base class for all Elements.
Definition: element.h:60
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: element.h:1135
std::size_t IndexType
Definition: flags.h:74
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
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
#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
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
def load(f)
Definition: ode_solve.py:307