25 template <
class TSparseSpace,
class TDenseSpace>
75 const std::vector<std::string> components = {
"X",
"Y",
"Z"};
77 for (
const auto& component : components) {
78 const auto& instance_component =
81 if (!rNode.
HasDofFor(instance_component))
continue;
89 const double current_first_time_derivative =
91 const double previous_first_time_derivative =
93 const double current_second_time_derivative =
95 const double previous_second_time_derivative =
98 if (rNode.
IsFixed(second_time_derivative_component)) {
100 previous_variable + this->
GetDeltaTime() * previous_first_time_derivative +
102 ((0.5 - this->
GetBeta()) * previous_second_time_derivative +
103 this->
GetBeta() * current_second_time_derivative);
104 }
else if (rNode.
IsFixed(first_time_derivative_component)) {
108 (current_first_time_derivative - previous_first_time_derivative) +
109 previous_first_time_derivative);
110 }
else if (!rNode.
IsFixed(instance_component)) {
112 previous_variable + this->
GetDeltaTime() * previous_first_time_derivative +
134 this->
AddDynamicsToLHS(LHS_Contribution, mMassMatrix[thread], mDampingMatrix[thread], CurrentProcessInfo);
136 this->
AddDynamicsToRHS(rCurrentCondition, RHS_Contribution, mMassMatrix[thread],
137 mDampingMatrix[thread], CurrentProcessInfo);
160 this->
AddDynamicsToLHS(LHS_Contribution, mMassMatrix[thread], mDampingMatrix[thread], CurrentProcessInfo);
162 this->
AddDynamicsToRHS(rCurrentElement, RHS_Contribution, mMassMatrix[thread],
163 mDampingMatrix[thread], CurrentProcessInfo);
185 this->
AddDynamicsToRHS(rCurrentElement, RHS_Contribution, mMassMatrix[thread],
186 mDampingMatrix[thread], CurrentProcessInfo);
208 this->
AddDynamicsToRHS(rCurrentCondition, rRHS_Contribution, mMassMatrix[thread],
209 mDampingMatrix[thread], rCurrentProcessInfo);
231 this->
AddDynamicsToLHS(LHS_Contribution, mMassMatrix[thread], mDampingMatrix[thread], CurrentProcessInfo);
253 this->
AddDynamicsToLHS(LHS_Contribution, mMassMatrix[thread], mDampingMatrix[thread], CurrentProcessInfo);
291 if (M.size1() != 0) {
293 noalias(RHS_Contribution) -=
prod(M, mAccelerationVector[thread]);
297 if (
C.size1() != 0) {
299 noalias(RHS_Contribution) -=
prod(
C, mVelocityVector[thread]);
316 if (M.size1() != 0) {
318 noalias(RHS_Contribution) -=
prod(M, mAccelerationVector[thread]);
322 if (
C.size1() != 0) {
324 noalias(RHS_Contribution) -=
prod(
C, mVelocityVector[thread]);
331 std::vector<Matrix> mMassMatrix;
332 std::vector<Vector> mAccelerationVector;
333 std::vector<Matrix> mDampingMatrix;
334 std::vector<Vector> mVelocityVector;
Base class for all Conditions.
Definition: condition.h:59
virtual void GetSecondDerivativesVector(Vector &values, int Step=0) const
Definition: condition.h:323
virtual void GetFirstDerivativesVector(Vector &values, int Step=0) const
Definition: condition.h:313
virtual void CalculateLeftHandSide(MatrixType &rLeftHandSideMatrix, const ProcessInfo &rCurrentProcessInfo)
Definition: condition.h:426
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 CalculateLeftHandSide(MatrixType &rLeftHandSideMatrix, const ProcessInfo &rCurrentProcessInfo)
Definition: element.h:423
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
virtual void GetSecondDerivativesVector(Vector &values, int Step=0) const
Definition: element.h:320
virtual void CalculateLocalSystem(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo)
Definition: element.h:405
std::vector< std::size_t > EquationIdVectorType
Definition: element.h:98
double GetGamma() const
Definition: generalized_newmark_scheme.hpp:96
void UpdateVariablesDerivatives(ModelPart &rModelPart) override
Definition: generalized_newmark_scheme.hpp:57
double GetBeta() const
Definition: generalized_newmark_scheme.hpp:94
void EquationId(const Element &rElement, Element::EquationIdVectorType &rEquationId, const ProcessInfo &rCurrentProcessInfo) override
This method gets the eqaution id corresponding to the current element.
Definition: geomechanics_time_integration_scheme.hpp:96
double GetDeltaTime() const
Definition: geomechanics_time_integration_scheme.hpp:331
const Variable< double > & GetComponentFromVectorVariable(const Variable< array_1d< double, 3 >> &rSource, const std::string &rComponent) const
Definition: geomechanics_time_integration_scheme.hpp:318
const std::vector< SecondOrderVectorVariable > & GetSecondOrderVectorVariables() const
Definition: geomechanics_time_integration_scheme.hpp:333
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
Definition: newmark_dynamic_U_Pw_scheme.hpp:27
void CalculateSystemContributions(Condition &rCurrentCondition, LocalSystemMatrixType &LHS_Contribution, LocalSystemVectorType &RHS_Contribution, Element::EquationIdVectorType &EquationId, const ProcessInfo &CurrentProcessInfo) override
Functions totally analogous to the precedent but applied to the "condition" objects.
Definition: newmark_dynamic_U_Pw_scheme.hpp:118
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: newmark_dynamic_U_Pw_scheme.hpp:144
void AddDynamicsToRHS(Element &rCurrentElement, LocalSystemVectorType &RHS_Contribution, LocalSystemMatrixType &M, LocalSystemMatrixType &C, const ProcessInfo &CurrentProcessInfo)
Definition: newmark_dynamic_U_Pw_scheme.hpp:305
void CalculateRHSContribution(Condition &rCurrentCondition, LocalSystemVectorType &rRHS_Contribution, Element::EquationIdVectorType &rEquationIds, const ProcessInfo &rCurrentProcessInfo) override
Functions totally analogous to the precedent but applied to the "condition" objects.
Definition: newmark_dynamic_U_Pw_scheme.hpp:193
NewmarkDynamicUPwScheme(double beta, double gamma, double theta)
Definition: newmark_dynamic_U_Pw_scheme.hpp:38
void CalculateLHSContribution(Condition &rCurrentCondition, LocalSystemMatrixType &LHS_Contribution, Element::EquationIdVectorType &EquationId, const ProcessInfo &CurrentProcessInfo) override
Functions totally analogous to the precedent but applied to the "condition" objects.
Definition: newmark_dynamic_U_Pw_scheme.hpp:216
void Predict(ModelPart &rModelPart, DofsArrayType &rDofSet, TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b) override
Performing the prediction of the solution.
Definition: newmark_dynamic_U_Pw_scheme.hpp:49
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: newmark_dynamic_U_Pw_scheme.hpp:170
void PredictVariables(const ModelPart &rModelPart)
Definition: newmark_dynamic_U_Pw_scheme.hpp:60
void AddDynamicsToRHS(Condition &rCurrentCondition, LocalSystemVectorType &RHS_Contribution, LocalSystemMatrixType &M, LocalSystemMatrixType &C, const ProcessInfo &CurrentProcessInfo)
Definition: newmark_dynamic_U_Pw_scheme.hpp:280
void AddDynamicsToLHS(LocalSystemMatrixType &LHS_Contribution, LocalSystemMatrixType &M, LocalSystemMatrixType &C, const ProcessInfo &CurrentProcessInfo)
Definition: newmark_dynamic_U_Pw_scheme.hpp:261
void PredictVariablesForNode(Node &rNode)
Definition: newmark_dynamic_U_Pw_scheme.hpp:65
void PredictVariableForNode(Node &rNode, const SecondOrderVectorVariable &rSecondOrderVariables)
Definition: newmark_dynamic_U_Pw_scheme.hpp:73
KRATOS_CLASS_POINTER_DEFINITION(NewmarkDynamicUPwScheme)
void CalculateLHSContribution(Element &rCurrentElement, LocalSystemMatrixType &LHS_Contribution, Element::EquationIdVectorType &EquationId, const ProcessInfo &CurrentProcessInfo) override
This function is designed to calculate just the LHS contribution.
Definition: newmark_dynamic_U_Pw_scheme.hpp:238
Definition: newmark_quasistatic_U_Pw_scheme.hpp:27
This class defines the node.
Definition: node.h:65
TVariableType::Type & FastGetSolutionStepValue(const TVariableType &rThisVariable)
Definition: node.h:435
bool HasDofFor(const VariableData &rDofVariable) const
Definition: node.h:887
bool SolutionStepsDataHas(const VariableData &rThisVariable) const
Definition: node.h:427
bool IsFixed(const VariableData &rDofVariable) const
Definition: node.h:897
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
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
typename TSparseSpace::VectorType TSystemVectorType
Vector type definition.
Definition: scheme.h:74
typename TDenseSpace::VectorType LocalSystemVectorType
Local system vector type definition.
Definition: scheme.h:80
ModelPart::DofsArrayType DofsArrayType
DoF array type definition.
Definition: scheme.h:86
typename TDenseSpace::MatrixType LocalSystemMatrixType
Local system matrix type definition.
Definition: scheme.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
float gamma
Definition: generate_two_fluid_navier_stokes.py:131
def num_threads
Definition: script.py:75
A
Definition: sensitivityMatrix.py:70
Definition: geomechanics_time_integration_scheme.hpp:35
Variable< array_1d< double, 3 > > instance
Definition: geomechanics_time_integration_scheme.hpp:36
Variable< array_1d< double, 3 > > first_time_derivative
Definition: geomechanics_time_integration_scheme.hpp:37
Variable< array_1d< double, 3 > > second_time_derivative
Definition: geomechanics_time_integration_scheme.hpp:38