KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
Geomechanics Time Integration Schemes

Introduction

The Scheme class in Kratos is used to create time integration schemes. It is an abstract class, for which Geomechanics has implemented a number of flavors, subdivided in the Backward Euler and the Generalized Newmark families.

Code Structure

The bulk of the functionality is implemented in the GeoMechanicsTimeIntegrationScheme class. It contains two lists of variables that are used in the time integration schemes. A list of first order scalar variables (such as water pressure or temperature) and a list of second order vector variables (such as displacements or rotations). For the first order time derivatives, only the first time derivative is taken into account, while for the second order time derivatives, both the first and the second time derivatives are considered. These lists are filled in the constructor by derived classes that specify which variables are used in the time integration scheme.

The functions that the GeoMechanicsTimeIntegrationScheme class implements are mostly dictated by the Scheme interface and include functionality like checking if all variables are allocated in the modelpart, getting DofLists, EquationIds and calling different flavors of the Initialize/Finalize/CalculateSystemContributions functions on elements and conditions.

It also has a general Update step, which calls the UpdateVariablesDerivatives function. This is a purely virtual function that has to be implemented by the derived classes. This is because the actual updating of the derivatives, defines a time integration scheme. The derived classes then use the lists of variables to update the derivatives. In our structure (see the class diagram), only the BackwardEulerScheme and the GeneralizedNewmarkScheme classes implement this function. Similarly the SetTimeFactors function, updates the delta time, but also the time coefficients, for which the overrides are found in the derived classes. For the specific equations, see sections Backward Euler and Generalized Newmark.

SchemeStructure.svg Class structure of the schemes generated using the SchemeStructure.puml file with PlantUML. Note that the class diagram is simplified and only shows the functions that need emphasis.

The child classes which actually specify which variables are used in the time integration scheme (e.g. the BackwardEulerUPwScheme or the `GeneralizedNewmarkTScheme), only fill the lists of first/second order variables.

The exceptions are the NewmarkQuasistaticUPwScheme, which has functionality for nodal smoothing (this should be moved to another location) and the damped and dynamic UPw schemes. More info on these can be found in the Dynamic and damped schemes section.

Backward Euler

The most straight-forward scheme type is called Backward Euler. The functionality described in this section can be found in the BackwardEulerScheme class. The first and second time derivatives are simply calculated by dividing the difference in their integrated variables by the time step. This results in the following equations for the scalar and vector derivatives.

First order scalar derivatives, in UpdateScalarTimeDerivative: $$

{x} _{t + \Delta t} = (x_{t + \Delta t} - x_{t} ) / \Delta t$$