15 #if !defined(KRATOS_MPM_RESIDUAL_BASED_BOSSAK_SCHEME )
16 #define KRATOS_MPM_RESIDUAL_BASED_BOSSAK_SCHEME
48 template<
class TSparseSpace,
class TDenseSpace >
103 unsigned int BlockSize,
double Alpha = 0.0,
104 double NewmarkBeta = 0.25,
bool IsDynamic =
true)
171 const int num_nodes =
static_cast<int>( rModelPart.
Nodes().size() );
172 const auto it_node_begin = rModelPart.
Nodes().begin();
174 #pragma omp parallel for
175 for(
int i = 0;
i < num_nodes; ++
i) {
176 auto it_node = it_node_begin +
i;
179 const array_1d<double, 3 > & r_delta_displacement = it_node->FastGetSolutionStepValue(DISPLACEMENT);
182 const array_1d<double, 3>& r_previous_velocity = it_node->FastGetSolutionStepValue(VELOCITY, 1);
184 array_1d<double, 3>& r_current_acceleration = it_node->FastGetSolutionStepValue(ACCELERATION);
185 const array_1d<double, 3>& r_previous_acceleration = it_node->FastGetSolutionStepValue(ACCELERATION, 1);
214 #pragma omp parallel for
215 for(
int iter = 0; iter < static_cast<int>(rModelPart.
Nodes().size()); ++iter)
218 const array_1d<double, 3 > & r_previous_displacement = (
i)->FastGetSolutionStepValue(DISPLACEMENT, 1);
220 const array_1d<double, 3 > & r_previous_acceleration = (
i)->FastGetSolutionStepValue(ACCELERATION, 1);
225 if (!(
i->pGetDof(DISPLACEMENT_X)->IsFixed()))
226 r_current_displacement[0] = 0.0;
228 r_current_displacement[0] = r_previous_displacement[0];
230 if (!(
i->pGetDof(DISPLACEMENT_Y)->IsFixed()))
231 r_current_displacement[1] = 0.0;
233 r_current_displacement[1] = r_previous_displacement[1];
235 if (
i->HasDofFor(DISPLACEMENT_Z))
237 if (!(
i->pGetDof(DISPLACEMENT_Z)->IsFixed()))
238 r_current_displacement[2] = 0.0;
240 r_current_displacement[2] = r_previous_displacement[2];
244 if (
i->HasDofFor(PRESSURE))
246 double& r_current_pressure = (
i)->FastGetSolutionStepValue(PRESSURE);
247 const double& r_previous_pressure = (
i)->FastGetSolutionStepValue(PRESSURE, 1);
249 if (!(
i->pGetDof(PRESSURE))->IsFixed())
250 r_current_pressure = r_previous_pressure;
299 #pragma omp parallel for
305 double & r_nodal_mass = (
i)->FastGetSolutionStepValue(NODAL_MASS);
313 double & r_nodal_old_pressure = (
i)->FastGetSolutionStepValue(PRESSURE,1);
314 double & r_nodal_pressure = (
i)->FastGetSolutionStepValue(PRESSURE);
318 r_nodal_momentum.
clear();
319 r_nodal_inertia.
clear();
321 r_nodal_displacement.
clear();
322 r_nodal_velocity.
clear();
323 r_nodal_acceleration.
clear();
324 r_nodal_old_pressure = 0.0;
325 r_nodal_pressure = 0.0;
328 if ((
i)->SolutionStepsDataHas(NODAL_AREA)){
329 double & r_nodal_area = (
i)->FastGetSolutionStepValue(NODAL_AREA);
332 if(
i->SolutionStepsDataHas(NODAL_MPRESSURE)) {
333 double & r_nodal_mpressure = (
i)->FastGetSolutionStepValue(NODAL_MPRESSURE);
334 r_nodal_mpressure = 0.0;
342 #pragma omp parallel for
346 const double & r_nodal_mass = (
i)->FastGetSolutionStepValue(NODAL_MASS);
348 if (r_nodal_mass > std::numeric_limits<double>::epsilon())
355 double & r_nodal_pressure = (
i)->FastGetSolutionStepValue(PRESSURE,1);
357 double delta_nodal_pressure = 0.0;
360 if (
i->HasDofFor(PRESSURE) &&
i->SolutionStepsDataHas(NODAL_MPRESSURE))
362 double & nodal_mpressure = (
i)->FastGetSolutionStepValue(NODAL_MPRESSURE);
363 delta_nodal_pressure = nodal_mpressure/r_nodal_mass;
369 r_nodal_velocity += delta_nodal_velocity;
370 r_nodal_acceleration += delta_nodal_acceleration;
372 r_nodal_pressure += delta_nodal_pressure;
377 const double delta_time = r_current_process_info[DELTA_TIME];
408 const auto& rConstElemRef = rCurrentElement;
410 rConstElemRef.EquationIdVector(
EquationId,rCurrentProcessInfo);
444 const auto& r_const_elem_ref = rCurrentElement;
448 r_const_elem_ref.EquationIdVector(
EquationId,rCurrentProcessInfo);
483 const auto& r_const_cond_ref = rCurrentCondition;
486 r_const_cond_ref.EquationIdVector(
EquationId,rCurrentProcessInfo);
519 const auto& r_const_cond_ref = rCurrentCondition;
521 r_const_cond_ref.EquationIdVector(
EquationId,rCurrentProcessInfo);
552 #pragma omp parallel for
555 (
i)->FastGetSolutionStepValue(REACTION).clear();
Base class for all Conditions.
Definition: condition.h:59
virtual void CalculateMassMatrix(MatrixType &rMassMatrix, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:574
virtual void CalculateDampingMatrix(MatrixType &rDampingMatrix, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:586
virtual void CalculateRightHandSide(VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:440
virtual void CalculateLocalSystem(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:408
Base class for all Elements.
Definition: element.h:60
virtual void CalculateMassMatrix(MatrixType &rMassMatrix, const ProcessInfo &rCurrentProcessInfo)
Definition: element.h:570
virtual void CalculateRightHandSide(VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo)
Definition: element.h:437
virtual void CalculateDampingMatrix(MatrixType &rDampingMatrix, const ProcessInfo &rCurrentProcessInfo)
Definition: element.h:583
std::vector< DofType::Pointer > DofsVectorType
Definition: element.h:100
virtual void CalculateLocalSystem(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo)
Definition: element.h:405
std::vector< std::size_t > EquationIdVectorType
Definition: element.h:98
GeometryType & GetGeometry()
Returns the reference of the geometry.
Definition: geometrical_object.h:158
void Rotate(TLocalMatrixType &rLocalMatrix, TLocalVectorType &rLocalVector, GeometryType &rGeometry) const override
Rotate the local system contributions so that they are oriented with each node's normal.
Definition: mpm_boundary_rotation_utility.h:105
virtual void RotateDisplacements(ModelPart &rModelPart) const
Same functionalities as RotateVelocities, just to have a clear function naming.
Definition: mpm_boundary_rotation_utility.h:293
void ElementApplySlipCondition(TLocalMatrixType &rLocalMatrix, TLocalVectorType &rLocalVector, GeometryType &rGeometry) const
Definition: mpm_boundary_rotation_utility.h:189
void CalculateReactionForces(ModelPart &rModelPart)
Definition: mpm_boundary_rotation_utility.h:381
void RotateRHS(TLocalVectorType &rLocalVector, GeometryType &rGeometry) const
RHS only version of Rotate.
Definition: mpm_boundary_rotation_utility.h:124
void ConditionApplySlipCondition(TLocalMatrixType &rLocalMatrix, TLocalVectorType &rLocalVector, GeometryType &rGeometry) const
Definition: mpm_boundary_rotation_utility.h:214
virtual void RecoverDisplacements(ModelPart &rModelPart) const
Same functionalities as RecoverVelocities, just to have a clear function naming.
Definition: mpm_boundary_rotation_utility.h:338
Bossak integration scheme (for linear and nonlinear dynamic problems) for displacements adjusted for ...
Definition: mpm_residual_based_bossak_scheme.hpp:51
MPMResidualBasedBossakScheme(ModelPart &rGridModelPart, unsigned int DomainSize, unsigned int BlockSize, double Alpha=0.0, double NewmarkBeta=0.25, bool IsDynamic=true)
Constructor. @detail The MPM bossak method.
Definition: mpm_residual_based_bossak_scheme.hpp:102
BaseType::Pointer BaseTypePointer
Definition: mpm_residual_based_bossak_scheme.hpp:81
bool mIsDynamic
Definition: mpm_residual_based_bossak_scheme.hpp:543
TSparseSpace::DofUpdaterPointerType mpDofUpdater
Definition: residual_based_bossak_displacement_scheme.hpp:490
void InitializeSolutionStep(ModelPart &rModelPart, TSystemMatrixType &rA, TSystemVectorType &rDx, TSystemVectorType &rb) override
It initializes time step solution for MPM simulations.
Definition: mpm_residual_based_bossak_scheme.hpp:290
BossakBaseType::LocalSystemMatrixType LocalSystemMatrixType
Definition: mpm_residual_based_bossak_scheme.hpp:75
BossakBaseType::DofsArrayType DofsArrayType
Definition: mpm_residual_based_bossak_scheme.hpp:65
void CalculateSystemContributions(Element &rCurrentElement, LocalSystemMatrixType &LHS_Contribution, LocalSystemVectorType &RHS_Contribution, Element::EquationIdVectorType &EquationId, const ProcessInfo &rCurrentProcessInfo) override
This function is designed to be called in the builder and solver to introduce the selected time integ...
Definition: mpm_residual_based_bossak_scheme.hpp:398
void Update(ModelPart &rModelPart, DofsArrayType &rDofSet, TSystemMatrixType &rA, TSystemVectorType &rDx, TSystemVectorType &rb) override
Performing the update of the solution.
Definition: mpm_residual_based_bossak_scheme.hpp:152
void Predict(ModelPart &rModelPart, DofsArrayType &rDofSet, TSystemMatrixType &rA, TSystemVectorType &rDx, TSystemVectorType &rb) override
Performing the prediction of the solution.
Definition: mpm_residual_based_bossak_scheme.hpp:205
Element::DofsVectorType DofsVectorType
Definition: mpm_residual_based_bossak_scheme.hpp:67
void ClearReaction() const
Definition: mpm_residual_based_bossak_scheme.hpp:550
virtual ~MPMResidualBasedBossakScheme()
Definition: mpm_residual_based_bossak_scheme.hpp:137
void FinalizeNonLinIteration(ModelPart &rModelPart, TSystemMatrixType &rA, TSystemVectorType &rDx, TSystemVectorType &rb) override
Function to be called when it is needed to finalize an iteration. It is designed to be called at the ...
Definition: mpm_residual_based_bossak_scheme.hpp:268
ModelPart::ConditionsContainerType ConditionsArrayType
Definition: mpm_residual_based_bossak_scheme.hpp:79
ModelPart & mGridModelPart
Definition: mpm_residual_based_bossak_scheme.hpp:540
BaseTypePointer Clone() override
Clone method.
Definition: mpm_residual_based_bossak_scheme.hpp:129
GeneralMatrices mMatrix
Definition: residual_based_implicit_time_scheme.h:351
void CalculateSystemContributions(Condition &rCurrentCondition, LocalSystemMatrixType &LHS_Contribution, LocalSystemVectorType &RHS_Contribution, Element::EquationIdVectorType &EquationId, const ProcessInfo &rCurrentProcessInfo) override
Functions totally analogous to the precedent but applied to the "condition" objects.
Definition: mpm_residual_based_bossak_scheme.hpp:472
unsigned int mDomainSize
Definition: mpm_residual_based_bossak_scheme.hpp:546
KRATOS_CLASS_POINTER_DEFINITION(MPMResidualBasedBossakScheme)
BossakBaseType::LocalSystemVectorType LocalSystemVectorType
Definition: mpm_residual_based_bossak_scheme.hpp:73
ModelPart::ElementsContainerType ElementsArrayType
Definition: mpm_residual_based_bossak_scheme.hpp:77
unsigned int mBlockSize
Definition: mpm_residual_based_bossak_scheme.hpp:547
BossakBaseType::TSystemMatrixType TSystemMatrixType
Definition: mpm_residual_based_bossak_scheme.hpp:69
BossakBaseType::TSystemVectorType TSystemVectorType
Definition: mpm_residual_based_bossak_scheme.hpp:71
ResidualBasedImplicitTimeScheme< TSparseSpace, TDenseSpace > ImplicitBaseType
Definition: mpm_residual_based_bossak_scheme.hpp:59
void CalculateRHSContribution(Condition &rCurrentCondition, LocalSystemVectorType &RHS_Contribution, Element::EquationIdVectorType &EquationId, const ProcessInfo &rCurrentProcessInfo) override
Functions that calculates the RHS of a "condition" object.
Definition: mpm_residual_based_bossak_scheme.hpp:510
Scheme< TSparseSpace, TDenseSpace > BaseType
Definition: mpm_residual_based_bossak_scheme.hpp:57
BossakBaseType::TDataType TDataType
Definition: mpm_residual_based_bossak_scheme.hpp:63
ResidualBasedBossakDisplacementScheme< TSparseSpace, TDenseSpace > BossakBaseType
Definition: mpm_residual_based_bossak_scheme.hpp:61
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: mpm_residual_based_bossak_scheme.hpp:434
MPMBoundaryRotationUtility< LocalSystemMatrixType, LocalSystemVectorType > mRotationTool
Definition: mpm_residual_based_bossak_scheme.hpp:548
MPMResidualBasedBossakScheme(MPMResidualBasedBossakScheme &rOther)
Copy Constructor.
Definition: mpm_residual_based_bossak_scheme.hpp:119
BossakAlphaMethod mBossak
Bossak Alpha parameters.
Definition: residual_based_bossak_displacement_scheme.hpp:532
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
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
static int ThisThread()
Wrapper for omp_get_thread_num().
Definition: openmp_utils.h:108
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
Bossak integration scheme (for linear and nonlinear dynamic problems) for displacements.
Definition: residual_based_bossak_displacement_scheme.hpp:43
TSparseSpace::DofUpdaterPointerType mpDofUpdater
Definition: residual_based_bossak_displacement_scheme.hpp:490
void UpdateVelocity(array_1d< double, 3 > &rCurrentVelocity, const array_1d< double, 3 > &rDeltaDisplacement, const array_1d< double, 3 > &rPreviousVelocity, const array_1d< double, 3 > &rPreviousAcceleration)
Update the first time derivative.
Definition: residual_based_bossak_displacement_scheme.hpp:549
void UpdateAcceleration(array_1d< double, 3 > &rCurrentAcceleration, const array_1d< double, 3 > &rDeltaDisplacement, const array_1d< double, 3 > &rPreviousVelocity, const array_1d< double, 3 > &rPreviousAcceleration)
Update the second time derivative.
Definition: residual_based_bossak_displacement_scheme.hpp:565
typename ImplicitBaseType::TSystemMatrixType TSystemMatrixType
Type for the system matrix within ImplicitBaseType.
Definition: residual_based_bossak_displacement_scheme.hpp:69
typename ImplicitBaseType::LocalSystemMatrixType LocalSystemMatrixType
Type for local system matrices within ImplicitBaseType.
Definition: residual_based_bossak_displacement_scheme.hpp:78
typename ImplicitBaseType::LocalSystemVectorType LocalSystemVectorType
Type for local system vectors within ImplicitBaseType.
Definition: residual_based_bossak_displacement_scheme.hpp:75
typename ImplicitBaseType::TSystemVectorType TSystemVectorType
Type for the system vector within ImplicitBaseType.
Definition: residual_based_bossak_displacement_scheme.hpp:72
void AddDynamicsToLHS(LocalSystemMatrixType &LHS_Contribution, LocalSystemMatrixType &D, LocalSystemMatrixType &M, const ProcessInfo &rCurrentProcessInfo) override
Add dynamic left hand side contribution from Element s.
Definition: residual_based_bossak_displacement_scheme.hpp:582
void AddDynamicsToRHS(Element &rElement, LocalSystemVectorType &RHS_Contribution, LocalSystemMatrixType &D, LocalSystemMatrixType &M, const ProcessInfo &rCurrentProcessInfo) override
Add dynamic right hand side contribution from an Element.
Definition: residual_based_bossak_displacement_scheme.hpp:606
typename ImplicitBaseType::TDataType TDataType
Data type used within the ImplicitBaseType.
Definition: residual_based_bossak_displacement_scheme.hpp:60
BossakAlphaMethod mBossak
Bossak Alpha parameters.
Definition: residual_based_bossak_displacement_scheme.hpp:532
typename ImplicitBaseType::DofsArrayType DofsArrayType
Array type for degrees of freedom within ImplicitBaseType.
Definition: residual_based_bossak_displacement_scheme.hpp:63
typename BaseType::Pointer BaseTypePointer
Pointer type for the BaseType.
Definition: residual_based_bossak_displacement_scheme.hpp:93
This is the base class for the implicit time schemes.
Definition: residual_based_implicit_time_scheme.h:55
void InitializeSolutionStep(ModelPart &rModelPart, TSystemMatrixType &rA, TSystemVectorType &rDx, TSystemVectorType &rb) override
It initializes time step solution. Only for reasons if the time step solution is restarted.
Definition: residual_based_implicit_time_scheme.h:245
GeneralMatrices mMatrix
Definition: residual_based_implicit_time_scheme.h:351
std::size_t IndexType
Index type definition.
Definition: residual_based_implicit_time_scheme.h:89
This class provides the implementation of the basic tasks that are needed by the solution strategy.
Definition: scheme.h:56
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
virtual void FinalizeNonLinIteration(ModelPart &rModelPart, TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b)
Function to be called when it is needed to finalize an iteration. It is designed to be called at the ...
Definition: scheme.h:393
BOOST_UBLAS_INLINE void clear()
Definition: array_1d.h:325
#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
delta_time
Definition: generate_frictional_mortar_condition.py:130
def Alpha(n, j)
Definition: quadrature.py:93
integer i
Definition: TensorModule.f:17
double c2
Definition: residual_based_bossak_displacement_scheme.hpp:505
double c4
Definition: residual_based_bossak_displacement_scheme.hpp:505
double c0
System constants.
Definition: residual_based_bossak_displacement_scheme.hpp:505
double beta
Bossak Beta.
Definition: residual_based_bossak_displacement_scheme.hpp:499
double c1
Definition: residual_based_bossak_displacement_scheme.hpp:505
double c3
Definition: residual_based_bossak_displacement_scheme.hpp:505
double c5
Definition: residual_based_bossak_displacement_scheme.hpp:505
double gamma
Bossak Gamma.
Definition: residual_based_bossak_displacement_scheme.hpp:502
std::vector< Matrix > M
Definition: residual_based_implicit_time_scheme.h:347
std::vector< Matrix > D
First derivative matrix (usually mass matrix)
Definition: residual_based_implicit_time_scheme.h:348