10 #if !defined(KRATOS_DYNAMIC_SCHEME_H_INCLUDED)
11 #define KRATOS_DYNAMIC_SCHEME_H_INCLUDED
39 template<
class TSparseSpace,
class TDenseSpace >
46 std::vector< Matrix >
M;
47 std::vector< Matrix >
D;
52 std::vector< Vector >
v;
53 std::vector< Vector >
a;
54 std::vector< Vector >
c;
90 :
DerivedType(rTimeVectorIntegrationMethods, rOptions)
102 :
DerivedType(rTimeScalarIntegrationMethods, rOptions)
117 :
DerivedType(rTimeVectorIntegrationMethods, rTimeScalarIntegrationMethods, rOptions)
124 :
DerivedType(rTimeVectorIntegrationMethods, rTimeScalarIntegrationMethods)
178 double parameter = 0.0;
210 (pCurrentElement) -> CalculateLocalSystem(rLHS_Contribution,rRHS_Contribution, rCurrentProcessInfo);
212 (pCurrentElement) -> EquationIdVector(
EquationId, rCurrentProcessInfo);
214 if ( rCurrentProcessInfo[COMPUTE_DYNAMIC_TANGENT] ==
true ){
216 (pCurrentElement) -> CalculateSecondDerivativesContributions(this->
mMatrix.
M[thread],this->mVector.a[thread],rCurrentProcessInfo);
218 (pCurrentElement) -> CalculateFirstDerivativesContributions(this->
mMatrix.
D[thread],this->mVector.v[thread],rCurrentProcessInfo);
227 (pCurrentElement) -> CalculateMassMatrix(
mMatrix.
M[thread], rCurrentProcessInfo);
229 (pCurrentElement) -> CalculateDampingMatrix(
mMatrix.
D[thread], rCurrentProcessInfo);
259 (pCurrentElement) -> CalculateRightHandSide(rRHS_Contribution, rCurrentProcessInfo);
261 (pCurrentElement) -> EquationIdVector(
EquationId, rCurrentProcessInfo);
263 if ( rCurrentProcessInfo[COMPUTE_DYNAMIC_TANGENT] ==
true ){
265 (pCurrentElement) -> CalculateSecondDerivativesRHS(this->
mVector.
a[thread],rCurrentProcessInfo);
267 (pCurrentElement) -> CalculateFirstDerivativesRHS(this->
mVector.
v[thread],rCurrentProcessInfo);
274 (pCurrentElement) -> CalculateMassMatrix(
mMatrix.
M[thread], rCurrentProcessInfo);
276 (pCurrentElement) -> CalculateDampingMatrix(
mMatrix.
D[thread], rCurrentProcessInfo);
304 (pCurrentCondition) -> CalculateLocalSystem(rLHS_Contribution,rRHS_Contribution, rCurrentProcessInfo);
306 (pCurrentCondition) -> EquationIdVector(
EquationId, rCurrentProcessInfo);
308 if ( rCurrentProcessInfo[COMPUTE_DYNAMIC_TANGENT] ==
true ){
310 (pCurrentCondition) -> CalculateSecondDerivativesContributions(this->
mMatrix.
M[thread],this->mVector.a[thread],rCurrentProcessInfo);
312 (pCurrentCondition) -> CalculateFirstDerivativesContributions(this->
mMatrix.
D[thread],this->mVector.v[thread],rCurrentProcessInfo);
321 (pCurrentCondition) -> CalculateMassMatrix(
mMatrix.
M[thread], rCurrentProcessInfo);
323 (pCurrentCondition) -> CalculateDampingMatrix(
mMatrix.
D[thread], rCurrentProcessInfo);
351 (pCurrentCondition) -> CalculateRightHandSide(rRHS_Contribution, rCurrentProcessInfo);
353 (pCurrentCondition) -> EquationIdVector(
EquationId, rCurrentProcessInfo);
355 if ( rCurrentProcessInfo[COMPUTE_DYNAMIC_TANGENT] ==
true ){
357 (pCurrentCondition) -> CalculateSecondDerivativesRHS(this->
mVector.
a[thread],rCurrentProcessInfo);
359 (pCurrentCondition) -> CalculateFirstDerivativesRHS(this->
mVector.
v[thread],rCurrentProcessInfo);
366 (pCurrentCondition) -> CalculateMassMatrix(
mMatrix.
M[thread], rCurrentProcessInfo);
368 (pCurrentCondition) -> CalculateDampingMatrix(
mMatrix.
D[thread], rCurrentProcessInfo);
394 KRATOS_ERROR <<
"COMPUTE_DYNAMIC_TANGENT must be set to use a Dynamic Scheme" << std::endl;
415 std::string
Info()
const override
417 std::stringstream buffer;
418 buffer <<
"DynamicScheme";
425 rOStream <<
"DynamicScheme";
431 rOStream <<
"DynamicScheme Data";
476 double parameter = 0;
485 noalias(rLHS_Contribution) += rM * parameter;
497 noalias(rLHS_Contribution) += rD * parameter;
519 noalias(rLHS_Contribution) += rM ;
525 noalias(rLHS_Contribution) += rD;
549 pCurrentElement->GetSecondDerivativesVector(
mVector.
a[thread], 0);
551 double parameter = 0.0;
557 if( parameter != 0 ){
559 (
mVector.
a[thread]) *= (1.00 - parameter);
561 pCurrentElement->GetSecondDerivativesVector(
mVector.
c[thread], 1);
573 pCurrentElement->GetFirstDerivativesVector(
mVector.
v[thread], 0);
599 pCurrentCondition->GetSecondDerivativesVector(
mVector.
a[thread], 0);
601 double parameter = 0.0;
607 if( parameter != 0 ){
609 (
mVector.
a[thread]) *= (1.00 - parameter);
611 pCurrentCondition->GetSecondDerivativesVector(
mVector.
c[thread], 1);
623 pCurrentCondition->GetFirstDerivativesVector(
mVector.
v[thread], 0);
648 noalias(rRHS_Contribution) -= rfa;
654 noalias(rRHS_Contribution) -= rfv;
bool Has(const Variable< TDataType > &rThisVariable) const
Checks if the data container has a value associated with a given variable.
Definition: data_value_container.h:382
Dynamic integration scheme.
Definition: dynamic_scheme.hpp:41
KRATOS_CLASS_POINTER_DEFINITION(DynamicScheme)
BaseType::SolutionSchemePointerType BasePointerType
Definition: dynamic_scheme.hpp:65
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: dynamic_scheme.hpp:429
BaseType::NodeType NodeType
Definition: dynamic_scheme.hpp:70
BaseType::LocalSystemMatrixType LocalSystemMatrixType
Definition: dynamic_scheme.hpp:75
void Condition_Calculate_RHS_Contribution(Condition::Pointer pCurrentCondition, LocalSystemVectorType &rRHS_Contribution, Element::EquationIdVectorType &EquationId, ProcessInfo &rCurrentProcessInfo) override
Definition: dynamic_scheme.hpp:341
DynamicScheme(Flags &rOptions)
Constructor.
Definition: dynamic_scheme.hpp:129
BaseType::LocalSystemVectorType LocalSystemVectorType
Definition: dynamic_scheme.hpp:74
std::string Info() const override
Turn back information as a string.
Definition: dynamic_scheme.hpp:415
DynamicScheme(IntegrationMethodsScalarType &rTimeScalarIntegrationMethods)
Constructor.
Definition: dynamic_scheme.hpp:107
BaseType::IntegrationMethodsVectorType IntegrationMethodsVectorType
Definition: dynamic_scheme.hpp:81
DynamicScheme(DynamicScheme &rOther)
Copy Constructor.
Definition: dynamic_scheme.hpp:135
BaseType::NodesContainerType NodesContainerType
Definition: dynamic_scheme.hpp:77
BaseType::SystemMatrixType SystemMatrixType
Definition: dynamic_scheme.hpp:72
virtual void AddDynamicsToLHS(LocalSystemMatrixType &rLHS_Contribution, LocalSystemMatrixType &rD, LocalSystemMatrixType &rM, ProcessInfo &rCurrentProcessInfo)
Definition: dynamic_scheme.hpp:470
virtual void AddDynamicsToRHS(Element::Pointer pCurrentElement, LocalSystemVectorType &rRHS_Contribution, LocalSystemMatrixType &rD, LocalSystemMatrixType &rM, ProcessInfo &rCurrentProcessInfo)
Definition: dynamic_scheme.hpp:538
virtual void AddDynamicsToRHS(Condition::Pointer pCurrentCondition, LocalSystemVectorType &rRHS_Contribution, LocalSystemMatrixType &rD, LocalSystemMatrixType &rM, ProcessInfo &rCurrentProcessInfo)
Definition: dynamic_scheme.hpp:588
GeneralVectors mVector
Definition: dynamic_scheme.hpp:451
DynamicScheme(IntegrationMethodsVectorType &rTimeVectorIntegrationMethods)
Constructor.
Definition: dynamic_scheme.hpp:95
BasePointerType Clone() override
Clone.
Definition: dynamic_scheme.hpp:143
GeneralMatrices mMatrix
Definition: dynamic_scheme.hpp:449
void CalculateSystemContributions(Element::Pointer pCurrentElement, LocalSystemMatrixType &rLHS_Contribution, LocalSystemVectorType &rRHS_Contribution, Element::EquationIdVectorType &EquationId, ProcessInfo &rCurrentProcessInfo) override
Definition: dynamic_scheme.hpp:200
StaticScheme< TSparseSpace, TDenseSpace > DerivedType
Definition: dynamic_scheme.hpp:68
void AddDynamicForcesToRHS(LocalSystemVectorType &rRHS_Contribution, LocalSystemVectorType &rfv, LocalSystemVectorType &rfa, ProcessInfo &rCurrentProcessInfo)
Definition: dynamic_scheme.hpp:639
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: dynamic_scheme.hpp:423
SolutionScheme< TSparseSpace, TDenseSpace > BaseType
Definition: dynamic_scheme.hpp:64
BaseType::ElementsContainerType ElementsContainerType
Definition: dynamic_scheme.hpp:78
void Condition_CalculateSystemContributions(Condition::Pointer pCurrentCondition, LocalSystemMatrixType &rLHS_Contribution, LocalSystemVectorType &rRHS_Contribution, Element::EquationIdVectorType &EquationId, ProcessInfo &rCurrentProcessInfo) override
Definition: dynamic_scheme.hpp:293
DynamicScheme(IntegrationMethodsScalarType &rTimeScalarIntegrationMethods, Flags &rOptions)
Constructor.
Definition: dynamic_scheme.hpp:101
DynamicScheme(IntegrationMethodsVectorType &rTimeVectorIntegrationMethods, IntegrationMethodsScalarType &rTimeScalarIntegrationMethods, Flags &rOptions)
Constructor.
Definition: dynamic_scheme.hpp:114
BaseType::ConditionsContainerType ConditionsContainerType
Definition: dynamic_scheme.hpp:79
void Initialize(ModelPart &rModelPart) override
Definition: dynamic_scheme.hpp:163
DynamicScheme(IntegrationMethodsVectorType &rTimeVectorIntegrationMethods, IntegrationMethodsScalarType &rTimeScalarIntegrationMethods)
Constructor.
Definition: dynamic_scheme.hpp:122
virtual void AddDynamicTangentsToLHS(LocalSystemMatrixType &rLHS_Contribution, LocalSystemMatrixType &rD, LocalSystemMatrixType &rM, ProcessInfo &rCurrentProcessInfo)
Definition: dynamic_scheme.hpp:510
~DynamicScheme() override
Destructor.
Definition: dynamic_scheme.hpp:149
BaseType::LocalFlagType LocalFlagType
Definition: dynamic_scheme.hpp:66
DynamicScheme(IntegrationMethodsVectorType &rTimeVectorIntegrationMethods, Flags &rOptions)
Constructor.
Definition: dynamic_scheme.hpp:89
BaseType::SystemVectorType SystemVectorType
Definition: dynamic_scheme.hpp:73
BaseType::IntegrationMethodsScalarType IntegrationMethodsScalarType
Definition: dynamic_scheme.hpp:82
int Check(ModelPart &rModelPart) override
Definition: dynamic_scheme.hpp:385
void Calculate_RHS_Contribution(Element::Pointer pCurrentElement, LocalSystemVectorType &rRHS_Contribution, Element::EquationIdVectorType &EquationId, ProcessInfo &rCurrentProcessInfo) override
Definition: dynamic_scheme.hpp:248
BaseType::DofsArrayType DofsArrayType
Definition: dynamic_scheme.hpp:71
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
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
This class defines the node.
Definition: node.h:65
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
Solution scheme base class.
Definition: solution_scheme.hpp:54
std::vector< IntegrationScalarPointerType > IntegrationMethodsScalarType
Definition: solution_scheme.hpp:83
SolutionSchemeType::Pointer SolutionSchemePointerType
Definition: solution_scheme.hpp:60
TDenseSpace::MatrixType LocalSystemMatrixType
Definition: solution_scheme.hpp:66
ModelPart::ElementsContainerType ElementsContainerType
Definition: solution_scheme.hpp:70
TDenseSpace::VectorType LocalSystemVectorType
Definition: solution_scheme.hpp:67
TSparseSpace::MatrixType SystemMatrixType
Definition: solution_scheme.hpp:64
ModelPart::NodesContainerType NodesContainerType
Definition: solution_scheme.hpp:69
IntegrationMethodsVectorType mTimeVectorIntegrationMethods
Definition: solution_scheme.hpp:800
IntegrationMethodsScalarType mTimeScalarIntegrationMethods
Definition: solution_scheme.hpp:801
virtual void EquationId(Element::Pointer pCurrentElement, Element::EquationIdVectorType &rEquationId, ProcessInfo &rCurrentProcessInfo)
Definition: solution_scheme.hpp:651
TSparseSpace::VectorType SystemVectorType
Definition: solution_scheme.hpp:65
ModelPart::ConditionsContainerType ConditionsContainerType
Definition: solution_scheme.hpp:71
std::vector< IntegrationVectorPointerType > IntegrationMethodsVectorType
Definition: solution_scheme.hpp:78
Solver local flags class definition.
Definition: solution_local_flags.hpp:48
Static integration scheme (for static problems)
Definition: static_scheme.hpp:41
void Initialize(ModelPart &rModelPart) override
Definition: static_scheme.hpp:137
int Check(ModelPart &rModelPart) override
Definition: static_scheme.hpp:194
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
#define KRATOS_ERROR
Definition: exception.h:161
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
Definition: dynamic_scheme.hpp:45
std::vector< Matrix > D
Definition: dynamic_scheme.hpp:47
std::vector< Matrix > M
Definition: dynamic_scheme.hpp:46
Definition: dynamic_scheme.hpp:51
std::vector< Vector > c
Definition: dynamic_scheme.hpp:54
std::vector< Vector > a
Definition: dynamic_scheme.hpp:53
std::vector< Vector > v
Definition: dynamic_scheme.hpp:52