Description
Base class for a Chrono checkpoint database.
A Chrono checkpoint DB can be of SYSTEM type (in which case it contains all states associated with a given system) or of COMPONENT tpe (in which case it contains states for specific subsets of Chrono phsics items). The latter option is useful in checkpointing and initializing from a checkpoint sub-assemblies, for example vehicle systems. When importing a checkpoint to initialize a give system (SYSTEM-type checkpoint) or a subset of physics items (COMPONENT-type checkpoint), it is the caller's responsibility to ensure that the target objects (system or component lists) match the number and order in the system from which the checkpoint was generated.
To write a SYSTEM checkpoint file, call:
WriteState(...); WriteFile(...);
To write a COMPONENT checkpoint file, call:
WriteTime(...); WriteBodies(...); WriteShafts(...); ... WriteFile(...);
To read a SYSTEM checkpoint file, call:
OpenFile(...); ReadState(...);
To read a COMPONENT checkpoint file, call:
OpenFile(...); ReadTime(...); ReadBodies(...); ReadShafts(...); ...
#include <ChCheckpoint.h>

Public Types | |
| enum | Format { Format::ASCII } |
| Checkpoint output format. More... | |
| enum | Type { Type::SYSTEM, Type::COMPONENT } |
| Checkpoint type. More... | |
Public Member Functions | |
| virtual void | Initialize ()=0 |
| Initialize the checkpoint DB. | |
| virtual void | WriteState (ChSystem *sys)=0 |
| Write the entire state of the provided Chrono system. More... | |
| virtual void | WriteTime (double time)=0 |
| Write the checkpoint time. More... | |
| virtual void | WriteBodies (const std::vector< std::shared_ptr< ChBody >> &bodies)=0 |
| Write states of the bodies in the provided list. More... | |
| virtual void | WriteShafts (const std::vector< std::shared_ptr< ChShaft >> &shafts)=0 |
| Write states of the shafts in the provided list. More... | |
| virtual void | WriteJoints (const std::vector< std::shared_ptr< ChLink >> &joints)=0 |
| Write states of the joints in the provided list. More... | |
| virtual void | WriteCouples (const std::vector< std::shared_ptr< ChShaftsCouple >> &couples)=0 |
| Write states of the shaft couples in the provided list. More... | |
| virtual void | WriteLinSprings (const std::vector< std::shared_ptr< ChLinkTSDA >> &springs)=0 |
| Write states of the linear springs (TSDAs) in the provided list. More... | |
| virtual void | WriteRotSprings (const std::vector< std::shared_ptr< ChLinkRSDA >> &springs)=0 |
| Write states of the rotational springs (RSDAs) in the provided list. More... | |
| virtual void | WriteBodyBodyLoads (const std::vector< std::shared_ptr< ChLoadBodyBody >> &loads)=0 |
| Write states of the body-body loads in the provided list. More... | |
| virtual void | WriteLinMotors (const std::vector< std::shared_ptr< ChLinkMotorLinear >> &motors)=0 |
| Write states of the linear motors in the provided list. More... | |
| virtual void | WriteRotMotors (const std::vector< std::shared_ptr< ChLinkMotorRotation >> &motors)=0 |
| Write states of the rotational motors in the provided list. More... | |
| virtual void | WriteFile (const std::string &filename)=0 |
| Write the checkpoint database to a disk file with the specified name. | |
| virtual void | OpenFile (const std::string &filename)=0 |
| Open the checkpoint database from the disk file with the specified name. | |
| virtual void | ReadState (ChSystem *sys)=0 |
| Read the system-level state in the input checkpoint database and initialize the given system with that state. More... | |
| virtual void | ReadTime (double &time)=0 |
| Read the checkpoint time from the input checkpoint database. More... | |
| virtual void | ReadBodies (std::vector< std::shared_ptr< ChBody >> &bodies)=0 |
| Read body states from the input checkpoint database and set them to the bodies in the provided list. More... | |
| virtual void | ReadShafts (std::vector< std::shared_ptr< ChShaft >> &shafts)=0 |
| Read shaft states from the input checkpoint database and set them to the shafts in the provided list. More... | |
| virtual void | ReadJoints (std::vector< std::shared_ptr< ChLink >> &joints)=0 |
| Read joint states from the input checkpoint database and set them to the joints in the provided list. More... | |
| virtual void | ReadCouples (std::vector< std::shared_ptr< ChShaftsCouple >> &couples)=0 |
| Read couple states from the input checkpoint database and set them to the shaft couples in the provided list. More... | |
| virtual void | ReadLinSprings (std::vector< std::shared_ptr< ChLinkTSDA >> &springs)=0 |
| Read spring states from the input checkpoint database and set them to the TSDAs in the provided list. More... | |
| virtual void | ReadRotSprings (std::vector< std::shared_ptr< ChLinkRSDA >> &springs)=0 |
| Read spring states from the input checkpoint database and set them to the RSDAs in the provided list. More... | |
| virtual void | ReadBodyBodyLoads (std::vector< std::shared_ptr< ChLoadBodyBody >> &loads)=0 |
| Read body-body load states from the input checkpoint database and set them to the loads in the provided list. More... | |
| virtual void | ReadLinMotors (std::vector< std::shared_ptr< ChLinkMotorLinear >> &motors)=0 |
| Read motor states from the input checkpoint database and set them to the linear motors in the provided list. More... | |
| virtual void | ReadRotMotors (std::vector< std::shared_ptr< ChLinkMotorRotation >> &motors)=0 |
| Read motor states from the input checkpoint database and set them to the rotational motors in the provided list. More... | |
Static Public Member Functions | |
| static std::string | GetFormatAsString (Format format) |
| Return the provided checkpoint format as a string. | |
| static std::string | GetTypeAsString (Type type) |
| Return the provided checkpoint type as a string. | |
Protected Member Functions | |
| ChCheckpoint (Type type) | |
| void | CheckIfSystemType () const |
| Verify that the checkpoint is of type SYSTEM. | |
| void | CheckIfComponentType () const |
| Verify that the checkpoint is of type COMPONENT. | |
Protected Attributes | |
| Type | m_type |
| checkpoint database type | |
Member Enumeration Documentation
◆ Format
|
strong |
◆ Type
|
strong |
Member Function Documentation
◆ ReadBodies()
|
pure virtual |
Read body states from the input checkpoint database and set them to the bodies in the provided list.
Only for a COMPONENT type checkpoint DB.
Implemented in chrono::ChCheckpointASCII.
◆ ReadBodyBodyLoads()
|
pure virtual |
Read body-body load states from the input checkpoint database and set them to the loads in the provided list.
Only for a COMPONENT type checkpoint DB.
Implemented in chrono::ChCheckpointASCII.
◆ ReadCouples()
|
pure virtual |
Read couple states from the input checkpoint database and set them to the shaft couples in the provided list.
Only for a COMPONENT type checkpoint DB. Note that this list should only include kinematic shaft couples (i.e., no motors).
Implemented in chrono::ChCheckpointASCII.
◆ ReadJoints()
|
pure virtual |
Read joint states from the input checkpoint database and set them to the joints in the provided list.
Only for a COMPONENT type checkpoint DB. Note that this list should only include kinematic joints (i.e., no motors, springs, bushings).
Implemented in chrono::ChCheckpointASCII.
◆ ReadLinMotors()
|
pure virtual |
Read motor states from the input checkpoint database and set them to the linear motors in the provided list.
Only for a COMPONENT type checkpoint DB.
Implemented in chrono::ChCheckpointASCII.
◆ ReadLinSprings()
|
pure virtual |
Read spring states from the input checkpoint database and set them to the TSDAs in the provided list.
Only for a COMPONENT type checkpoint DB.
Implemented in chrono::ChCheckpointASCII.
◆ ReadRotMotors()
|
pure virtual |
Read motor states from the input checkpoint database and set them to the rotational motors in the provided list.
Only for a COMPONENT type checkpoint DB.
Implemented in chrono::ChCheckpointASCII.
◆ ReadRotSprings()
|
pure virtual |
Read spring states from the input checkpoint database and set them to the RSDAs in the provided list.
Only for a COMPONENT type checkpoint DB.
Implemented in chrono::ChCheckpointASCII.
◆ ReadShafts()
|
pure virtual |
Read shaft states from the input checkpoint database and set them to the shafts in the provided list.
Only for a COMPONENT type checkpoint DB.
Implemented in chrono::ChCheckpointASCII.
◆ ReadState()
|
pure virtual |
Read the system-level state in the input checkpoint database and initialize the given system with that state.
Only for a SYSTEM type checkpoint DB.
Implemented in chrono::ChCheckpointASCII.
◆ ReadTime()
|
pure virtual |
Read the checkpoint time from the input checkpoint database.
Only for a COMPONENT type checkpoint DB.
Implemented in chrono::ChCheckpointASCII.
◆ WriteBodies()
|
pure virtual |
Write states of the bodies in the provided list.
Only for a COMPONENT type checkpoint DB.
Implemented in chrono::ChCheckpointASCII.
◆ WriteBodyBodyLoads()
|
pure virtual |
Write states of the body-body loads in the provided list.
Only for a COMPONENT type checkpoint DB.
Implemented in chrono::ChCheckpointASCII.
◆ WriteCouples()
|
pure virtual |
Write states of the shaft couples in the provided list.
Only for a COMPONENT type checkpoint DB. Note that this list should only include kinematic shaft couples (i.e., no motors).
Implemented in chrono::ChCheckpointASCII.
◆ WriteJoints()
|
pure virtual |
Write states of the joints in the provided list.
Only for a COMPONENT type checkpoint DB. Note that this list should only include kinematic joints (i.e., no motors, springs, bushings).
Implemented in chrono::ChCheckpointASCII.
◆ WriteLinMotors()
|
pure virtual |
Write states of the linear motors in the provided list.
Only for a COMPONENT type checkpoint DB.
Implemented in chrono::ChCheckpointASCII.
◆ WriteLinSprings()
|
pure virtual |
Write states of the linear springs (TSDAs) in the provided list.
Only for a COMPONENT type checkpoint DB.
Implemented in chrono::ChCheckpointASCII.
◆ WriteRotMotors()
|
pure virtual |
Write states of the rotational motors in the provided list.
Only for a COMPONENT type checkpoint DB.
Implemented in chrono::ChCheckpointASCII.
◆ WriteRotSprings()
|
pure virtual |
Write states of the rotational springs (RSDAs) in the provided list.
Only for a COMPONENT type checkpoint DB.
Implemented in chrono::ChCheckpointASCII.
◆ WriteShafts()
|
pure virtual |
Write states of the shafts in the provided list.
Only for a COMPONENT type checkpoint DB.
Implemented in chrono::ChCheckpointASCII.
◆ WriteState()
|
pure virtual |
Write the entire state of the provided Chrono system.
Only for a SYSTEM type checkpoint DB.
Implemented in chrono::ChCheckpointASCII.
◆ WriteTime()
|
pure virtual |
Write the checkpoint time.
Only for a COMPONENT type checkpoint DB.
Implemented in chrono::ChCheckpointASCII.
The documentation for this class was generated from the following file:
- /builds/uwsbel/chrono/src/chrono/output/ChCheckpoint.h