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.
apply_boundary_hydrostatic_pressure_table_process.hpp
Go to the documentation of this file.
1 // KRATOS___
2 // // ) )
3 // // ___ ___
4 // // ____ //___) ) // ) )
5 // // / / // // / /
6 // ((____/ / ((____ ((___/ / MECHANICS
7 //
8 // License: geo_mechanics_application/license.txt
9 //
10 // Main authors: Ignasi de Pouplana,
11 // Vahid Galavi
12 //
13 
14 #pragma once
15 
16 #include "includes/table.h"
17 
20 
21 namespace Kratos
22 {
23 
25 {
26 
27 public:
28 
30 
33 
35  Parameters rParameters
37  {
39 
40  unsigned int TableId = rParameters["table"].GetInt();
41  mpTable = model_part.pGetTable(TableId);
42  mTimeUnitConverter = model_part.GetProcessInfo()[TIME_UNIT_CONVERTER];
43 
44  KRATOS_CATCH("")
45  }
46 
50 
53  {
55 
57  const double Time = mrModelPart.GetProcessInfo()[TIME]/mTimeUnitConverter;
58  const double deltaH = mpTable->GetValue(Time);
59 
60  block_for_each(mrModelPart.Nodes(), [&deltaH, &var, this](Node& rNode){
61  const double distance = mReferenceCoordinate - rNode.Coordinates()[mGravityDirection];
62  const double pressure = mSpecificWeight * (distance + deltaH);
63  rNode.FastGetSolutionStepValue(var) = std::max(pressure,0.0);
64  });
65  KRATOS_CATCH("")
66  }
67 
69  std::string Info() const override
70  {
71  return "ApplyBoundaryHydrostaticPressureTableProcess";
72  }
73 
74 private:
76  TableType::Pointer mpTable;
77  double mTimeUnitConverter;
78 
79 };
80 
81 }
Definition: apply_boundary_hydrostatic_pressure_table_process.hpp:25
void ExecuteInitializeSolutionStep() override
this function will be executed at every time step BEFORE performing the solve phase
Definition: apply_boundary_hydrostatic_pressure_table_process.hpp:52
KRATOS_CLASS_POINTER_DEFINITION(ApplyBoundaryHydrostaticPressureTableProcess)
ApplyBoundaryHydrostaticPressureTableProcess(ModelPart &model_part, Parameters rParameters)
Definition: apply_boundary_hydrostatic_pressure_table_process.hpp:34
ApplyBoundaryHydrostaticPressureTableProcess & operator=(const ApplyBoundaryHydrostaticPressureTableProcess &)=delete
ApplyBoundaryHydrostaticPressureTableProcess(const ApplyBoundaryHydrostaticPressureTableProcess &)=delete
std::string Info() const override
Turn back information as a string.
Definition: apply_boundary_hydrostatic_pressure_table_process.hpp:69
Definition: apply_constant_boundary_hydrostatic_pressure_process.hpp:25
std::string mVariableName
Definition: apply_constant_boundary_hydrostatic_pressure_process.hpp:102
ModelPart & mrModelPart
Member Variables.
Definition: apply_constant_boundary_hydrostatic_pressure_process.hpp:101
KratosComponents class encapsulates a lookup table for a family of classes in a generic way.
Definition: kratos_components.h:49
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
This class defines the node.
Definition: node.h:65
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
int GetInt() const
This method returns the integer contained in the current Parameter.
Definition: kratos_parameters.cpp:666
Definition: table.h:435
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
void block_for_each(TIterator itBegin, TIterator itEnd, TFunction &&rFunction)
Execute a functor on all items of a range in parallel.
Definition: parallel_utilities.h:299
model_part
Definition: face_heat.py:14