47 template<
class TSparseSpace,
class TDenseSpace >
82 static constexpr
double ZeroTolerance = std::numeric_limits<double>::epsilon();
93 mpRayleighBeta(&NODAL_MAUX)
114 mpRayleighBeta(&RayleighBetaVariable)
122 mpRayleighBeta(rOther.mpRayleighBeta)
154 return Kratos::make_shared<ClassType>(ThisParameters);
182 noalias(rDeltaDisplacementTLS) = rNode.FastGetSolutionStepValue(DISPLACEMENT) - rNode.FastGetSolutionStepValue(DISPLACEMENT, 1);
184 array_1d<double, 3>& r_current_velocity = rNode.FastGetSolutionStepValue(VELOCITY);
185 const array_1d<double, 3>& r_previous_velocity = rNode.FastGetSolutionStepValue(VELOCITY, 1);
187 noalias(r_current_velocity) = (this->mBossak.c1 * rDeltaDisplacementTLS - this->mBossak.c4 * r_previous_velocity);
216 const double delta_time = r_current_process_info[DELTA_TIME];
219 const auto it_node_begin = rModelPart.
Nodes().begin();
226 const int disppos_x = it_node_begin->HasDofFor(DISPLACEMENT_X) ?
static_cast<int>(it_node_begin->GetDofPosition(DISPLACEMENT_X)) : -1;
227 const int velpos_x = it_node_begin->HasDofFor(VELOCITY_X) ?
static_cast<int>(it_node_begin->GetDofPosition(VELOCITY_X)) : -1;
228 const int disppos_y = it_node_begin->HasDofFor(DISPLACEMENT_Y) ?
static_cast<int>(it_node_begin->GetDofPosition(DISPLACEMENT_Y)) : -1;
229 const int velpos_y = it_node_begin->HasDofFor(VELOCITY_Y) ?
static_cast<int>(it_node_begin->GetDofPosition(VELOCITY_Y)) : -1;
230 const int disppos_z = it_node_begin->HasDofFor(DISPLACEMENT_Z) ?
static_cast<int>(it_node_begin->GetDofPosition(DISPLACEMENT_Z)) : -1;
231 const int velpos_z = it_node_begin->HasDofFor(VELOCITY_Z) ?
static_cast<int>(it_node_begin->GetDofPosition(VELOCITY_Z)) : -1;
235 bool predicted_x = false;
236 bool predicted_y = false;
237 bool predicted_z = false;
242 const array_1d<double, 3>& r_previous_velocity = rNode.FastGetSolutionStepValue(VELOCITY, 1);
243 const array_1d<double, 3>& r_previous_displacement = rNode.FastGetSolutionStepValue(DISPLACEMENT, 1);
244 array_1d<double, 3>& r_current_acceleration = rNode.FastGetSolutionStepValue(ACCELERATION);
245 array_1d<double, 3>& r_current_velocity = rNode.FastGetSolutionStepValue(VELOCITY);
246 array_1d<double, 3>& r_current_displacement = rNode.FastGetSolutionStepValue(DISPLACEMENT);
249 if (rNode.GetDof(VELOCITY_X, velpos_x).IsFixed()) {
250 rDeltaDisplacementTLS[0] = (r_current_velocity[0] + this->mBossak.c4 * r_previous_velocity[0])/this->mBossak.c1;
251 r_current_displacement[0] = r_previous_displacement[0] + rDeltaDisplacementTLS[0];
255 if (disppos_x > -1 && !predicted_x) {
256 if (!rNode.
GetDof(DISPLACEMENT_X, disppos_x).
IsFixed() && !predicted_x) {
257 r_current_displacement[0] = r_previous_displacement[0] + delta_time * r_previous_velocity[0];
263 rDeltaDisplacementTLS[1] = (r_current_velocity[1] + this->mBossak.c4 * r_previous_velocity[1])/this->mBossak.c1;
264 r_current_displacement[1] = r_previous_displacement[1] + rDeltaDisplacementTLS[1];
268 if (disppos_y > -1 && !predicted_y) {
269 if (!rNode.
GetDof(DISPLACEMENT_Y, disppos_y).
IsFixed() && !predicted_y) {
270 r_current_displacement[1] = r_previous_displacement[1] + delta_time * r_previous_velocity[1];
276 rDeltaDisplacementTLS[2] = (r_current_velocity[2] + this->mBossak.c4 * r_previous_velocity[2])/this->mBossak.c1;
277 r_current_displacement[2] = r_previous_displacement[2] + rDeltaDisplacementTLS[2];
281 if (disppos_z > -1 && !predicted_z) {
282 if (!rNode.
GetDof(DISPLACEMENT_Z, disppos_z).
IsFixed() && !predicted_z) {
283 r_current_displacement[2] = r_previous_displacement[2] + delta_time * r_previous_velocity[2];
288 noalias(r_current_acceleration) = zero_array;
289 noalias(r_current_velocity) = r_previous_velocity;
303 "name" : "pseudo_static_scheme",
304 "rayleigh_beta_variable" : "RAYLEIGH_BETA"
308 const Parameters base_default_parameters = DerivedBaseType::GetDefaultParameters();
310 return default_parameters;
319 return "pseudo_static_scheme";
335 std::string
Info()
const override
337 return "ResidualBasedPseudoStaticDisplacementScheme";
349 rOStream <<
Info() <<
". Considering the following damping variable " << *mpRayleighBeta;
389 noalias(rLHSContribution) += rD * this->mBossak.c1;
390 else if (rM.size1() != 0) {
391 const double beta = rCurrentProcessInfo[*mpRayleighBeta];
392 noalias(rLHSContribution) += rM * beta * this->mBossak.c1;
413 const auto& r_const_elem_ref = rElement;
417 noalias(rRHSContribution) -=
prod(rD, this->mVector.v[this_thread]);
418 }
else if (rM.size1() != 0) {
419 const double beta = rCurrentProcessInfo[*mpRayleighBeta];
420 r_const_elem_ref.GetFirstDerivativesVector(this->mVector.v[this_thread], 0);
421 noalias(rRHSContribution) -= beta *
prod(rM, this->mVector.v[this_thread]);
442 const auto& r_const_cond_ref = rCondition;
447 noalias(rRHSContribution) -=
prod(rD, this->mVector.v[this_thread]);
448 }
else if (rM.size1() != 0) {
449 const double beta = rCurrentProcessInfo[*mpRayleighBeta];
450 r_const_cond_ref.GetFirstDerivativesVector(this->mVector.v[this_thread], 0);
451 noalias(rRHSContribution) -= beta *
prod(rM, this->mVector.v[this_thread]);
461 DerivedBaseType::AssignSettings(ThisParameters);
std::string Info() const override
Turn back information as a string.
Definition: periodic_interface_process.hpp:93
Base class for all Conditions.
Definition: condition.h:59
virtual void GetFirstDerivativesVector(Vector &values, int Step=0) const
Definition: condition.h:313
bool IsFixed() const
Definition: dof.h:376
Base class for all Elements.
Definition: element.h:60
virtual void GetFirstDerivativesVector(Vector &values, int Step=0) const
Definition: element.h:310
std::vector< DofType::Pointer > DofsVectorType
Definition: element.h:100
KratosComponents class encapsulates a lookup table for a family of classes in a generic way.
Definition: kratos_components.h:49
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
This class defines the node.
Definition: node.h:65
const DofType & GetDof(TVariableType const &rDofVariable, int pos) const
Get dof with a given position. If not found it is search.
Definition: node.h:649
static int ThisThread()
Wrapper for omp_get_thread_num().
Definition: openmp_utils.h:108
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
void RecursivelyAddMissingParameters(const Parameters &rDefaultParameters)
This function is designed to verify that the parameters under testing contain at least all parameters...
Definition: kratos_parameters.cpp:1457
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
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
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
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 a pseudo-static scheme.
Definition: residual_based_pseudo_static_displacement_scheme.h:50
~ResidualBasedPseudoStaticDisplacementScheme() override
Definition: residual_based_pseudo_static_displacement_scheme.h:136
ResidualBasedPseudoStaticDisplacementScheme(Parameters ThisParameters)
Constructor. The pseudo static scheme (parameters)
Definition: residual_based_pseudo_static_displacement_scheme.h:101
void Update(ModelPart &rModelPart, DofsArrayType &rDofSet, TSystemMatrixType &rA, TSystemVectorType &rDx, TSystemVectorType &rb) override
Performing the update of the solution.
Definition: residual_based_pseudo_static_displacement_scheme.h:166
Scheme< TSparseSpace, TDenseSpace > BaseType
Definition: residual_based_pseudo_static_displacement_scheme.h:56
static constexpr double ZeroTolerance
Definition: residual_based_pseudo_static_displacement_scheme.h:82
Element::DofsVectorType DofsVectorType
Definition: residual_based_pseudo_static_displacement_scheme.h:64
ResidualBasedPseudoStaticDisplacementScheme(const Variable< double > &RayleighBetaVariable)
Default constructor. The pseudo static scheme.
Definition: residual_based_pseudo_static_displacement_scheme.h:112
BaseType::TSystemVectorType TSystemVectorType
Definition: residual_based_pseudo_static_displacement_scheme.h:68
Parameters GetDefaultParameters() const override
This method provides the defaults parameters to avoid conflicts between the different constructors.
Definition: residual_based_pseudo_static_displacement_scheme.h:299
std::string Info() const override
Turn back information as a string.
Definition: residual_based_pseudo_static_displacement_scheme.h:335
BaseType::DofsArrayType DofsArrayType
Definition: residual_based_pseudo_static_displacement_scheme.h:62
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: residual_based_pseudo_static_displacement_scheme.h:347
ModelPart::ConditionsContainerType ConditionsArrayType
Definition: residual_based_pseudo_static_displacement_scheme.h:76
KRATOS_CLASS_POINTER_DEFINITION(ResidualBasedPseudoStaticDisplacementScheme)
BaseType::Pointer BaseTypePointer
Definition: residual_based_pseudo_static_displacement_scheme.h:78
void AddDynamicsToRHS(Element &rElement, LocalSystemVectorType &rRHSContribution, LocalSystemMatrixType &rD, LocalSystemMatrixType &rM, const ProcessInfo &rCurrentProcessInfo) override
It adds the dynamic RHS contribution of the elements b - D*v.
Definition: residual_based_pseudo_static_displacement_scheme.h:404
void AddDynamicsToRHS(Condition &rCondition, LocalSystemVectorType &rRHSContribution, LocalSystemMatrixType &rD, LocalSystemMatrixType &rM, const ProcessInfo &rCurrentProcessInfo) override
It adds the dynamic RHS contribution of the condition b - M*a - D*v.
Definition: residual_based_pseudo_static_displacement_scheme.h:433
BaseType::LocalSystemMatrixType LocalSystemMatrixType
Definition: residual_based_pseudo_static_displacement_scheme.h:72
ResidualBasedPseudoStaticDisplacementScheme()
Default constructor.
Definition: residual_based_pseudo_static_displacement_scheme.h:91
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: residual_based_pseudo_static_displacement_scheme.h:341
BaseType::TDataType TDataType
Definition: residual_based_pseudo_static_displacement_scheme.h:60
ResidualBasedPseudoStaticDisplacementScheme(ResidualBasedPseudoStaticDisplacementScheme &rOther)
Definition: residual_based_pseudo_static_displacement_scheme.h:120
BaseType::LocalSystemVectorType LocalSystemVectorType
Definition: residual_based_pseudo_static_displacement_scheme.h:70
ResidualBasedPseudoStaticDisplacementScheme< TSparseSpace, TDenseSpace > ClassType
Definition: residual_based_pseudo_static_displacement_scheme.h:58
BaseType::TSystemMatrixType TSystemMatrixType
Definition: residual_based_pseudo_static_displacement_scheme.h:66
void AddDynamicsToLHS(LocalSystemMatrixType &rLHSContribution, LocalSystemMatrixType &rD, LocalSystemMatrixType &rM, const ProcessInfo &rCurrentProcessInfo) override
It adds the dynamic LHS contribution of the elements D*c1 + K.
Definition: residual_based_pseudo_static_displacement_scheme.h:380
BaseTypePointer Clone() override
Definition: residual_based_pseudo_static_displacement_scheme.h:129
BaseType::Pointer Create(Parameters ThisParameters) const override
Create method.
Definition: residual_based_pseudo_static_displacement_scheme.h:152
ModelPart::ElementsContainerType ElementsArrayType
Definition: residual_based_pseudo_static_displacement_scheme.h:74
ResidualBasedBossakDisplacementScheme< TSparseSpace, TDenseSpace > DerivedBaseType
Definition: residual_based_pseudo_static_displacement_scheme.h:80
void Predict(ModelPart &rModelPart, DofsArrayType &rDofSet, TSystemMatrixType &rA, TSystemVectorType &rDx, TSystemVectorType &rb) override
Performing the prediction of the solution.
Definition: residual_based_pseudo_static_displacement_scheme.h:202
static std::string Name()
Returns the name of the class as used in the settings (snake_case format)
Definition: residual_based_pseudo_static_displacement_scheme.h:317
void AssignSettings(const Parameters ThisParameters) override
This method assigns settings to member variables.
Definition: residual_based_pseudo_static_displacement_scheme.h:459
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
virtual Parameters ValidateAndAssignParameters(Parameters ThisParameters, const Parameters DefaultParameters) const
This method validate and assign default parameters.
Definition: scheme.h:773
typename TSparseSpace::DataType TDataType
Data type definition.
Definition: scheme.h:68
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
double TwoNorm(SparseSpaceType &dummy, SparseSpaceType::VectorType &x)
Definition: add_strategies_to_python.cpp:164
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
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
delta_time
Definition: generate_frictional_mortar_condition.py:130