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.
vel_enriched_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 #if !defined(KRATOS_VELOCITY_ENRICHED_PFEM2_2D_ELEM_H_INCLUDED)
10 #define KRATOS_VELOCITY_ENRICHED_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 
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  {}
67  Element(NewId, ThisNodes)
68  {}
69 
70  VelocityEnrichedPFEM22D(IndexType NewId, GeometryType::Pointer pGeometry);
71  VelocityEnrichedPFEM22D(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties);
72 
74  virtual ~ VelocityEnrichedPFEM22D() override;
75 
76 
77  Element::Pointer Create(IndexType NewId, NodesArrayType const& ThisNodes, PropertiesType::Pointer pProperties) const override;
78 
79  void CalculateLocalSystem(MatrixType& rLeftHandSideMatrix, VectorType& rRightHandSideVector, ProcessInfo& rCurrentProcessInfo) override;
80 
81  //void CalculateRightHandSide(VectorType& rRightHandSideVector, ProcessInfo& rCurrentProcessInfo) override;
82 
83  void AddExplicitContribution(ProcessInfo& CurrentProcessInfo) override;
84 
85  void EquationIdVector(EquationIdVectorType& rResult, ProcessInfo& rCurrentProcessInfo) override;
86 
87  void GetDofList(DofsVectorType& ElementalDofList,ProcessInfo& CurrentProcessInfo) override;
88 
89  void InitializeSolutionStep(ProcessInfo& CurrentProcessInfo) override;
90 
91 
92 
93 protected:
94 
95  void CalculatePressureProjection(ProcessInfo& CurrentProcessInfo);
96 
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  friend class Serializer;
132 
133  virtual void save(Serializer& rSerializer) const override
134  {
136  }
137 
138  virtual void load(Serializer& rSerializer) override
139  {
141  }
142 
144 
147 
148  void CalculateInterfaceNormal(
149  BoundedMatrix<double, 3, 2 >& rPoints,
150  array_1d<double,3>& rDistances,
151  array_1d<double,2>& normal,
152  double & interface_area,
153  array_1d<double,3>& Ninterface,
154  BoundedMatrix<double, 2, 2 >& rInterfacePoints);
155 
156  inline void CalculatePosition(
157  const bounded_matrix<double, 3, 3 > & coordinates,
158  const double xc, const double yc, const double zc, array_1d<double, 3 > & N);
159 
160  inline double CalculateVol(
161  const double x0, const double y0,const double x1, const double y1, const double x2, const double y2 );
162 
163 
164 }; // Class PFEM22D
165 } // namespace Kratos.
166 
167 #endif // KRATOS_MONOLITIC_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
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
Definition: vel_enriched_2fluid_2d.h:31
Properties PropertiesType
Definition: vel_enriched_2fluid_2d.h:48
Vector VectorType
Definition: vel_enriched_2fluid_2d.h:53
virtual void AddViscousTerm(MatrixType &rDampMatrix, const BoundedMatrix< double, 3, 2 > &rShapeDeriv, double Viscosity, const double Area)
Definition: vel_enriched_2fluid_2d.cpp:1477
void AddViscousTerm(BoundedMatrix< double, 17, 17 > &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)
bool InvertMatrix(const T &input, T &inverse)
Definition: vel_enriched_2fluid_2d.cpp:1526
VelocityEnrichedPFEM22D(IndexType NewId, const NodesArrayType &ThisNodes)
Definition: vel_enriched_2fluid_2d.h:66
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)
std::vector< Dof< double >::Pointer > DofsVectorType
Definition: vel_enriched_2fluid_2d.h:58
Geometry< NodeType >::PointsArrayType NodesArrayType
definition of nodes container type, redefined from GeometryType
Definition: vel_enriched_2fluid_2d.h:52
PointerVector< PFEM_Particle_Fluid, PFEM_Particle_Fluid *, std::vector< PFEM_Particle_Fluid * > > ParticlePointerVector
Definition: vel_enriched_2fluid_2d.h:60
PointerVectorSet< Dof< double >, IndexedObject > DofsArrayType
Definition: vel_enriched_2fluid_2d.h:59
void AddViscousTerm(MatrixType &rDampMatrix, std::vector< Matrix > &gauss_gradients_discontinuous, array_1d< double, 3 > &volumes, array_1d< double, 3 > &viscosities, const int ndivisions)
virtual ~ VelocityEnrichedPFEM22D() override
Destructor.
std::size_t IndexType
Definition: vel_enriched_2fluid_2d.h:55
void CalculatePressureProjection(ProcessInfo &CurrentProcessInfo)
Definition: vel_enriched_2fluid_2d.cpp:1217
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(VelocityEnrichedPFEM22D)
Counted pointer of PFEM22D.
std::size_t SizeType
Definition: vel_enriched_2fluid_2d.h:56
void InitializeSolutionStep(ProcessInfo &CurrentProcessInfo) override
Definition: vel_enriched_2fluid_2d.cpp:1102
Geometry< NodeType > GeometryType
definition of the geometry type with given NodeType
Definition: vel_enriched_2fluid_2d.h:50
std::vector< std::size_t > EquationIdVectorType
Definition: vel_enriched_2fluid_2d.h:57
Element::Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, PropertiesType::Pointer pProperties) const override
It creates a new element pointer.
Definition: vel_enriched_2fluid_2d.cpp:45
void GetDofList(DofsVectorType &ElementalDofList, ProcessInfo &CurrentProcessInfo) override
Definition: vel_enriched_2fluid_2d.cpp:1163
void CalculateLocalSystem(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, ProcessInfo &rCurrentProcessInfo) override
Definition: vel_enriched_2fluid_2d.cpp:81
VelocityEnrichedPFEM22D(IndexType NewId=0)
Default constructor.
Definition: vel_enriched_2fluid_2d.h:63
void EquationIdVector(EquationIdVectorType &rResult, ProcessInfo &rCurrentProcessInfo) override
Definition: vel_enriched_2fluid_2d.cpp:1112
void AddExplicitContribution(ProcessInfo &CurrentProcessInfo) override
Definition: vel_enriched_2fluid_2d.cpp:58
#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
bool CalculatePosition(Geometry< Node > &geom, const double xc, const double yc, const double zc, array_1d< double, 3 > &N)
Definition: transfer_utility.h:343
double CalculateVol(const double x0, const double y0, const double x1, const double y1, const double x2, const double y2)
Definition: transfer_utility.h:424
output
Definition: generate_frictional_mortar_condition.py:444
input
Definition: generate_frictional_mortar_condition.py:435
x2
Definition: generate_frictional_mortar_condition.py:122
x1
Definition: generate_frictional_mortar_condition.py:121
def load(f)
Definition: ode_solve.py:307
float xc
Definition: rotating_cone.py:77
float yc
Definition: rotating_cone.py:78
N
Definition: sensitivityMatrix.py:29