10 #if !defined(KRATOS_TIME_INTEGRATION_METHOD_H_INCLUDED)
11 #define KRATOS_TIME_INTEGRATION_METHOD_H_INCLUDED
53 template<
class TVariableType,
class TValueType>
107 TimeIntegrationMethod(
const TVariableType& rVariable,
const TVariableType& rFirstDerivative,
const TVariableType& rSecondDerivative) :
Flags()
120 TimeIntegrationMethod(
const TVariableType& rVariable,
const TVariableType& rFirstDerivative,
const TVariableType& rSecondDerivative,
const TVariableType& rPrimaryVariable) :
Flags()
131 KRATOS_ERROR <<
"The primary variable supplied: "<<rPrimaryVariable.Name()<<
" is not any of the time integration variables" << std::endl;
151 return Kratos::make_shared<TimeIntegrationMethod>(*
this);
208 if( rVariableName == (*this->
mpVariable).Name() ){
235 KRATOS_ERROR <<
" Calling SetStepVariable from time integration base class " <<std::endl;
278 KRATOS_ERROR <<
" time integration method Variable not set " <<std::endl;
282 KRATOS_ERROR <<
" time integration method PrimaryVariable not set " <<std::endl;
366 std::string
Info()
const override
368 std::stringstream buffer;
369 buffer <<
"TimeIntegrationMethod";
376 rOStream <<
"TimeIntegrationMethod";
382 rOStream <<
"TimeIntegrationMethod Data";
448 if( this->mpPrimaryVariable !=
nullptr ){
450 if( this->mpVariable !=
nullptr ){
451 if( *this->mpPrimaryVariable == *this->mpVariable ){
461 else if( this->mpFirstDerivative !=
nullptr ){
462 if( *this->mpPrimaryVariable == *this->mpFirstDerivative ){
472 else if( this->mpSecondDerivative !=
nullptr ){
473 if( *this->mpPrimaryVariable == *this->mpSecondDerivative ){
493 if( this->mpInputVariable !=
nullptr ){
495 if( this->mpVariable !=
nullptr ){
496 if( *this->mpInputVariable == *this->mpVariable ){
499 else if( this->mpFirstDerivative !=
nullptr ){
500 if( *this->mpInputVariable == *this->mpFirstDerivative ){
503 else if( this->mpSecondDerivative !=
nullptr ){
504 if( *this->mpInputVariable == *this->mpSecondDerivative ){
516 KRATOS_ERROR <<
" Calling predict from variable from time integration base class " <<std::endl;
521 KRATOS_ERROR <<
" Calling predict from first derivative from time integration base class " <<std::endl;
526 KRATOS_ERROR <<
" Calling predict from second derivative from time integration base class " <<std::endl;
531 KRATOS_ERROR <<
" Calling predict variable from time integration base class " <<std::endl;
536 KRATOS_ERROR <<
" Calling predict first derivative from time integration base class " <<std::endl;
541 KRATOS_ERROR <<
" Calling predict second derivative from time integration base class " <<std::endl;
546 KRATOS_ERROR <<
" Calling predict from variable from time integration base class " <<std::endl;
551 KRATOS_ERROR <<
" Calling predict from first derivative from time integration base class " <<std::endl;
556 KRATOS_ERROR <<
" Calling predict from second derivative from time integration base class " <<std::endl;
561 KRATOS_ERROR <<
" Calling predict variable from time integration base class " <<std::endl;
566 KRATOS_ERROR <<
" Calling predict first derivative from time integration base class " <<std::endl;
571 KRATOS_ERROR <<
" Calling predict second derivative from time integration base class " <<std::endl;
576 KRATOS_ERROR <<
" Calling update from variable from time integration base class " <<std::endl;
581 KRATOS_ERROR <<
" Calling update from first derivative from time integration base class " <<std::endl;
586 KRATOS_ERROR <<
" Calling update from second derivative from time integration base class " <<std::endl;
591 KRATOS_ERROR <<
" Calling update variable from time integration base class " <<std::endl;
596 KRATOS_ERROR <<
" Calling update first derivative from time integration base class " <<std::endl;
601 KRATOS_ERROR <<
" Calling update second derivative from time integration base class " <<std::endl;
684 void save(
Serializer& rSerializer)
const override
698 rSerializer.
load(
"Variable", Name);
700 rSerializer.
load(
"FirstDerivative", Name);
702 rSerializer.
load(
"SecondDerivative", Name);
704 rSerializer.
load(
"PrimaryVariable", Name);
706 rSerializer.
load(
"InputVariable", Name);
732 template<
class TVariableType,
class TValueType>
738 template<
class TVariableType,
class TValueType>
741 return rOStream << rThis.
Info();
Flags & operator=(Flags const &rOther)
Assignment operator.
Definition: flags.h:151
KratosComponents class encapsulates a lookup table for a family of classes in a generic way.
Definition: kratos_components.h:49
This class defines the node.
Definition: node.h:65
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
void load(std::string const &rTag, TDataType &rObject)
Definition: serializer.h:207
void save(std::string const &rTag, std::array< TDataType, TDataSize > const &rObject)
Definition: serializer.h:545
Short class definition.
Definition: time_integration_method.hpp:55
virtual void SetProcessInfoParameters(ProcessInfo &rCurrentProcessInfo)
Definition: time_integration_method.hpp:178
TimeIntegrationMethod(const TVariableType &rVariable)
Constructor.
Definition: time_integration_method.hpp:94
void(TimeIntegrationMethod::* MethodPointer)(NodeType &rNode)
Definition: time_integration_method.hpp:69
virtual void Assign(NodeType &rNode)
Definition: time_integration_method.hpp:239
KRATOS_CLASS_POINTER_DEFINITION(TimeIntegrationMethod)
virtual void UpdateFirstDerivative(NodeType &rNode)
Definition: time_integration_method.hpp:594
~TimeIntegrationMethod() override
Destructor.
Definition: time_integration_method.hpp:155
virtual void AssignVariable(NodeType &rNode)
Definition: time_integration_method.hpp:529
VariablePointer mpVariable
Definition: time_integration_method.hpp:405
virtual void PredictFirstDerivative(NodeType &rNode)
Definition: time_integration_method.hpp:564
std::string GetPrimaryVariableName()
Definition: time_integration_method.hpp:193
virtual int Check(const ProcessInfo &rCurrentProcessInfo)
This function is designed to be called once to perform all the checks needed.
Definition: time_integration_method.hpp:272
virtual double & GetFirstDerivativeInertialParameter(double &rParameter)
Definition: time_integration_method.hpp:636
virtual void AssignSecondDerivative(NodeType &rNode)
Definition: time_integration_method.hpp:539
bool HasVariableName(const std::string &rVariableName)
Definition: time_integration_method.hpp:205
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: time_integration_method.hpp:380
virtual void AssignFirstDerivative(NodeType &rNode)
Definition: time_integration_method.hpp:534
const TValueType * ValuePointer
Definition: time_integration_method.hpp:67
TimeIntegrationMethod(const TVariableType &rVariable, const TVariableType &rFirstDerivative, const TVariableType &rSecondDerivative)
Constructor.
Definition: time_integration_method.hpp:107
MethodPointer mpUpdate
Definition: time_integration_method.hpp:427
std::string GetVariableName()
Definition: time_integration_method.hpp:199
const TVariableType * VariablePointer
KratosVariable or KratosVariableComponent.
Definition: time_integration_method.hpp:65
VariablePointer mpInputVariable
Definition: time_integration_method.hpp:418
virtual double & GetSecondDerivativeKineticParameter(double &rParameter)
Definition: time_integration_method.hpp:622
virtual double & GetKineticParameter(double &rParameter)
Definition: time_integration_method.hpp:610
virtual TimeIntegrationMethodPointer Clone()
Clone.
Definition: time_integration_method.hpp:149
virtual double & GetFirstDerivativeKineticParameter(double &rParameter)
Definition: time_integration_method.hpp:616
virtual double & GetFirstDerivativeInertialFactor(double &rParameter)
Definition: time_integration_method.hpp:323
TimeIntegrationMethod()
Default Constructor.
Definition: time_integration_method.hpp:83
virtual void AssignFromSecondDerivative(NodeType &rNode)
Definition: time_integration_method.hpp:524
MethodFactorPointer mpSecondDerivativeInertialFactor
Definition: time_integration_method.hpp:435
virtual void CalculateParameters(ProcessInfo &rCurrentProcessInfo)
Definition: time_integration_method.hpp:166
TimeIntegrationMethod(const TVariableType &rVariable, const TVariableType &rFirstDerivative, const TVariableType &rSecondDerivative, const TVariableType &rPrimaryVariable)
Constructor.
Definition: time_integration_method.hpp:120
void SetInputVariable(const TVariableType &rVariable)
Definition: time_integration_method.hpp:184
void SetFlags(Flags const &rThisFlags)
Definition: time_integration_method.hpp:351
virtual void PredictFromVariable(NodeType &rNode)
Definition: time_integration_method.hpp:544
MethodPointer mpPredict
Definition: time_integration_method.hpp:425
MethodFactorPointer mpFirstDerivativeKineticFactor
Definition: time_integration_method.hpp:431
virtual void Predict(NodeType &rNode)
Definition: time_integration_method.hpp:249
virtual bool HasStepVariable()
Definition: time_integration_method.hpp:227
void SetPointerAssignMethod()
Definition: time_integration_method.hpp:491
Flags const & GetFlags() const
Definition: time_integration_method.hpp:346
virtual double & GetInertialParameter(double &rParameter)
Definition: time_integration_method.hpp:630
void SetPointerMethods()
Definition: time_integration_method.hpp:446
virtual void PredictVariable(NodeType &rNode)
Definition: time_integration_method.hpp:559
virtual void SetStepVariable(const TVariableType &rStepVariable)
Definition: time_integration_method.hpp:233
virtual void AssignFromFirstDerivative(NodeType &rNode)
Definition: time_integration_method.hpp:519
Flags & GetFlags()
Definition: time_integration_method.hpp:341
virtual double & GetSecondDerivativeInertialParameter(double &rParameter)
Definition: time_integration_method.hpp:642
MethodPointer mpAssign
Definition: time_integration_method.hpp:423
TimeIntegrationMethod(TimeIntegrationMethod &rOther)
Copy Constructor.
Definition: time_integration_method.hpp:138
virtual double & GetSecondDerivativeInertialFactor(double &rParameter)
Definition: time_integration_method.hpp:330
virtual void UpdateFromFirstDerivative(NodeType &rNode)
Definition: time_integration_method.hpp:579
MethodFactorPointer mpFirstDerivativeInertialFactor
Definition: time_integration_method.hpp:434
VariablePointer mpFirstDerivative
Definition: time_integration_method.hpp:407
virtual void UpdateFromVariable(NodeType &rNode)
Definition: time_integration_method.hpp:574
double &(TimeIntegrationMethod::* MethodFactorPointer)(double &rParameter)
Definition: time_integration_method.hpp:71
virtual void AssignFromVariable(NodeType &rNode)
Definition: time_integration_method.hpp:514
VariablePointer mpPrimaryVariable
Definition: time_integration_method.hpp:413
virtual void PredictFromFirstDerivative(NodeType &rNode)
Definition: time_integration_method.hpp:549
virtual double & GetFirstDerivativeKineticFactor(double &rParameter)
Definition: time_integration_method.hpp:307
virtual void Update(NodeType &rNode)
Definition: time_integration_method.hpp:259
TimeIntegrationMethod::Pointer TimeIntegrationMethodPointer
Definition: time_integration_method.hpp:75
VariablePointer mpSecondDerivative
Definition: time_integration_method.hpp:409
virtual void UpdateVariable(NodeType &rNode)
Definition: time_integration_method.hpp:589
virtual void PredictSecondDerivative(NodeType &rNode)
Definition: time_integration_method.hpp:569
virtual void UpdateSecondDerivative(NodeType &rNode)
Definition: time_integration_method.hpp:599
std::string Info() const override
Turn back information as a string.
Definition: time_integration_method.hpp:366
virtual void UpdateFromSecondDerivative(NodeType &rNode)
Definition: time_integration_method.hpp:584
virtual void SetParameters(const ProcessInfo &rCurrentProcessInfo)
Definition: time_integration_method.hpp:172
virtual double & GetSecondDerivativeKineticFactor(double &rParameter)
Definition: time_integration_method.hpp:314
Node NodeType
NodeType.
Definition: time_integration_method.hpp:62
MethodFactorPointer mpSecondDerivativeKineticFactor
Definition: time_integration_method.hpp:432
virtual void PredictFromSecondDerivative(NodeType &rNode)
Definition: time_integration_method.hpp:554
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: time_integration_method.hpp:374
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
#define KRATOS_ERROR
Definition: exception.h:161
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
def load(f)
Definition: ode_solve.py:307