8 #if !defined(KRATOS_INCREMENTAL_UPDATE_STATIC_DAMPED_SMOOTHING_SCHEME )
9 #define KRATOS_INCREMENTAL_UPDATE_STATIC_DAMPED_SMOOTHING_SCHEME
19 template<
class TSparseSpace,
class TDenseSpace>
66 if(ierr != 0)
return ierr;
68 if ( RAYLEIGH_ALPHA.Key() == 0 )
69 KRATOS_THROW_ERROR( std::invalid_argument,
"RAYLEIGH_ALPHA has Key zero! (check if the application is correctly registered",
"" )
70 if ( RAYLEIGH_BETA.Key() == 0 )
71 KRATOS_THROW_ERROR( std::invalid_argument,
"RAYLEIGH_BETA has Key zero! (check if the application is correctly registered",
"" )
75 KRATOS_THROW_ERROR( std::invalid_argument,
"Some of the rayleigh coefficients has an invalid value ",
"" )
131 const int nnodes =
static_cast<int>( rModelPart.
Nodes().size() );
132 NodesArrayType::iterator NodeBegin = rModelPart.
Nodes().begin();
134 #pragma omp parallel for firstprivate(NodeBegin)
139 NodesArrayType::iterator itNode = NodeBegin +
i;
141 const array_1d<double, 3 > & PreviousAcceleration = (itNode)->FastGetSolutionStepValue(ACCELERATION, 1);
142 const array_1d<double, 3 > & PreviousVelocity = (itNode)->FastGetSolutionStepValue(VELOCITY, 1);
143 const array_1d<double, 3 > & PreviousDisplacement = (itNode)->FastGetSolutionStepValue(DISPLACEMENT, 1);
144 array_1d<double, 3 > & CurrentAcceleration = (itNode)->FastGetSolutionStepValue(ACCELERATION, 0);
146 array_1d<double, 3 > & CurrentDisplacement = (itNode)->FastGetSolutionStepValue(DISPLACEMENT, 0);
149 noalias(DeltaDisplacement) = CurrentDisplacement - PreviousDisplacement;
151 this->
UpdateVelocity (CurrentVelocity, DeltaDisplacement, PreviousVelocity, PreviousAcceleration);
153 this->
UpdateAcceleration (CurrentAcceleration, DeltaDisplacement, PreviousVelocity, PreviousAcceleration);
177 dof.GetSolutionStepValue() += TSparseSpace::GetValue(Dx, dof.EquationId());
187 const int nnodes =
static_cast<int>(rModelPart.
Nodes().size());
188 NodesArrayType::iterator NodeBegin = rModelPart.
Nodes().begin();
190 #pragma omp parallel for firstprivate(NodeBegin)
195 NodesArrayType::iterator itNode = NodeBegin +
i;
197 noalias(DeltaDisplacement) = (itNode)->FastGetSolutionStepValue(DISPLACEMENT) - (itNode)->FastGetSolutionStepValue(DISPLACEMENT, 1);
200 const array_1d<double, 3 > & PreviousVelocity = (itNode)->FastGetSolutionStepValue(VELOCITY, 1);
202 array_1d<double, 3 > & CurrentAcceleration = (itNode)->FastGetSolutionStepValue(ACCELERATION, 0);
203 const array_1d<double, 3 > & PreviousAcceleration = (itNode)->FastGetSolutionStepValue(ACCELERATION, 1);
205 this->
UpdateVelocity (CurrentVelocity, DeltaDisplacement, PreviousVelocity, PreviousAcceleration);
207 this->
UpdateAcceleration (CurrentAcceleration, DeltaDisplacement, PreviousVelocity, PreviousAcceleration);
Base class for all Elements.
Definition: element.h:60
virtual void GetFirstDerivativesVector(Vector &values, int Step=0) const
Definition: element.h:310
virtual void CalculateLeftHandSide(MatrixType &rLeftHandSideMatrix, const ProcessInfo &rCurrentProcessInfo)
Definition: element.h:423
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
virtual void CalculateLocalSystem(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo)
Definition: element.h:405
std::vector< std::size_t > EquationIdVectorType
Definition: element.h:98
Definition: incrementalupdate_static_damped_smoothing_scheme.hpp:22
BaseType::TSystemVectorType TSystemVectorType
Definition: incrementalupdate_static_damped_smoothing_scheme.hpp:30
ModelPart::NodesContainerType NodesArrayType
Definition: incrementalupdate_static_damped_smoothing_scheme.hpp:34
void CalculateSystemContributions(Element &rCurrentElement, LocalSystemMatrixType &LHS_Contribution, LocalSystemVectorType &RHS_Contribution, Element::EquationIdVectorType &EquationId, const ProcessInfo &CurrentProcessInfo) override
This function is designed to be called in the builder and solver to introduce the selected time integ...
Definition: incrementalupdate_static_damped_smoothing_scheme.hpp:217
double mNewmark4
Definition: incrementalupdate_static_damped_smoothing_scheme.hpp:298
BaseType::TSystemMatrixType TSystemMatrixType
Definition: incrementalupdate_static_damped_smoothing_scheme.hpp:29
BaseType::LocalSystemVectorType LocalSystemVectorType
Definition: incrementalupdate_static_damped_smoothing_scheme.hpp:31
double mNewmark5
Definition: incrementalupdate_static_damped_smoothing_scheme.hpp:298
KRATOS_CLASS_POINTER_DEFINITION(IncrementalUpdateStaticDampedSmoothingScheme)
double mRayleighAlpha
Definition: incrementalupdate_static_damped_smoothing_scheme.hpp:304
BaseType::DofsArrayType DofsArrayType
Definition: incrementalupdate_static_damped_smoothing_scheme.hpp:33
double mgamma
Definition: incrementalupdate_static_damped_smoothing_scheme.hpp:302
void Update(ModelPart &rModelPart, DofsArrayType &rDofSet, TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b) override
Performing the update of the solution.
Definition: incrementalupdate_static_damped_smoothing_scheme.hpp:161
void Calculate_LHS_Contribution(Element &rCurrentElement, LocalSystemMatrixType &LHS_Contribution, Element::EquationIdVectorType &EquationId, const ProcessInfo &CurrentProcessInfo)
Definition: incrementalupdate_static_damped_smoothing_scheme.hpp:271
double mNewmark2
Definition: incrementalupdate_static_damped_smoothing_scheme.hpp:298
void UpdateAcceleration(array_1d< double, 3 > &CurrentAcceleration, const array_1d< double, 3 > &DeltaDisplacement, const array_1d< double, 3 > &PreviousVelocity, const array_1d< double, 3 > &PreviousAcceleration)
Definition: incrementalupdate_static_damped_smoothing_scheme.hpp:355
void Initialize(ModelPart &r_model_part) override
This is the place to initialize the Scheme.
Definition: incrementalupdate_static_damped_smoothing_scheme.hpp:85
std::vector< Matrix > mDampingMatrix
Definition: incrementalupdate_static_damped_smoothing_scheme.hpp:307
double mNewmark1
Definition: incrementalupdate_static_damped_smoothing_scheme.hpp:298
int Check(ModelPart &r_model_part) override
Definition: incrementalupdate_static_damped_smoothing_scheme.hpp:61
void Predict(ModelPart &rModelPart, DofsArrayType &rDofSet, TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b) override
Performing the prediction of the solution.
Definition: incrementalupdate_static_damped_smoothing_scheme.hpp:114
double mDeltaTime
Definition: incrementalupdate_static_damped_smoothing_scheme.hpp:300
virtual ~IncrementalUpdateStaticDampedSmoothingScheme()
Destructor.
Definition: incrementalupdate_static_damped_smoothing_scheme.hpp:57
double mbeta
Definition: incrementalupdate_static_damped_smoothing_scheme.hpp:301
void Calculate_RHS_Contribution(Element &rCurrentElement, LocalSystemVectorType &RHS_Contribution, Element::EquationIdVectorType &EquationId, const ProcessInfo &CurrentProcessInfo)
Definition: incrementalupdate_static_damped_smoothing_scheme.hpp:245
BaseType::LocalSystemMatrixType LocalSystemMatrixType
Definition: incrementalupdate_static_damped_smoothing_scheme.hpp:32
double mRayleighBeta
Definition: incrementalupdate_static_damped_smoothing_scheme.hpp:305
IncrementalUpdateStaticDampedSmoothingScheme(double rayleigh_m, double rayleigh_k)
Constructor.
Definition: incrementalupdate_static_damped_smoothing_scheme.hpp:40
double mNewmark3
Definition: incrementalupdate_static_damped_smoothing_scheme.hpp:298
void AddDampingToLHS(LocalSystemMatrixType &LHS_Contribution, LocalSystemMatrixType &C, const ProcessInfo &CurrentProcessInfo)
Definition: incrementalupdate_static_damped_smoothing_scheme.hpp:312
std::vector< Vector > mVelocityVector
Definition: incrementalupdate_static_damped_smoothing_scheme.hpp:308
void AddDampingToRHS(Element &rCurrentElement, LocalSystemVectorType &RHS_Contribution, LocalSystemMatrixType &C, const ProcessInfo &CurrentProcessInfo)
Definition: incrementalupdate_static_damped_smoothing_scheme.hpp:323
void UpdateVelocity(array_1d< double, 3 > &CurrentVelocity, const array_1d< double, 3 > &DeltaDisplacement, const array_1d< double, 3 > &PreviousVelocity, const array_1d< double, 3 > &PreviousAcceleration)
Definition: incrementalupdate_static_damped_smoothing_scheme.hpp:342
double mNewmark0
Definition: incrementalupdate_static_damped_smoothing_scheme.hpp:298
Scheme< TSparseSpace, TDenseSpace > BaseType
Definition: incrementalupdate_static_damped_smoothing_scheme.hpp:28
Definition: incrementalupdate_static_smoothing_scheme.hpp:21
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
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
static void DivideInPartitions(const int NumTerms, const int NumThreads, PartitionVector &Partitions)
Divide an array of length NumTerms between NumThreads threads.
Definition: openmp_utils.h:158
static int ThisThread()
Wrapper for omp_get_thread_num().
Definition: openmp_utils.h:108
std::vector< int > PartitionVector
Vector type for the output of DivideInPartitions method.
Definition: openmp_utils.h:53
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
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
BaseType::LocalSystemMatrixType LocalSystemMatrixType
Local system vector type definition.
Definition: residualbased_incrementalupdate_static_scheme.h:84
BaseType::TSystemMatrixType TSystemMatrixType
Matrix type definition.
Definition: residualbased_incrementalupdate_static_scheme.h:78
BaseType::TSystemVectorType TSystemVectorType
Vector type definition.
Definition: residualbased_incrementalupdate_static_scheme.h:80
BaseType::LocalSystemVectorType LocalSystemVectorType
Local system matrix type definition.
Definition: residualbased_incrementalupdate_static_scheme.h:82
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
typename TDenseSpace::MatrixType LocalSystemMatrixType
Local system matrix type definition.
Definition: scheme.h:77
bool mSchemeIsInitialized
Definition: scheme.h:755
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
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
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
int C
Definition: generate_hyper_elastic_simo_taylor_neo_hookean.py:27
b
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:31
int dof
Definition: ode_solve.py:393
A
Definition: sensitivityMatrix.py:70
int nnodes
Definition: sensitivityMatrix.py:24
integer i
Definition: TensorModule.f:17