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.
backward_euler_monolithic_ale_scheme.h
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: Miguel Maso
11 //
12 
13 
14 #ifndef KRATOS_BACKWARD_EULER_MONOLITHIC_ALE_SCHEME
15 #define KRATOS_BACKWARD_EULER_MONOLITHIC_ALE_SCHEME
16 
17 
18 /* System includes */
19 
20 
21 /* External includes */
22 #include "boost/smart_ptr.hpp"
23 
24 /* Project includes */
25 #include "includes/define.h"
26 #include "includes/model_part.h"
29 #include "includes/variables.h"
30 #include "includes/cfd_variables.h"
31 #include "containers/array_1d.h"
32 #include "utilities/openmp_utils.h"
33 #include "utilities/dof_updater.h"
35 #include "processes/process.h"
36 #include "../../FluidDynamicsApplication/custom_strategies/schemes/residualbased_predictorcorrector_velocity_bossak_scheme_turbulent.h"
37 
38 namespace Kratos {
39 
40  //@name Kratos Globals
42 
44  //@name Type Definitions
46 
48  //@name Enum's
50 
52  //@name Functions
54 
56  //@name Kratos Classes
58 
64  template<class TSparseSpace, class TDenseSpace >
66 
67  public:
68  //@name Type Definitions
70 
72 
74 
76 
77  typedef typename BaseType::TDataType TDataType;
78 
80 
82 
84 
86 
88 
90 
92 
94  //@name Life Cycle
96 
97  BackwardEulerMonolithicAleScheme(unsigned int DomainSize, bool IsLagrangian = true)
98  : ResidualBasedPredictorCorrectorVelocityBossakSchemeTurbulent<TSparseSpace, TDenseSpace>(0.0, 0.0, DomainSize)
99  {
100  mIsLagrangian = IsLagrangian;
102  }
103 
105 
107  //@name Operations
109 
110  void Update(ModelPart& rModelPart,
111  DofsArrayType& rDofSet,
113  TSystemVectorType& Dv,
114  TSystemVectorType& b) override
115  {
116  BossakType::Update(rModelPart, rDofSet, A, Dv, b);
117  this->Pfem2AdditionalUpdateOperations(rModelPart, rDofSet, A, Dv, b);
118  }
119 
120  void Predict(ModelPart& rModelPart,
121  DofsArrayType& rDofSet,
123  TSystemVectorType& Dv,
124  TSystemVectorType& b) override
125  {
126  BossakType::Predict(rModelPart, rDofSet, A, Dv, b);
127  this->Pfem2AdditionalUpdateOperations(rModelPart, rDofSet, A, Dv, b);
128  }
129 
131  DofsArrayType& rDofSet,
133  TSystemVectorType& Dv,
135  {
136  if (mIsLagrangian) {
137  #pragma omp parallel for
138  for (int i = 0; i < static_cast<int>(rModelPart.NumberOfNodes()); ++i)
139  {
140  auto it_node = rModelPart.NodesBegin() + i;
141  noalias(it_node->FastGetSolutionStepValue(MESH_VELOCITY)) = it_node->FastGetSolutionStepValue(VELOCITY);
142  }
143  }
144  }
145 
147 
148  protected:
151 
153 
155 
156  }; // Class BackwardEulerMonolithicAleScheme
157 
159 
160  //@name Type Definitions
162 
163 
165 
166 } // namespace Kratos
167 
168 #endif // KRATOS_BACKWARD_EULER_MONOLITHIC_ALE_SCHEME
A first order scheme for testing purpose.
Definition: backward_euler_monolithic_ale_scheme.h:65
KRATOS_CLASS_POINTER_DEFINITION(BackwardEulerMonolithicAleScheme)
BaseType::LocalSystemVectorType LocalSystemVectorType
Definition: backward_euler_monolithic_ale_scheme.h:87
BaseType::TDataType TDataType
Definition: backward_euler_monolithic_ale_scheme.h:77
BaseType::LocalSystemMatrixType LocalSystemMatrixType
Definition: backward_euler_monolithic_ale_scheme.h:89
Element::DofsVectorType DofsVectorType
Definition: backward_euler_monolithic_ale_scheme.h:81
bool mIsLagrangian
Definition: backward_euler_monolithic_ale_scheme.h:152
BackwardEulerMonolithicAleScheme(unsigned int DomainSize, bool IsLagrangian=true)
Definition: backward_euler_monolithic_ale_scheme.h:97
Scheme< TSparseSpace, TDenseSpace > BaseType
Definition: backward_euler_monolithic_ale_scheme.h:73
BaseType::TSystemMatrixType TSystemMatrixType
Definition: backward_euler_monolithic_ale_scheme.h:83
void Predict(ModelPart &rModelPart, DofsArrayType &rDofSet, TSystemMatrixType &A, TSystemVectorType &Dv, TSystemVectorType &b) override
Performing the prediction of the solution.
Definition: backward_euler_monolithic_ale_scheme.h:120
Element::GeometryType GeometryType
Definition: backward_euler_monolithic_ale_scheme.h:91
void Update(ModelPart &rModelPart, DofsArrayType &rDofSet, TSystemMatrixType &A, TSystemVectorType &Dv, TSystemVectorType &b) override
Definition: backward_euler_monolithic_ale_scheme.h:110
void Pfem2AdditionalUpdateOperations(ModelPart &rModelPart, DofsArrayType &rDofSet, TSystemMatrixType &A, TSystemVectorType &Dv, TSystemVectorType &b)
Definition: backward_euler_monolithic_ale_scheme.h:130
BaseType::TSystemVectorType TSystemVectorType
Definition: backward_euler_monolithic_ale_scheme.h:85
~BackwardEulerMonolithicAleScheme() override
Definition: backward_euler_monolithic_ale_scheme.h:104
ResidualBasedPredictorCorrectorVelocityBossakSchemeTurbulent< TSparseSpace, TDenseSpace > BossakType
Definition: backward_euler_monolithic_ale_scheme.h:75
BaseType::DofsArrayType DofsArrayType
Definition: backward_euler_monolithic_ale_scheme.h:79
std::vector< DofType::Pointer > DofsVectorType
Definition: element.h:100
Geometry base class.
Definition: geometry.h:71
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
NodeIterator NodesBegin(IndexType ThisIndex=0)
Definition: model_part.h:487
SizeType NumberOfNodes(IndexType ThisIndex=0) const
Definition: model_part.h:341
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
Bossak time scheme for the incompressible flow problem.
Definition: residualbased_predictorcorrector_velocity_bossak_scheme_turbulent.h:79
void Predict(ModelPart &rModelPart, DofsArrayType &rDofSet, TSystemMatrixType &A, TSystemVectorType &Dv, TSystemVectorType &b) override
Performing the prediction of the solution.
Definition: residualbased_predictorcorrector_velocity_bossak_scheme_turbulent.h:351
void Update(ModelPart &r_model_part, DofsArrayType &rDofSet, TSystemMatrixType &A, TSystemVectorType &Dv, TSystemVectorType &b) override
Definition: residualbased_predictorcorrector_velocity_bossak_scheme_turbulent.h:270
double mGammaNewmark
Definition: residualbased_predictorcorrector_velocity_bossak_scheme_turbulent.h:769
This class provides the implementation of the basic tasks that are needed by the solution strategy.
Definition: scheme.h:56
typename TSparseSpace::MatrixType TSystemMatrixType
Matrix type definition.
Definition: scheme.h:71
typename TSparseSpace::VectorType TSystemVectorType
Vector type definition.
Definition: scheme.h:74
typename TDenseSpace::VectorType LocalSystemVectorType
Local system vector type definition.
Definition: scheme.h:80
typename TSparseSpace::DataType TDataType
Data type definition.
Definition: scheme.h:68
typename TDenseSpace::MatrixType LocalSystemMatrixType
Local system matrix type definition.
Definition: scheme.h:77
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
b
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:31
A
Definition: sensitivityMatrix.py:70
integer i
Definition: TensorModule.f:17