WRApplication
External kratos "application" for multiscale time integration.
CheckpointProcess Class Reference

Main interface process for checkpointing. More...

Inheritance diagram for CheckpointProcess:
Collaboration diagram for CheckpointProcess:

Public Member Functions

None Initialize (self)
 
None ExecuteInitializeSolutionStep (self)
 Load data from a checkpoint if the checkpoint selector returns an ID. More...
 
None ExecuteFinalizeSolutionStep (self)
 Write a new snapshot if the write predicate returns true. More...
 
KratosMultiphysics.Parameters GetDefaultParameters (cls)
 

Detailed Description

Main interface process for checkpointing.

@classname CheckpointProcess

CheckpointProcess optionally executes load operations in ExecuteInitializeSolutionStep and write operations in ExecuteFinalizeSolutionStep. The process itself implements minimal logic and defers the execution of tasks to the following components:

  • IO Format : The checkpointing format can be configured via the "snapshot_type" subparameter in the input parameters, which must refer to a valid implementation of Snapshot that is accessible from the RuntimeRegistry. Check out HDF5Snapshot for a reference implementation. The checkpoint system can be configured by specifying the "snapshot_parameters" subparameter in the input parameters, that gets forwarded to the selected snapshot's SnapshotManager. The default settings configure HDF5 input/output that covers all nodal, element, and condition variables and flags, as well as the entire ProcessInfo.
  • Output control: a ModelPredicate that decides whether a snapshot should be written based on the current state of the input Model. The predicate type must be accessible from the RuntimeRegistry, and can be configured via the "write_predicate" subparameter in the input parameters.
    "write_predicate" : {
    "type" : "name-of-the-predicate-type-in-the-registry",
    "parameters" : {<parameters-passed-to-the-predicate-instance>}
    }
    The default behaviour is writing a snapshot at each time step.
  • Input control: a callable with the following signature:
    std::optional<WRApp::CheckpointID> (const Model&)
    that decides whether a checkpoint should be loaded, and if yes, which one; based on the current state of the provided Model. The callable type must be accessible through the RuntimeRegistry, and can be configured via the "checkpoint_selector" subparameter in the input parameters.
    "checkpoint_selector" : {
    "type" : "name-of-the-callable-type-in-the-registry",
    "parameters" : {<parameters-passed-to-the-callable-instance>}
    }
    The default behaviour is never to load any checkpoints. Default parameters:
    {
    "model_part_name" : "",
    "snapshot_type" : "WRApplication.Snapshot.SnapshotFS.HDF5Snapshot",
    "snapshot_parameters" : {...},
    "write_predicate" : {
    "type" : "WRApplication.ConstModelPredicate",
    "parameters" : [{"value" : true}]
    },
    "checkpoint_selector" : {
    "type" : "WRApplication.CheckpointSelector.DefaultCheckpointSelector",
    "parameters" : []
    }
    }
    Note
    This process should only be constructed after the mesh was loaded, and all variables (historical/non-historical nodal, element, condition, process info) were added in the target ModelPart. Although new Snapshot implementations can be added that relax this requirement, all current implementations assume that the topology of the mesh does not change throughout the analysis, and no variables are added/removed to/from any component in the subject ModelPart.
    The default implementation assumes that the list of (non-historical) variables is uniform within component types of the ModelPart (eg: all elements have the exact same list of variables).

Member Function Documentation

◆ ExecuteFinalizeSolutionStep()

None ExecuteFinalizeSolutionStep (   self)

Write a new snapshot if the write predicate returns true.

◆ ExecuteInitializeSolutionStep()

None ExecuteInitializeSolutionStep (   self)

Load data from a checkpoint if the checkpoint selector returns an ID.

◆ GetDefaultParameters()

KratosMultiphysics.Parameters GetDefaultParameters (   cls)

◆ Initialize()

None Initialize (   self)

The documentation for this class was generated from the following file: