10 #if !defined(KRATOS_BDF_METHOD_H_INCLUDED)
11 #define KRATOS_BDF_METHOD_H_INCLUDED
49 template<
class TVariableType,
class TValueType>
83 BdfMethod(
const TVariableType& rVariable,
const TVariableType& rFirstDerivative,
const TVariableType& rSecondDerivative) :
BaseType(rVariable,rFirstDerivative,rSecondDerivative) {}
86 BdfMethod(
const TVariableType& rVariable,
const TVariableType& rFirstDerivative,
const TVariableType& rSecondDerivative,
const TVariableType& rPrimaryVariable) :
BaseType(rVariable,rFirstDerivative,rSecondDerivative,rPrimaryVariable) {}
119 const double&
delta_time = rCurrentProcessInfo[DELTA_TIME];
123 KRATOS_ERROR <<
" ERROR: detected delta_time = 0 in the Solution Method DELTA_TIME. PLEASE : check if the time step is created correctly for the current model part " << std::endl;
126 unsigned int order = 1;
127 if (rCurrentProcessInfo.
Has(TIME_INTEGRATION_ORDER))
129 order = rCurrentProcessInfo[TIME_INTEGRATION_ORDER];
132 if (rCurrentProcessInfo.
Has(BDF_COEFFICIENTS))
134 mBDF = rCurrentProcessInfo[BDF_COEFFICIENTS];
135 if(
mBDF.size() > 1 && (order + 1) !=
mBDF.size() )
136 order =
mBDF.size()-1;
139 if (
mBDF.size() == 0 ){
186 KRATOS_ERROR <<
"Methods with order > 6 are not zero-stable so they cannot be used" << std::endl;
191 rCurrentProcessInfo[TIME_INTEGRATION_ORDER] = order;
192 rCurrentProcessInfo[BDF_COEFFICIENTS] =
mBDF;
204 const double&
delta_time = rCurrentProcessInfo[DELTA_TIME];
207 if (rCurrentProcessInfo.
Has(TIME_INTEGRATION_ORDER))
209 mOrder = rCurrentProcessInfo[TIME_INTEGRATION_ORDER];
212 if (rCurrentProcessInfo.
Has(BDF_COEFFICIENTS))
214 mBDF = rCurrentProcessInfo[BDF_COEFFICIENTS];
229 rCurrentProcessInfo[BDF_COEFFICIENTS] =
mBDF;
251 KRATOS_ERROR <<
" time integration method FirstDerivative not set " <<std::endl;
255 KRATOS_ERROR <<
" time integration method SecondDerivative not set " <<std::endl;
278 std::string
Info()
const override
280 std::stringstream buffer;
281 buffer <<
"BdfMethod";
288 rOStream <<
"BdfMethod";
294 rOStream <<
"BdfMethod Data";
336 CurrentFirstDerivative -= CurrentFirstDerivative;
337 CurrentSecondDerivative -= CurrentSecondDerivative;
354 CurrentVariable = (CurrentFirstDerivative -
mBDF[1] * PreviousVariable)/
mBDF[0];
358 CurrentFirstDerivative = PreviousFirstDerivative;
359 CurrentSecondDerivative -= CurrentSecondDerivative;
377 CurrentFirstDerivative = (CurrentSecondDerivative -
mBDF[1] * PreviousFirstDerivative)/
mBDF[0];
378 CurrentVariable = (CurrentFirstDerivative -
mBDF[1] * PreviousVariable)/
mBDF[0];
430 CurrentFirstDerivative =
mBDF[0] * CurrentVariable +
mBDF[1] * PreviousVariable;
444 CurrentSecondDerivative =
mBDF[0] * CurrentFirstDerivative +
mBDF[1] * PreviousFirstDerivative;
476 CurrentVariable /=
mBDF[0];
495 CurrentFirstDerivative /=
mBDF[0];
501 CurrentVariable /=
mBDF[0];
549 rParameter =
mBDF[0];
595 void save(
Serializer& rSerializer)
const override
633 template<
class TVariableType,
class TValueType>
639 template<
class TVariableType,
class TValueType>
642 return rOStream << rThis.
Info();
Short class definition.
Definition: bdf_method.hpp:51
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: bdf_method.hpp:286
BdfMethod(BdfMethod &rOther)
Copy Constructor.
Definition: bdf_method.hpp:89
void UpdateFromFirstDerivative(NodeType &rNode) override
Definition: bdf_method.hpp:468
void SetParameters(const ProcessInfo &rCurrentProcessInfo) override
Definition: bdf_method.hpp:200
void UpdateVariable(NodeType &rNode) override
Definition: bdf_method.hpp:506
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: bdf_method.hpp:292
std::string Info() const override
Turn back information as a string.
Definition: bdf_method.hpp:278
~BdfMethod() override
Destructor.
Definition: bdf_method.hpp:104
BaseType::NodeType NodeType
NodeType.
Definition: bdf_method.hpp:64
BaseType::VariablePointer VariablePointer
KratosVariable or KratosVariableComponent.
Definition: bdf_method.hpp:67
void PredictFromFirstDerivative(NodeType &rNode) override
Definition: bdf_method.hpp:395
void UpdateFromVariable(NodeType &rNode) override
Definition: bdf_method.hpp:450
void AssignFromSecondDerivative(NodeType &rNode) override
Definition: bdf_method.hpp:364
void PredictSecondDerivative(NodeType &rNode) override
Definition: bdf_method.hpp:435
void UpdateFromSecondDerivative(NodeType &rNode) override
Definition: bdf_method.hpp:487
double & GetFirstDerivativeInertialParameter(double &rParameter) override
Definition: bdf_method.hpp:547
double mDeltaTime
Definition: bdf_method.hpp:315
BdfMethod()
Default Constructor.
Definition: bdf_method.hpp:77
void PredictFromVariable(NodeType &rNode) override
Definition: bdf_method.hpp:383
double & GetSecondDerivativeInertialParameter(double &rParameter) override
Definition: bdf_method.hpp:553
void UpdateFirstDerivative(NodeType &rNode) override
Definition: bdf_method.hpp:514
unsigned int mOrder
Definition: bdf_method.hpp:314
void CalculateParameters(ProcessInfo &rCurrentProcessInfo) override
Definition: bdf_method.hpp:115
int Check(const ProcessInfo &rCurrentProcessInfo) override
This function is designed to be called once to perform all the checks needed.
Definition: bdf_method.hpp:240
BaseType::Pointer BasePointerType
BasePointerType.
Definition: bdf_method.hpp:61
void PredictFirstDerivative(NodeType &rNode) override
Definition: bdf_method.hpp:422
void AssignFromFirstDerivative(NodeType &rNode) override
Definition: bdf_method.hpp:343
void SetProcessInfoParameters(ProcessInfo &rCurrentProcessInfo) override
Definition: bdf_method.hpp:225
Vector mBDF
Definition: bdf_method.hpp:316
void PredictVariable(NodeType &rNode) override
Definition: bdf_method.hpp:408
TimeIntegrationMethod< TVariableType, TValueType > BaseType
BaseType.
Definition: bdf_method.hpp:58
KRATOS_CLASS_POINTER_DEFINITION(BdfMethod)
BdfMethod(const TVariableType &rVariable, const TVariableType &rFirstDerivative, const TVariableType &rSecondDerivative, const TVariableType &rPrimaryVariable)
Constructor.
Definition: bdf_method.hpp:86
BdfMethod(const TVariableType &rVariable, const TVariableType &rFirstDerivative, const TVariableType &rSecondDerivative)
Constructor.
Definition: bdf_method.hpp:83
BdfMethod(const TVariableType &rVariable)
Constructor.
Definition: bdf_method.hpp:80
void UpdateSecondDerivative(NodeType &rNode) override
Definition: bdf_method.hpp:526
void AssignFromVariable(NodeType &rNode) override
Definition: bdf_method.hpp:322
BasePointerType Clone() override
Clone.
Definition: bdf_method.hpp:98
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
void resize(std::size_t NewSize1, std::size_t NewSize2, bool preserve=0)
Definition: amatrix_interface.h:224
This class defines the node.
Definition: node.h:65
TVariableType::Type & FastGetSolutionStepValue(const TVariableType &rThisVariable)
Definition: node.h:435
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
VariablePointer mpVariable
Definition: time_integration_method.hpp:405
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
const TVariableType * VariablePointer
KratosVariable or KratosVariableComponent.
Definition: time_integration_method.hpp:65
VariablePointer mpFirstDerivative
Definition: time_integration_method.hpp:407
VariablePointer mpSecondDerivative
Definition: time_integration_method.hpp:409
#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
delta_time
Definition: generate_frictional_mortar_condition.py:130
default
Definition: generate_gid_list_file.py:35
def load(f)
Definition: ode_solve.py:307
integer i
Definition: TensorModule.f:17