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.
added_mass_condition.hpp
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: Lorenzo Gracia
11 //
12 
13 
14 #if !defined(KRATOS_ADDED_MASS_CONDITION_H_INCLUDED )
15 #define KRATOS_ADDED_MASS_CONDITION_H_INCLUDED
16 
17 // System includes
18 #include <cmath>
19 
20 // Project includes
21 #include "includes/define.h"
22 #include "includes/condition.h"
23 #include "includes/serializer.h"
24 #include "includes/process_info.h"
25 
26 // Application includes
29 
30 namespace Kratos
31 {
32 
33 template< unsigned int TDim, unsigned int TNumNodes >
35 {
36 
37 public:
38 
40 
41  typedef std::size_t IndexType;
43  typedef Node NodeType;
46  typedef Vector VectorType;
47  typedef Matrix MatrixType;
48 
49 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
50 
51  // Default constructor
53 
54  // Constructor 1
55  AddedMassCondition( IndexType NewId, GeometryType::Pointer pGeometry ) : Condition(NewId, pGeometry) {}
56 
57  // Constructor 2
58  AddedMassCondition( IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties ) : Condition(NewId, pGeometry, pProperties)
59  {
61  }
62 
63  // Destructor
64  virtual ~AddedMassCondition() {}
65 
66 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
67 
68  Condition::Pointer Create(IndexType NewId,NodesArrayType const& ThisNodes,PropertiesType::Pointer pProperties ) const override;
69 
70  void GetDofList(DofsVectorType& rConditionDofList, const ProcessInfo& rCurrentProcessInfo) const override;
71 
72 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
73 
74  void CalculateLocalSystem(MatrixType& rLeftHandSideMatrix,VectorType& rRightHandSideVector, const ProcessInfo& rCurrentProcessInfo) override;
75 
76  void CalculateLeftHandSide(MatrixType& rLeftHandSideMatrix, const ProcessInfo& rCurrentProcessInfo) override;
77 
78  void CalculateRightHandSide(VectorType& rRightHandSideVector, const ProcessInfo& rCurrentProcessInfo) override;
79 
80  void EquationIdVector(EquationIdVectorType& rResult, const ProcessInfo& rCurrentProcessInfo) const override;
81 
82 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
83 
84 protected:
85 
86  // Member Variables
87 
89 
90 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
91 
92  void CalculateAll( MatrixType& rLeftHandSideMatrix, VectorType& rRightHandSideVector, const ProcessInfo& rCurrentProcessInfo );
93 
94  virtual void CalculateLHS( MatrixType& rLeftHandSideMatrix, const ProcessInfo& rCurrentProcessInfo );
95 
96  virtual void CalculateRHS( VectorType& rRightHandSideVector, const ProcessInfo& rCurrentProcessInfo );
97 
98  void CalculateIntegrationCoefficient(double& rIntegrationCoefficient, const Matrix& Jacobian, const double& weight);
99 
100  void GetAccelerationVector( Vector& rValues, int Step );
101 
102 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
103 
104 private:
105 
106  // Serialization
107 
108  friend class Serializer;
109 
110  void save(Serializer& rSerializer) const override
111  {
113  }
114 
115  void load(Serializer& rSerializer) override
116  {
118  }
119 
120 }; // class AddedMassCondition.
121 
122 } // namespace Kratos.
123 
124 #endif // KRATOS_ADDED_MASS_CONDITION_H_INCLUDED defined
Definition: added_mass_condition.hpp:35
void CalculateRightHandSide(VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Definition: added_mass_condition.cpp:99
GeometryData::IntegrationMethod mThisIntegrationMethod
Definition: added_mass_condition.hpp:88
AddedMassCondition()
Definition: added_mass_condition.hpp:52
virtual void CalculateLHS(MatrixType &rLeftHandSideMatrix, const ProcessInfo &rCurrentProcessInfo)
Definition: added_mass_condition.cpp:160
Geometry< NodeType > GeometryType
Definition: added_mass_condition.hpp:44
std::size_t IndexType
Definition: added_mass_condition.hpp:41
void CalculateLeftHandSide(MatrixType &rLeftHandSideMatrix, const ProcessInfo &rCurrentProcessInfo) override
Definition: added_mass_condition.cpp:80
AddedMassCondition(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties)
Definition: added_mass_condition.hpp:58
void CalculateAll(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo)
Definition: added_mass_condition.cpp:146
Matrix MatrixType
Definition: added_mass_condition.hpp:47
void GetDofList(DofsVectorType &rConditionDofList, const ProcessInfo &rCurrentProcessInfo) const override
Definition: added_mass_condition.cpp:29
Condition::Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, PropertiesType::Pointer pProperties) const override
It creates a new condition pointer.
Definition: added_mass_condition.cpp:21
virtual ~AddedMassCondition()
Definition: added_mass_condition.hpp:64
void EquationIdVector(EquationIdVectorType &rResult, const ProcessInfo &rCurrentProcessInfo) const override
Definition: added_mass_condition.cpp:118
void CalculateLocalSystem(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Definition: added_mass_condition.cpp:56
KRATOS_CLASS_POINTER_DEFINITION(AddedMassCondition)
Properties PropertiesType
Definition: added_mass_condition.hpp:42
void GetAccelerationVector(Vector &rValues, int Step)
Definition: added_mass_condition.cpp:312
Vector VectorType
Definition: added_mass_condition.hpp:46
Geometry< NodeType >::PointsArrayType NodesArrayType
Definition: added_mass_condition.hpp:45
void CalculateIntegrationCoefficient(double &rIntegrationCoefficient, const Matrix &Jacobian, const double &weight)
Node NodeType
Definition: added_mass_condition.hpp:43
virtual void CalculateRHS(VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo)
Definition: added_mass_condition.cpp:210
AddedMassCondition(IndexType NewId, GeometryType::Pointer pGeometry)
Definition: added_mass_condition.hpp:55
Base class for all Conditions.
Definition: condition.h:59
std::vector< std::size_t > EquationIdVectorType
Definition: condition.h:98
std::vector< DofType::Pointer > DofsVectorType
Definition: condition.h:100
std::size_t IndexType
Definition: flags.h:74
GeometryType & GetGeometry()
Returns the reference of the geometry.
Definition: geometrical_object.h:158
IntegrationMethod
Definition: geometry_data.h:76
Geometry base class.
Definition: geometry.h:71
IntegrationMethod GetDefaultIntegrationMethod() const
Definition: geometry.h:2004
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
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
ModelPart::NodesContainerType NodesArrayType
Definition: gid_gauss_point_container.h:42
def load(f)
Definition: ode_solve.py:307