10 #if !defined(KRATOS_BACKWARD_EULER_METHOD_H_INCLUDED)
11 #define KRATOS_BACKWARD_EULER_METHOD_H_INCLUDED
49 template<
class TVariableType,
class TValueType>
83 BackwardEulerMethod(
const TVariableType& rVariable,
const TVariableType& rFirstDerivative,
const TVariableType& rSecondDerivative) :
BaseType(rVariable,rFirstDerivative,rSecondDerivative) {}
86 BackwardEulerMethod(
const TVariableType& rVariable,
const TVariableType& rFirstDerivative,
const TVariableType& rSecondDerivative,
const TVariableType& rPrimaryVariable) :
BaseType(rVariable,rFirstDerivative,rSecondDerivative,rPrimaryVariable) {}
117 const double&
delta_time = rCurrentProcessInfo[DELTA_TIME];
121 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;
152 KRATOS_ERROR <<
" time integration method FirstDerivative not set " <<std::endl;
156 KRATOS_ERROR <<
" time integration method SecondDerivative not set " <<std::endl;
178 std::string
Info()
const override
180 std::stringstream buffer;
181 buffer <<
"BackwardEulerMethod";
188 rOStream <<
"BackwardEulerMethod";
194 rOStream <<
"BackwardEulerMethod Data";
228 CurrentFirstDerivative -= CurrentFirstDerivative;
229 CurrentSecondDerivative -= CurrentSecondDerivative;
248 CurrentVariable = (1.0/3.0) * ( 4.0 * PreviousVariable - OldPreviousVariable + 2.0 *
mDeltaTime * CurrentFirstDerivative);
252 CurrentFirstDerivative = PreviousFirstDerivative;
253 CurrentSecondDerivative -= CurrentSecondDerivative;
271 CurrentVariable = PreviousVariable +
mDeltaTime * ( PreviousFirstDerivative + 0.5 *
mDeltaTime * CurrentSecondDerivative );
308 CurrentVariable = PreviousVariable +
mDeltaTime * PreviousFirstDerivative;
329 CurrentFirstDerivative = (1.0/
mDeltaTime) * ( 3.0 * 0.5 * CurrentVariable - 2.0 * PreviousVariable + 0.5 * OldPreviousVariable);
369 CurrentFirstDerivative = (1.0/
mDeltaTime) * ( (3.0/2.0) * CurrentVariable - 2.0 * PreviousVariable + 0.5 * OldPreviousVariable);
389 CurrentVariable = (2.0 / 3.0) * (
mDeltaTime * CurrentFirstDerivative + 2.0 * PreviousVariable - 0.5 * OldPreviousVariable);
410 CurrentFirstDerivative = (1.0/
mDeltaTime) * ( 3.0 * 0.5 * CurrentVariable - 2.0 * PreviousVariable + 0.5 * OldPreviousVariable);
433 CurrentFirstDerivative = (1.0/
mDeltaTime) * ( 3.0 * 0.5 * CurrentVariable - 2.0 * PreviousVariable + 0.5 * OldPreviousVariable);
510 void save(
Serializer& rSerializer)
const override
544 template<
class TVariableType,
class TValueType>
550 template<
class TVariableType,
class TValueType>
553 return rOStream << rThis.
Info();
Short class definition.
Definition: backward_euler_method.hpp:51
void UpdateFromVariable(NodeType &rNode) override
Definition: backward_euler_method.hpp:354
int Check(const ProcessInfo &rCurrentProcessInfo) override
This function is designed to be called once to perform all the checks needed.
Definition: backward_euler_method.hpp:142
double mDeltaTime
Definition: backward_euler_method.hpp:214
double & GetSecondDerivativeInertialParameter(double &rParameter) override
Definition: backward_euler_method.hpp:468
void AssignFromSecondDerivative(NodeType &rNode) override
Definition: backward_euler_method.hpp:258
double & GetFirstDerivativeInertialParameter(double &rParameter) override
Definition: backward_euler_method.hpp:462
BackwardEulerMethod(const TVariableType &rVariable, const TVariableType &rFirstDerivative, const TVariableType &rSecondDerivative)
Constructor.
Definition: backward_euler_method.hpp:83
void PredictFromVariable(NodeType &rNode) override
Definition: backward_euler_method.hpp:276
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: backward_euler_method.hpp:192
void UpdateFirstDerivative(NodeType &rNode) override
Definition: backward_euler_method.hpp:423
BackwardEulerMethod(const TVariableType &rVariable)
Constructor.
Definition: backward_euler_method.hpp:80
void UpdateSecondDerivative(NodeType &rNode) override
Definition: backward_euler_method.hpp:438
void AssignFromVariable(NodeType &rNode) override
Definition: backward_euler_method.hpp:220
BasePointerType Clone() override
Clone.
Definition: backward_euler_method.hpp:96
void SetProcessInfoParameters(ProcessInfo &rCurrentProcessInfo) override
Definition: backward_euler_method.hpp:130
std::string Info() const override
Turn back information as a string.
Definition: backward_euler_method.hpp:178
void PredictFirstDerivative(NodeType &rNode) override
Definition: backward_euler_method.hpp:314
TimeIntegrationMethod< TVariableType, TValueType > BaseType
BaseType.
Definition: backward_euler_method.hpp:58
KRATOS_CLASS_POINTER_DEFINITION(BackwardEulerMethod)
void PredictFromFirstDerivative(NodeType &rNode) override
Definition: backward_euler_method.hpp:287
void UpdateVariable(NodeType &rNode) override
Definition: backward_euler_method.hpp:415
BaseType::Pointer BasePointerType
BasePointerType.
Definition: backward_euler_method.hpp:61
void UpdateFromSecondDerivative(NodeType &rNode) override
Definition: backward_euler_method.hpp:396
BaseType::VariablePointer VariablePointer
KratosVariable or KratosVariableComponent.
Definition: backward_euler_method.hpp:67
BaseType::NodeType NodeType
NodeType.
Definition: backward_euler_method.hpp:64
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: backward_euler_method.hpp:186
BackwardEulerMethod(BackwardEulerMethod &rOther)
Copy Constructor.
Definition: backward_euler_method.hpp:89
BackwardEulerMethod(const TVariableType &rVariable, const TVariableType &rFirstDerivative, const TVariableType &rSecondDerivative, const TVariableType &rPrimaryVariable)
Constructor.
Definition: backward_euler_method.hpp:86
void PredictVariable(NodeType &rNode) override
Definition: backward_euler_method.hpp:298
BackwardEulerMethod()
Default Constructor.
Definition: backward_euler_method.hpp:77
void PredictSecondDerivative(NodeType &rNode) override
Definition: backward_euler_method.hpp:334
void SetParameters(const ProcessInfo &rCurrentProcessInfo) override
Definition: backward_euler_method.hpp:113
void AssignFromFirstDerivative(NodeType &rNode) override
Definition: backward_euler_method.hpp:235
void UpdateFromFirstDerivative(NodeType &rNode) override
Definition: backward_euler_method.hpp:375
~BackwardEulerMethod() override
Destructor.
Definition: backward_euler_method.hpp:102
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
def load(f)
Definition: ode_solve.py:307