15 #if !defined(KRATOS_PORO_EXPLICIT_VV_SCHEME_HPP_INCLUDED)
16 #define KRATOS_PORO_EXPLICIT_VV_SCHEME_HPP_INCLUDED
55 template <
class TSparseSpace,
139 const auto it_node_begin = rModelPart.
NodesBegin();
142 #pragma omp parallel for schedule(guided,512)
143 for (
int i = 0; i < static_cast<int>(r_nodes.size()); ++
i) {
144 auto it_node = (it_node_begin +
i);
145 it_node->SetValue(NODAL_MASS, 0.0);
148 double& r_flux_residual = it_node->FastGetSolutionStepValue(FLUX_RESIDUAL);
153 r_flux_residual = 0.0;
157 Matrix& rInitialStress = it_node->FastGetSolutionStepValue(INITIAL_STRESS_TENSOR);
158 if(rInitialStress.size1() != 3)
159 rInitialStress.
resize(3,3,
false);
208 const SizeType dim = r_current_process_info[DOMAIN_SIZE];
211 mDeltaTime = r_current_process_info[DELTA_TIME];
214 const auto it_node_begin = rModelPart.
NodesBegin();
217 const IndexType disppos = it_node_begin->GetDofPosition(DISPLACEMENT_X);
219 #pragma omp parallel for schedule(guided,512)
220 for (
int i = 0; i < static_cast<int>(r_nodes.size()); ++
i) {
244 array_1d<double, 3>& r_displacement = itCurrentNode->FastGetSolutionStepValue(DISPLACEMENT);
246 const double nodal_mass = itCurrentNode->GetValue(NODAL_MASS);
248 const array_1d<double, 3>& r_external_force = itCurrentNode->FastGetSolutionStepValue(EXTERNAL_FORCE);
249 const array_1d<double, 3>& r_internal_force = itCurrentNode->FastGetSolutionStepValue(INTERNAL_FORCE);
250 const array_1d<double, 3>& r_damping_force = itCurrentNode->FastGetSolutionStepValue(DAMPING_FORCE);
252 std::array<bool, 3> fix_displacements = {
false,
false,
false};
253 fix_displacements[0] = (itCurrentNode->GetDof(DISPLACEMENT_X, DisplacementPosition).IsFixed());
254 fix_displacements[1] = (itCurrentNode->GetDof(DISPLACEMENT_Y, DisplacementPosition + 1).IsFixed());
256 fix_displacements[2] = (itCurrentNode->GetDof(DISPLACEMENT_Z, DisplacementPosition + 2).IsFixed());
261 if (fix_displacements[
j] ==
false) {
262 r_displacement[
j] += r_velocity[
j]*
mDeltaTime + 0.5 * (r_external_force[
j]
263 - r_internal_force[
j]
265 r_velocity[
j] += 0.5 *
mDeltaTime * (r_external_force[
j]
266 - r_internal_force[
j]
267 - r_damping_force[
j])/nodal_mass;
290 const double nodal_mass = itCurrentNode->GetValue(NODAL_MASS);
292 double& r_current_water_pressure = itCurrentNode->FastGetSolutionStepValue(WATER_PRESSURE);
293 double& r_current_dt_water_pressure = itCurrentNode->FastGetSolutionStepValue(DT_WATER_PRESSURE);
295 const array_1d<double, 3>& r_external_force = itCurrentNode->FastGetSolutionStepValue(EXTERNAL_FORCE);
296 const array_1d<double, 3>& r_internal_force = itCurrentNode->FastGetSolutionStepValue(INTERNAL_FORCE);
297 const array_1d<double, 3>& r_damping_force = itCurrentNode->FastGetSolutionStepValue(DAMPING_FORCE);
299 std::array<bool, 3> fix_displacements = {
false,
false,
false};
300 fix_displacements[0] = (itCurrentNode->GetDof(DISPLACEMENT_X, DisplacementPosition).IsFixed());
301 fix_displacements[1] = (itCurrentNode->GetDof(DISPLACEMENT_Y, DisplacementPosition + 1).IsFixed());
303 fix_displacements[2] = (itCurrentNode->GetDof(DISPLACEMENT_Z, DisplacementPosition + 2).IsFixed());
308 if (fix_displacements[
j] ==
false) {
309 r_velocity[
j] += 0.5 *
mDeltaTime * (r_external_force[
j]
310 - r_internal_force[
j]
311 - r_damping_force[
j])/nodal_mass;
319 if( itCurrentNode->IsFixed(WATER_PRESSURE) ==
false ) {
321 r_current_water_pressure = 0.0;
322 r_current_dt_water_pressure = 0.0;
325 const array_1d<double, 3>& r_velocity_old = itCurrentNode->FastGetSolutionStepValue(VELOCITY,1);
326 array_1d<double, 3>& r_acceleration = itCurrentNode->FastGetSolutionStepValue(ACCELERATION);
349 rCurrentElement.
AddExplicitContribution(RHS_Contribution, RESIDUAL_VECTOR, DAMPING_FORCE, rCurrentProcessInfo);
Base class for all Elements.
Definition: element.h:60
virtual void AddExplicitContribution(const ProcessInfo &rCurrentProcessInfo)
Definition: element.h:622
std::vector< std::size_t > EquationIdVectorType
Definition: element.h:98
void resize(std::size_t NewSize1, std::size_t NewSize2, bool preserve=0)
Definition: amatrix_interface.h:224
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
MeshType::ConditionsContainerType ConditionsContainerType
Condintions container. A vector set of Conditions with their Id's as key.
Definition: model_part.h:183
MeshType::ElementsContainerType ElementsContainerType
Element container. A vector set of Elements with their Id's as key.
Definition: model_part.h:168
NodeIterator NodesBegin(IndexType ThisIndex=0)
Definition: model_part.h:487
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
MeshType::NodeIterator NodeIterator
Definition: model_part.h:134
MeshType::NodesContainerType NodesContainerType
Nodes container. Which is a vector set of nodes with their Id's as key.
Definition: model_part.h:128
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
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
An explicit forward euler scheme with a split of the inertial term.
Definition: poro_explicit_cd_scheme.hpp:59
double mDeltaTime
Definition: poro_explicit_cd_scheme.hpp:742
ModelPart::NodeIterator NodeIterator
Definition fo the node iterator.
Definition: poro_explicit_cd_scheme.hpp:86
ModelPart::NodesContainerType NodesArrayType
Definition: poro_explicit_cd_scheme.hpp:77
double mAlpha
Definition: poro_explicit_cd_scheme.hpp:743
double mTheta
Definition: poro_explicit_cd_scheme.hpp:745
double mGCoefficient
Definition: poro_explicit_cd_scheme.hpp:746
std::size_t IndexType
Definition of the index type.
Definition: poro_explicit_cd_scheme.hpp:83
std::size_t SizeType
Definition of the size type.
Definition: poro_explicit_cd_scheme.hpp:80
virtual void CalculateAndAddRHS(ModelPart &rModelPart)
Definition: poro_explicit_cd_scheme.hpp:348
double mBeta
Definition: poro_explicit_cd_scheme.hpp:744
An explicit forward euler scheme with a split of the inertial term.
Definition: poro_explicit_vv_scheme.hpp:59
Scheme< TSparseSpace, TDenseSpace > BaseofBaseType
The definition of the base type.
Definition: poro_explicit_vv_scheme.hpp:66
void UpdateTranslationalDegreesOfFreedom(NodeIterator itCurrentNode, const IndexType DisplacementPosition, const SizeType DomainSize=3) override
This method updates the translation DoF.
Definition: poro_explicit_vv_scheme.hpp:283
BaseType::TSystemMatrixType TSystemMatrixType
Definition: poro_explicit_vv_scheme.hpp:71
PoroExplicitCDScheme< TSparseSpace, TDenseSpace > BaseType
Definition: poro_explicit_vv_scheme.hpp:67
void InitializeResidual(ModelPart &rModelPart) override
This method initializes the residual in the nodes of the model part.
Definition: poro_explicit_vv_scheme.hpp:170
PoroExplicitVVScheme()
Default constructor.
Definition: poro_explicit_vv_scheme.hpp:109
std::size_t IndexType
Definition of the index type.
Definition: poro_explicit_vv_scheme.hpp:84
ModelPart::NodesContainerType NodesArrayType
Definition: poro_explicit_vv_scheme.hpp:78
BaseType::TSystemVectorType TSystemVectorType
Definition: poro_explicit_vv_scheme.hpp:72
virtual ~PoroExplicitVVScheme()
Definition: poro_explicit_vv_scheme.hpp:117
void Predict(ModelPart &rModelPart, DofsArrayType &rDofSet, TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b) override
Performing the prediction of the solution.
Definition: poro_explicit_vv_scheme.hpp:189
ModelPart::NodeIterator NodeIterator
Definition fo the node iterator.
Definition: poro_explicit_vv_scheme.hpp:87
void CalculateRHSContribution(Element &rCurrentElement, LocalSystemVectorType &RHS_Contribution, Element::EquationIdVectorType &EquationId, const ProcessInfo &rCurrentProcessInfo) override
This function is designed to calculate just the RHS contribution.
Definition: poro_explicit_vv_scheme.hpp:338
std::size_t SizeType
Definition of the size type.
Definition: poro_explicit_vv_scheme.hpp:81
static constexpr double numerical_limit
The definition of the numerical limit.
Definition: poro_explicit_vv_scheme.hpp:90
void InitializeExplicitScheme(ModelPart &rModelPart, const SizeType DomainSize=3) override
This method initializes some rutines related with the explicit scheme.
Definition: poro_explicit_vv_scheme.hpp:128
BaseType::LocalSystemVectorType LocalSystemVectorType
Definition: poro_explicit_vv_scheme.hpp:73
ModelPart::ElementsContainerType ElementsArrayType
The arrays of elements and nodes.
Definition: poro_explicit_vv_scheme.hpp:76
ModelPart::ConditionsContainerType ConditionsArrayType
Definition: poro_explicit_vv_scheme.hpp:77
BaseType::DofsArrayType DofsArrayType
Some definitions related with the base class.
Definition: poro_explicit_vv_scheme.hpp:70
KRATOS_CLASS_POINTER_DEFINITION(PoroExplicitVVScheme)
Counted pointer of PoroExplicitVVScheme.
virtual void PredictTranslationalDegreesOfFreedom(NodeIterator itCurrentNode, const IndexType DisplacementPosition, const SizeType DomainSize=3)
This method updates the translation DoF.
Definition: poro_explicit_vv_scheme.hpp:238
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
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
virtual void EquationId(const Element &rElement, Element::EquationIdVectorType &rEquationId, const ProcessInfo &rCurrentProcessInfo)
This method gets the eqaution id corresponding to the current element.
Definition: scheme.h:636
typename TSparseSpace::VectorType TSystemVectorType
Vector type definition.
Definition: scheme.h:74
typename TDenseSpace::VectorType LocalSystemVectorType
Local system vector type definition.
Definition: scheme.h:80
This class implements a set of auxiliar, already parallelized, methods to perform some common tasks r...
Definition: variable_utils.h:63
void SetVariable(const TVarType &rVariable, const TDataType &rValue, NodesContainerType &rNodes, const unsigned int Step=0)
Sets the nodal value of a scalar variable.
Definition: variable_utils.h:675
#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
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
KratosZeroMatrix< double > ZeroMatrix
Definition: amatrix_interface.h:559
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
b
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:31
int j
Definition: quadrature.py:648
A
Definition: sensitivityMatrix.py:70
int dim
Definition: sensitivityMatrix.py:25
integer i
Definition: TensorModule.f:17