10 #if !defined(KRATOS_EMC_STEP_METHOD_H_INCLUDED)
11 #define KRATOS_EMC_STEP_METHOD_H_INCLUDED
49 template<
class TVariableType,
class TValueType>
64 const double& rdelta_time)
83 rSerializer.
save(
"c0",
c0);
84 rSerializer.
save(
"c1",
c1);
91 rSerializer.
load(
"c0",
c0);
92 rSerializer.
load(
"c1",
c1);
134 EmcStepMethod(
const TVariableType& rVariable,
const TVariableType& rFirstDerivative,
const TVariableType& rSecondDerivative) :
BaseType(rVariable,rFirstDerivative,rSecondDerivative)
140 EmcStepMethod(
const TVariableType& rVariable,
const TVariableType& rFirstDerivative,
const TVariableType& rSecondDerivative,
const TVariableType& rPrimaryVariable) :
BaseType(rVariable,rFirstDerivative,rSecondDerivative,rPrimaryVariable)
177 if (rCurrentProcessInfo.
Has(EQUILIBRIUM_POINT))
179 alpha = rCurrentProcessInfo[EQUILIBRIUM_POINT];
182 rCurrentProcessInfo[EQUILIBRIUM_POINT] =
alpha;
195 double delta_time = rCurrentProcessInfo[DELTA_TIME];
199 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;
203 if (rCurrentProcessInfo.
Has(EQUILIBRIUM_POINT))
205 alpha = rCurrentProcessInfo[EQUILIBRIUM_POINT];
218 rCurrentProcessInfo[EQUILIBRIUM_POINT] = this->
mEmc.
alpha;
248 KRATOS_ERROR <<
" time integration method Step Variable not set " <<std::endl;
270 std::string
Info()
const override
272 std::stringstream buffer;
273 buffer <<
"EmcStepMethod";
280 rOStream <<
"EmcStepMethod";
286 rOStream <<
"EmcStepMethod Data";
343 PreviousFirstDerivative = CurrentFirstDerivative;
345 CurrentVariable = PreviousVariable + (CurrentFirstDerivative+PreviousFirstDerivative) * (1.0/this->mEmc.
c0);
360 CurrentVariable = PreviousVariable + CurrentSecondDerivative * (1.0/(this->mEmc.
c0*this->mEmc.
c1));
394 CurrentStepVariable = CurrentVariable-PreviousVariable;
407 PreviousVariable = CurrentVariable;
422 CurrentFirstDerivative = this->mEmc.
c0 * (CurrentVariable-PreviousVariable) - PreviousFirstDerivative;
438 CurrentSecondDerivative = this->mEmc.
c1 * (CurrentFirstDerivative-PreviousFirstDerivative);
475 CurrentStepVariable += CurrentVariable-PreviousVariable;
488 PreviousVariable = CurrentVariable;
502 CurrentFirstDerivative = this->mEmc.
c0 * (CurrentStepVariable) - PreviousFirstDerivative;
517 CurrentSecondDerivative = this->mEmc.
c1 * (CurrentFirstDerivative - PreviousFirstDerivative);
563 void save(
Serializer& rSerializer)
const override
566 rSerializer.
save(
"EmcParameters",
mEmc);
573 rSerializer.
load(
"EmcParameters",
mEmc);
599 template<
class TVariableType,
class TValueType>
605 template<
class TVariableType,
class TValueType>
608 return rOStream << rThis.
Info();
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
Short class definition.
Definition: emc_step_method.hpp:51
BasePointerType Clone() override
Clone.
Definition: emc_step_method.hpp:154
virtual void PredictStepVariable(NodeType &rNode)
Definition: emc_step_method.hpp:384
void PredictSecondDerivative(NodeType &rNode) override
Definition: emc_step_method.hpp:427
void PredictFirstDerivative(NodeType &rNode) override
Definition: emc_step_method.hpp:412
BaseType::NodeType NodeType
NodeType.
Definition: emc_step_method.hpp:109
EmcStepMethod(const TVariableType &rVariable, const TVariableType &rFirstDerivative, const TVariableType &rSecondDerivative)
Constructor.
Definition: emc_step_method.hpp:134
EmcParameters mEmc
Definition: emc_step_method.hpp:307
BaseType::Pointer BasePointerType
BasePointerType.
Definition: emc_step_method.hpp:106
int Check(const ProcessInfo &rCurrentProcessInfo) override
This function is designed to be called once to perform all the checks needed.
Definition: emc_step_method.hpp:239
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: emc_step_method.hpp:284
void UpdateSecondDerivative(NodeType &rNode) override
Definition: emc_step_method.hpp:508
virtual void UpdateStepVariable(NodeType &rNode)
Definition: emc_step_method.hpp:465
void AssignFromSecondDerivative(NodeType &rNode) override
Definition: emc_step_method.hpp:350
void UpdateVariable(NodeType &rNode) override
Definition: emc_step_method.hpp:480
void SetProcessInfoParameters(ProcessInfo &rCurrentProcessInfo) override
Definition: emc_step_method.hpp:214
EmcStepMethod(const TVariableType &rVariable, const TVariableType &rFirstDerivative, const TVariableType &rSecondDerivative, const TVariableType &rPrimaryVariable)
Constructor.
Definition: emc_step_method.hpp:140
void UpdateFirstDerivative(NodeType &rNode) override
Definition: emc_step_method.hpp:493
void UpdateFromVariable(NodeType &rNode) override
Definition: emc_step_method.hpp:445
void SetParameters(const ProcessInfo &rCurrentProcessInfo) override
Definition: emc_step_method.hpp:191
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: emc_step_method.hpp:278
EmcStepMethod(EmcStepMethod &rOther)
Copy Constructor.
Definition: emc_step_method.hpp:146
~EmcStepMethod() override
Destructor.
Definition: emc_step_method.hpp:160
TimeIntegrationMethod< TVariableType, TValueType > BaseType
BaseType.
Definition: emc_step_method.hpp:103
void PredictFromVariable(NodeType &rNode) override
Definition: emc_step_method.hpp:365
EmcStepMethod(const TVariableType &rVariable)
Constructor.
Definition: emc_step_method.hpp:128
VariablePointer mpStepVariable
Definition: emc_step_method.hpp:310
BaseType::VariablePointer VariablePointer
KratosVariable or KratosVariableComponent.
Definition: emc_step_method.hpp:112
bool HasStepVariable() override
Definition: emc_step_method.hpp:224
void SetStepVariable(const TVariableType &rStepVariable) override
Definition: emc_step_method.hpp:230
void AssignFromFirstDerivative(NodeType &rNode) override
Definition: emc_step_method.hpp:332
void AssignFromVariable(NodeType &rNode) override
Definition: emc_step_method.hpp:321
KRATOS_CLASS_POINTER_DEFINITION(EmcStepMethod)
EmcStepMethod()
Default Constructor.
Definition: emc_step_method.hpp:122
void CalculateParameters(ProcessInfo &rCurrentProcessInfo) override
Definition: emc_step_method.hpp:171
void PredictVariable(NodeType &rNode) override
Definition: emc_step_method.hpp:399
std::string Info() const override
Turn back information as a string.
Definition: emc_step_method.hpp:270
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
alpha
Definition: generate_convection_diffusion_explicit_element.py:113
delta_time
Definition: generate_frictional_mortar_condition.py:130
def load(f)
Definition: ode_solve.py:307
Definition: emc_step_method.hpp:55
double c0
Definition: emc_step_method.hpp:60
void SetParameters(const double &ralpha, const double &rdelta_time)
Definition: emc_step_method.hpp:63
double c1
Definition: emc_step_method.hpp:61
double alpha
Definition: emc_step_method.hpp:56
double delta_time
Definition: emc_step_method.hpp:57