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.
monolithic_2fluid_2d.h
Go to the documentation of this file.
1 //
2 // Project Name: Kratos
3 // Last modified by: $Author: it's me! $
4 // Date: $Date: 2008-08-08 23:58:38 $
5 // Revision: $Revision: 1.0 $
6 //
7 //
8 
9 #ifndef KRATOS_MONOLITHIC_PFEM2_2D_ELEM_H_INCLUDED
10 #define KRATOS_MONOLITHIC_PFEM2_2D_ELEM_H_INCLUDED
11 
12 // System includes
13 
14 
15 // External includes
16 #include "boost/smart_ptr.hpp"
17 
18 
19 // Project includes
20 #include "includes/define.h"
21 #include "includes/element.h"
24 
25 
26 
27 namespace Kratos
28 {
29 
30 class MonolithicPFEM22D : public Element
31 {
32 public:
33 
41 
42  //typedef Node NodeType;
53  typedef Vector VectorType;
54  //typedef typename ElementBaseType::MatrixType MatrixType;
55  typedef std::size_t IndexType;
56  typedef std::size_t SizeType;
57  typedef std::vector<std::size_t> EquationIdVectorType;
58  typedef std::vector< Dof<double>::Pointer > DofsVectorType;
61 
64  Element(NewId)
65  {}
66 
67  MonolithicPFEM22D(IndexType NewId, const NodesArrayType& ThisNodes) :
68  Element(NewId, ThisNodes)
69  {}
70 
71  MonolithicPFEM22D(IndexType NewId, GeometryType::Pointer pGeometry);
72 
73  MonolithicPFEM22D(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties);
74 
76  virtual ~ MonolithicPFEM22D() override;
77 
78 
79  Element::Pointer Create(IndexType NewId, NodesArrayType const& ThisNodes, PropertiesType::Pointer pProperties) const override;
80 
81  Element::Pointer Create(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties) const override;
82 
83  void CalculateLocalSystem(MatrixType& rLeftHandSideMatrix, VectorType& rRightHandSideVector, const ProcessInfo& rCurrentProcessInfo) override;
84 
85  void AddExplicitContribution(const ProcessInfo& CurrentProcessInfo) override;
86 
87  void EquationIdVector(EquationIdVectorType& rResult, const ProcessInfo& rCurrentProcessInfo) const override;
88 
89  void GetDofList(DofsVectorType& ElementalDofList,const ProcessInfo& CurrentProcessInfo) const override;
90 
91  void InitializeSolutionStep(const ProcessInfo& CurrentProcessInfo) override;
92 
93 
94 protected:
95 
96  void CalculatePressureProjection(const ProcessInfo& CurrentProcessInfo);
97 
98  virtual void AddViscousTerm(MatrixType& rDampMatrix,
99  const BoundedMatrix<double, 3, 2>& rShapeDeriv,
100  double& Viscosity,const double Area);
101 
103  BoundedMatrix<double, (2+1), 2 >& rShapeDeriv,
104  array_1d<double,3>& distances,
105  std::vector< Matrix >& gauss_gradients,
106  array_1d<double,3>& viscosities,
107  array_1d<double,3>& signs,
108  array_1d<double,3>& volumes ,
109  const unsigned int ndivisions);
110 
112  BoundedMatrix<double, (2+1), 2 >& rShapeDeriv,
113  array_1d<double,3>& distances,
114  std::vector< Matrix >& gauss_gradients,
115  array_1d<double,3>& viscosities,
116  array_1d<double,3>& signs,
117  array_1d<double,3>& volumes ,
118  const unsigned int ndivisions);
119 
120  void AddViscousTerm(MatrixType& rDampMatrix,
121  std::vector< Matrix > & gauss_gradients_discontinuous,
122  array_1d<double,3>& volumes,
123  array_1d<double,3>& viscosities,
124  const int ndivisions);
125 
126  template<class T>
127  bool InvertMatrix(const T& input, T& inverse);
128 
129 
130 private:
131 
132  friend class Serializer;
133 
134  virtual void save(Serializer& rSerializer) const override
135  {
137  }
138 
139  virtual void load(Serializer& rSerializer) override
140  {
142  }
143 
145 
147  MonolithicPFEM22D(MonolithicPFEM22D const& rOther);
148 
149 }; // Class PFEM22D
150 
151 } // namespace Kratos.
152 
153 #endif // KRATOS_MONOLITHIC_PFEM2_2D_ELEM_H_INCLUDED defined
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
Base class for all Elements.
Definition: element.h:60
std::vector< DofType::Pointer > DofsVectorType
Definition: element.h:100
std::vector< std::size_t > EquationIdVectorType
Definition: element.h:98
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
Definition: monolithic_2fluid_2d.h:31
void EquationIdVector(EquationIdVectorType &rResult, const ProcessInfo &rCurrentProcessInfo) const override
Definition: monolithic_2fluid_2d.cpp:754
MonolithicPFEM22D(IndexType NewId, const NodesArrayType &ThisNodes)
Definition: monolithic_2fluid_2d.h:67
void CalculatePressureProjection(const ProcessInfo &CurrentProcessInfo)
Definition: monolithic_2fluid_2d.cpp:857
std::vector< Dof< double >::Pointer > DofsVectorType
Definition: monolithic_2fluid_2d.h:58
void AddViscousTerm(BoundedMatrix< double, 12, 12 > &output, BoundedMatrix< double,(2+1), 2 > &rShapeDeriv, array_1d< double, 3 > &distances, std::vector< Matrix > &gauss_gradients, array_1d< double, 3 > &viscosities, array_1d< double, 3 > &signs, array_1d< double, 3 > &volumes, const unsigned int ndivisions)
MonolithicPFEM22D(IndexType NewId=0)
Default constructor.
Definition: monolithic_2fluid_2d.h:63
Vector VectorType
Definition: monolithic_2fluid_2d.h:53
std::size_t IndexType
Definition: monolithic_2fluid_2d.h:55
std::vector< std::size_t > EquationIdVectorType
Definition: monolithic_2fluid_2d.h:57
Element::Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, PropertiesType::Pointer pProperties) const override
It creates a new element pointer.
Definition: monolithic_2fluid_2d.cpp:34
void CalculateLocalSystem(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Definition: monolithic_2fluid_2d.cpp:75
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(MonolithicPFEM22D)
Counted pointer of PFEM22D.
PointerVectorSet< Dof< double >, IndexedObject > DofsArrayType
Definition: monolithic_2fluid_2d.h:59
Properties PropertiesType
Definition: monolithic_2fluid_2d.h:48
virtual void AddViscousTerm(MatrixType &rDampMatrix, const BoundedMatrix< double, 3, 2 > &rShapeDeriv, double &Viscosity, const double Area)
Definition: monolithic_2fluid_2d.cpp:1126
PointerVector< PFEM_Particle_Fluid, PFEM_Particle_Fluid *, std::vector< PFEM_Particle_Fluid * > > ParticlePointerVector
Definition: monolithic_2fluid_2d.h:60
void AddViscousTerm(MatrixType &rDampMatrix, std::vector< Matrix > &gauss_gradients_discontinuous, array_1d< double, 3 > &volumes, array_1d< double, 3 > &viscosities, const int ndivisions)
Geometry< NodeType >::PointsArrayType NodesArrayType
definition of nodes container type, redefined from GeometryType
Definition: monolithic_2fluid_2d.h:52
void AddExplicitContribution(const ProcessInfo &CurrentProcessInfo) override
Definition: monolithic_2fluid_2d.cpp:52
virtual ~ MonolithicPFEM22D() override
Destructor.
void GetDofList(DofsVectorType &ElementalDofList, const ProcessInfo &CurrentProcessInfo) const override
Definition: monolithic_2fluid_2d.cpp:804
std::size_t SizeType
Definition: monolithic_2fluid_2d.h:56
Geometry< NodeType > GeometryType
definition of the geometry type with given NodeType
Definition: monolithic_2fluid_2d.h:50
void InitializeSolutionStep(const ProcessInfo &CurrentProcessInfo) override
Definition: monolithic_2fluid_2d.cpp:744
bool InvertMatrix(const T &input, T &inverse)
Definition: monolithic_2fluid_2d.cpp:1173
void AddViscousTerm(BoundedMatrix< double, 13, 13 > &output, BoundedMatrix< double,(2+1), 2 > &rShapeDeriv, array_1d< double, 3 > &distances, std::vector< Matrix > &gauss_gradients, array_1d< double, 3 > &viscosities, array_1d< double, 3 > &signs, array_1d< double, 3 > &volumes, const unsigned int ndivisions)
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
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
std::size_t IndexType
The definition of the index type.
Definition: key_hash.h:35
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
output
Definition: generate_frictional_mortar_condition.py:444
input
Definition: generate_frictional_mortar_condition.py:435
def load(f)
Definition: ode_solve.py:307