Open rfaasse opened 6 months ago
After a brief look at the code with @WPK4FEM, it seems that the first order prediction could be done by adding the following piece of code to the PredictVariablesForNode
function (it is a simple first order Taylor expansion around the variable value).
for (const auto& r_first_order_scalar_variable : this->GetFirstOrderScalarVariables())
{
if (!rNode.SolutionStepsDataHas(r_first_order_scalar_variable.instance) || rNode.IsFixed(r_first_order_scalar_variable.instance))
continue;
const double previous_variable =
rNode.FastGetSolutionStepValue(r_first_order_scalar_variable.instance, 1);
const double previous_first_time_derivative =
rNode.FastGetSolutionStepValue(r_first_order_scalar_variable.first_time_derivative, 1);
rNode.FastGetSolutionStepValue(r_first_order_scalar_variable.instance) =
previous_variable + this->GetDeltaTime() * previous_first_time_derivative;
}
For the Predict of the instance of the second order variables (e.g. displacement/rotation), we probably need to change the formulation from:
rNode.FastGetSolutionStepValue(instance_component) =
previous_variable + this->GetDeltaTime() * previous_first_time_derivative +
0.5 * this->GetDeltaTime() * this->GetDeltaTime() * previous_second_time_derivative;
to:
rNode.FastGetSolutionStepValue(instance_component) =
previous_variable + this->GetDeltaTime() * previous_first_time_derivative +
(0.5-this->GetBeta()) * this->GetDeltaTime() * this->GetDeltaTime() * previous_second_time_derivative;
As a Kratos user, I would like to have prediction methods in the newmark schemes, such that convergence is quicker when using these schemes.
Successor item: [GeoMechanicsApplication] Include variable prediction in the backward euler schemes
Background During the scheme refactoring, it was found that the dynamic newmark scheme has an override for the 'Predict' method. This method predicts the values of certain variables before doing a solution step, to improve the rate of convergence.
However, there are two things missing here:
Acceptance Criteria Given a user specifies any newmark scheme When a simulation is run Then the first and second order variables are predicted
Note: It might be interesting to document a few cases here and compare run times with/without predicts.