79 template<
class TSparseSpace,
116 :
Scheme<TSparseSpace, TDenseSpace>()
167 i_dof->GetSolutionStepValue() += Dx[i_dof->EquationId()];
177 noalias(DeltaDisp) = (
i)->FastGetSolutionStepValue(DISPLACEMENT) - (
i)->FastGetSolutionStepValue(DISPLACEMENT, 1);
184 UpdateVelocity(CurrentVelocity, DeltaDisp, OldVelocity, OldAcceleration);
207 std::cout <<
"prediction" << std::endl;
222 if ((
i->pGetDof(DISPLACEMENT_X))->IsFixed() ==
false)
223 (CurrentDisp[0]) = OldDisp[0] + DeltaTime * OldVelocity[0];
224 if (
i->pGetDof(DISPLACEMENT_Y)->IsFixed() ==
false)
225 (CurrentDisp[1]) = OldDisp[1] + DeltaTime * OldVelocity[1];
226 if (
i->HasDofFor(DISPLACEMENT_Z))
227 if (
i->pGetDof(DISPLACEMENT_Z)->IsFixed() ==
false)
228 (CurrentDisp[2]) = OldDisp[2] + DeltaTime * OldVelocity[2];
232 noalias(DeltaDisp) = CurrentDisp - OldDisp;
238 UpdateVelocity(CurrentVelocity, DeltaDisp, OldVelocity, OldAcceleration);
363 double DeltaTime = CurrentProcessInfo[DELTA_TIME];
366 KRATOS_THROW_ERROR( std::logic_error,
"detected delta_time = 0 in the Bossak Scheme ... check if the time step is created correctly for the current model part",
"" )
390 if (err != 0)
return err;
393 for (
const auto& r_node : r_model_part.
Nodes())
395 if (r_node.SolutionStepsDataHas(DISPLACEMENT) ==
false)
396 KRATOS_THROW_ERROR( std::logic_error,
"DISPLACEMENT variable is not allocated for node ", r_node.Id() )
397 if (r_node.SolutionStepsDataHas(VELOCITY) ==
false)
398 KRATOS_THROW_ERROR( std::logic_error,
"DISPLACEMENT variable is not allocated for node ", r_node.Id() )
399 if (r_node.SolutionStepsDataHas(ACCELERATION) ==
false)
400 KRATOS_THROW_ERROR( std::logic_error,
"DISPLACEMENT variable is not allocated for node ", r_node.Id() )
404 for (
const auto& r_node : r_model_part.
Nodes())
406 if (r_node.HasDofFor(DISPLACEMENT_X) ==
false)
407 KRATOS_THROW_ERROR( std::invalid_argument,
"missing DISPLACEMENT_X dof on node ", r_node.Id() )
408 if (r_node.HasDofFor(DISPLACEMENT_Y) ==
false)
409 KRATOS_THROW_ERROR( std::invalid_argument,
"missing DISPLACEMENT_Y dof on node ", r_node.Id() )
410 if (r_node.HasDofFor(DISPLACEMENT_Z) ==
false)
411 KRATOS_THROW_ERROR( std::invalid_argument,
"missing DISPLACEMENT_Z dof on node ", r_node.Id() )
417 KRATOS_THROW_ERROR( std::logic_error,
"Value not admissible for AlphaBossak. Admissible values should be between 0.0 and -0.3. Current value is ",
mAlphaBossak )
422 KRATOS_THROW_ERROR( std::logic_error,
"insufficient buffer size. Buffer size should be greater than 2. Current size is", r_model_part.
GetBufferSize() )
492 noalias(CurrentVelocity) =
ma1 * DeltaDisp -
ma4 * OldVelocity -
ma5*OldAcceleration;
505 noalias(CurrentAcceleration) =
ma0 * DeltaDisp -
ma2 * OldVelocity -
ma3*OldAcceleration;
547 const auto& r_const_elem_ref = rCurrentElement;
565 const auto& r_const_cond_ref = rCurrentCondition;
Base class for all Conditions.
Definition: condition.h:59
virtual void GetFirstDerivativesVector(Vector &values, int Step=0) const
Definition: condition.h:313
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 EquationIdVector(EquationIdVectorType &rResult, const ProcessInfo &rCurrentProcessInfo) const
Definition: condition.h:260
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 GetFirstDerivativesVector(Vector &values, int Step=0) const
Definition: element.h:310
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
virtual void EquationIdVector(EquationIdVectorType &rResult, const ProcessInfo &rCurrentProcessInfo) const
Definition: element.h:258
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
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
IndexType GetBufferSize() const
This method gets the suffer size of the model part database.
Definition: model_part.h:1876
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
NodeIterator NodesEnd(IndexType ThisIndex=0)
Definition: model_part.h:497
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
static int ThisThread()
Wrapper for omp_get_thread_num().
Definition: openmp_utils.h:108
static int GetNumThreads()
Returns the current number of threads.
Definition: parallel_utilities.cpp:34
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
boost::indirect_iterator< typename TContainerType::iterator > iterator
Definition: pointer_vector_set.h:95
iterator begin()
Returns an iterator pointing to the beginning of the container.
Definition: pointer_vector_set.h:278
iterator end()
Returns an iterator pointing to the end of the container.
Definition: pointer_vector_set.h:314
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
Definition: residual_based_relaxation_scheme.hpp:83
Element::DofsVectorType DofsVectorType
Definition: residual_based_relaxation_scheme.hpp:97
double mdamping_factor
Definition: residual_based_relaxation_scheme.hpp:475
void UpdateAcceleration(array_1d< double, 3 > &CurrentAcceleration, const array_1d< double, 3 > &DeltaDisp, const array_1d< double, 3 > &OldVelocity, const array_1d< double, 3 > &OldAcceleration)
Definition: residual_based_relaxation_scheme.hpp:499
Scheme< TSparseSpace, TDenseSpace > BaseType
Definition: residual_based_relaxation_scheme.hpp:91
void AddDynamicsToLHS(LocalSystemMatrixType &LHS_Contribution, LocalSystemMatrixType &D, LocalSystemMatrixType &M, const ProcessInfo &CurrentProcessInfo)
Definition: residual_based_relaxation_scheme.hpp:517
BaseType::LocalSystemMatrixType LocalSystemMatrixType
Definition: residual_based_relaxation_scheme.hpp:105
int Check(const ModelPart &r_model_part) const override
Definition: residual_based_relaxation_scheme.hpp:385
void AddDynamicsToRHS(Condition &rCurrentCondition, LocalSystemVectorType &RHS_Contribution, LocalSystemMatrixType &D, LocalSystemMatrixType &M, const ProcessInfo &CurrentProcessInfo)
Definition: residual_based_relaxation_scheme.hpp:554
void CalculateRHSContribution(Element &rCurrentElement, LocalSystemVectorType &RHS_Contribution, Element::EquationIdVectorType &EquationId, const ProcessInfo &CurrentProcessInfo) override
This function is designed to calculate just the RHS contribution.
Definition: residual_based_relaxation_scheme.hpp:285
void Update(ModelPart &r_model_part, DofsArrayType &rDofSet, TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b) override
Definition: residual_based_relaxation_scheme.hpp:152
void CalculateSystemContributions(Condition &rCurrentCondition, LocalSystemMatrixType &LHS_Contribution, LocalSystemVectorType &RHS_Contribution, Element::EquationIdVectorType &EquationId, const ProcessInfo &CurrentProcessInfo) override
Definition: residual_based_relaxation_scheme.hpp:308
std::vector< Vector > mvel
Definition: residual_based_relaxation_scheme.hpp:473
ResidualBasedRelaxationScheme(double NewAlphaBossak, double damping_factor)
Definition: residual_based_relaxation_scheme.hpp:115
double mGammaNewmark
Definition: residual_based_relaxation_scheme.hpp:461
std::vector< Matrix > mMass
Definition: residual_based_relaxation_scheme.hpp:471
double ma1
Definition: residual_based_relaxation_scheme.hpp:464
double ma4
Definition: residual_based_relaxation_scheme.hpp:467
double ma0
Definition: residual_based_relaxation_scheme.hpp:463
BaseType::TSystemVectorType TSystemVectorType
Definition: residual_based_relaxation_scheme.hpp:101
std::vector< Matrix > mDamp
Definition: residual_based_relaxation_scheme.hpp:472
double ma3
Definition: residual_based_relaxation_scheme.hpp:466
double mam
Definition: residual_based_relaxation_scheme.hpp:469
void CalculateSystemContributions(Element &rCurrentElement, LocalSystemMatrixType &LHS_Contribution, LocalSystemVectorType &RHS_Contribution, Element::EquationIdVectorType &EquationId, const ProcessInfo &CurrentProcessInfo) override
Definition: residual_based_relaxation_scheme.hpp:259
void UpdateVelocity(array_1d< double, 3 > &CurrentVelocity, const array_1d< double, 3 > &DeltaDisp, const array_1d< double, 3 > &OldVelocity, const array_1d< double, 3 > &OldAcceleration)
Definition: residual_based_relaxation_scheme.hpp:487
BaseType::LocalSystemVectorType LocalSystemVectorType
Definition: residual_based_relaxation_scheme.hpp:103
void InitializeSolutionStep(ModelPart &r_model_part, TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b) override
Function called once at the beginning of each solution step.
Definition: residual_based_relaxation_scheme.hpp:352
void CalculateRHSContribution(Condition &rCurrentCondition, LocalSystemVectorType &RHS_Contribution, Element::EquationIdVectorType &EquationId, const ProcessInfo &CurrentProcessInfo) override
Functions totally analogous to the precedent but applied to the "condition" objects.
Definition: residual_based_relaxation_scheme.hpp:329
~ResidualBasedRelaxationScheme() override
Definition: residual_based_relaxation_scheme.hpp:136
BaseType::DofsArrayType DofsArrayType
Definition: residual_based_relaxation_scheme.hpp:95
BaseType::TSystemMatrixType TSystemMatrixType
Definition: residual_based_relaxation_scheme.hpp:99
double mBetaNewmark
Definition: residual_based_relaxation_scheme.hpp:460
KRATOS_CLASS_POINTER_DEFINITION(ResidualBasedRelaxationScheme)
double mAlphaBossak
Definition: residual_based_relaxation_scheme.hpp:459
BaseType::TDataType TDataType
Definition: residual_based_relaxation_scheme.hpp:93
double ma5
Definition: residual_based_relaxation_scheme.hpp:468
void Predict(ModelPart &r_model_part, DofsArrayType &rDofSet, TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b) override
Performing the prediction of the solution.
Definition: residual_based_relaxation_scheme.hpp:199
void AddDynamicsToRHS(Element &rCurrentElement, LocalSystemVectorType &RHS_Contribution, LocalSystemMatrixType &D, LocalSystemMatrixType &M, const ProcessInfo &CurrentProcessInfo)
Definition: residual_based_relaxation_scheme.hpp:536
double ma2
Definition: residual_based_relaxation_scheme.hpp:465
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
virtual void InitializeSolutionStep(ModelPart &rModelPart, TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b)
Function called once at the beginning of each solution step.
Definition: scheme.h:272
typename TSparseSpace::DataType TDataType
Data type definition.
Definition: scheme.h:68
typename TDenseSpace::MatrixType LocalSystemMatrixType
Local system matrix type definition.
Definition: scheme.h:77
virtual int Check(const ModelPart &rModelPart) const
This function is designed to be called once to perform all the checks needed on the input provided....
Definition: scheme.h:508
#define KRATOS_THROW_ERROR(ExceptionType, ErrorMessage, MoreInfo)
Definition: define.h:77
#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
AMatrix::MatrixProductExpression< TExpression1Type, TExpression2Type > prod(AMatrix::MatrixExpression< TExpression1Type, TCategory1 > const &First, AMatrix::MatrixExpression< TExpression2Type, TCategory2 > const &Second)
Definition: amatrix_interface.h:568
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
b
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:31
int k
Definition: quadrature.py:595
def num_threads
Definition: script.py:75
A
Definition: sensitivityMatrix.py:70
integer i
Definition: TensorModule.f:17