chrono::ChCheckpointASCII Class Reference

Description

ASCII text Chrono checkpoint database.

#include <ChCheckpointASCII.h>

Inheritance diagram for chrono::ChCheckpointASCII:
Collaboration diagram for chrono::ChCheckpointASCII:

Public Member Functions

 ChCheckpointASCII (Type type)
 
virtual void Initialize () override
 Initialize the checkpoint DB.
 
virtual void WriteState (ChSystem *sys) override
 Write the entire state of the provided Chrono system. More...
 
virtual void WriteTime (double time) override
 Write the checkpoint time. More...
 
virtual void WriteBodies (const std::vector< std::shared_ptr< ChBody >> &bodies) override
 Write states of the bodies in the provided list. More...
 
virtual void WriteShafts (const std::vector< std::shared_ptr< ChShaft >> &shafts) override
 Write states of the shafts in the provided list. More...
 
virtual void WriteJoints (const std::vector< std::shared_ptr< ChLink >> &joints) override
 Write states of the joints in the provided list. More...
 
virtual void WriteCouples (const std::vector< std::shared_ptr< ChShaftsCouple >> &couples) override
 Write states of the shaft couples in the provided list. More...
 
virtual void WriteLinSprings (const std::vector< std::shared_ptr< ChLinkTSDA >> &springs) override
 Write states of the linear springs (TSDAs) in the provided list. More...
 
virtual void WriteRotSprings (const std::vector< std::shared_ptr< ChLinkRSDA >> &springs) override
 Write states of the rotational springs (RSDAs) in the provided list. More...
 
virtual void WriteBodyBodyLoads (const std::vector< std::shared_ptr< ChLoadBodyBody >> &loads) override
 Write states of the body-body loads in the provided list. More...
 
virtual void WriteLinMotors (const std::vector< std::shared_ptr< ChLinkMotorLinear >> &motors) override
 Write states of the linear motors in the provided list. More...
 
virtual void WriteRotMotors (const std::vector< std::shared_ptr< ChLinkMotorRotation >> &motors) override
 Write states of the rotational motors in the provided list. More...
 
virtual void WriteDouble (double value) override
 Write the specified double value. More...
 
virtual void WriteInteger (int value) override
 Write the specified integer value. More...
 
virtual void WriteVector (const std::vector< double > &vector) override
 Write the components of the specified vector of doubles. More...
 
virtual void WriteChVector3 (const ChVector3d &vector) override
 Write the components of the specified 3D vector (with double values). More...
 
virtual void WriteChQuaternion (const ChQuaterniond &quat) override
 Write the components of the specified quaternion (with double values). More...
 
virtual void WriteFile (const std::string &filename) override
 Write the checkpoint database to a disk file with the specified name.
 
virtual void OpenFile (const std::string &filename) override
 Open the checkpoint database from the disk file with the specified name.
 
virtual void ReadState (ChSystem *sys) override
 Read the system-level state in the input checkpoint database and initialize the given system with that state. More...
 
virtual void ReadTime (double &time) override
 Read the checkpoint time from the input checkpoint database. More...
 
virtual void ReadBodies (std::vector< std::shared_ptr< ChBody >> &bodies) override
 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) override
 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) override
 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) override
 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) override
 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) override
 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) override
 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) override
 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) override
 Read motor states from the input checkpoint database and set them to the rotational motors in the provided list. More...
 
virtual void ReadDouble (double &value) override
 Read a double value and set it to the provided variable. More...
 
virtual void ReadInteger (int &value) override
 Read an integer value and set it to the provided variable. More...
 
virtual void ReadVector (std::vector< double > &vector) override
 Read a sequence of double values and load them in the provided vector. More...
 
virtual void ReadChVector3 (ChVector3d &vector) override
 Read components of a 3D vector from the input checkpoint database and set them to the provided vector. More...
 
virtual void ReadChQuaternion (ChQuaterniond &quat) override
 Read components of a quaternion from the input checkpoint database and set them to the provided ChQuaternion. More...
 

Additional Inherited Members

- Public Types inherited from chrono::ChCheckpoint
enum  Format { Format::ASCII }
 Checkpoint output format. More...
 
enum  Type { Type::SYSTEM, Type::COMPONENT }
 Checkpoint type. More...
 
- Static Public Member Functions inherited from chrono::ChCheckpoint
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 inherited from chrono::ChCheckpoint
 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 inherited from chrono::ChCheckpoint
Type m_type
 checkpoint database type
 

Member Function Documentation

◆ ReadBodies()

void chrono::ChCheckpointASCII::ReadBodies ( std::vector< std::shared_ptr< ChBody >> &  bodies)
overridevirtual

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.

Implements chrono::ChCheckpoint.

◆ ReadBodyBodyLoads()

void chrono::ChCheckpointASCII::ReadBodyBodyLoads ( std::vector< std::shared_ptr< ChLoadBodyBody >> &  loads)
overridevirtual

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.

Implements chrono::ChCheckpoint.

◆ ReadChQuaternion()

void chrono::ChCheckpointASCII::ReadChQuaternion ( ChQuaterniond quat)
overridevirtual

Read components of a quaternion from the input checkpoint database and set them to the provided ChQuaternion.

Only for a COMPONENT type checkpoint DB.

Implements chrono::ChCheckpoint.

◆ ReadChVector3()

void chrono::ChCheckpointASCII::ReadChVector3 ( ChVector3d vector)
overridevirtual

Read components of a 3D vector from the input checkpoint database and set them to the provided vector.

Only for a COMPONENT type checkpoint DB.

Implements chrono::ChCheckpoint.

◆ ReadCouples()

void chrono::ChCheckpointASCII::ReadCouples ( std::vector< std::shared_ptr< ChShaftsCouple >> &  couples)
overridevirtual

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).

Implements chrono::ChCheckpoint.

◆ ReadDouble()

void chrono::ChCheckpointASCII::ReadDouble ( double &  value)
overridevirtual

Read a double value and set it to the provided variable.

Only for a COMPONENT type checkpoint DB.

Implements chrono::ChCheckpoint.

◆ ReadInteger()

void chrono::ChCheckpointASCII::ReadInteger ( int &  value)
overridevirtual

Read an integer value and set it to the provided variable.

Only for a COMPONENT type checkpoint DB.

Implements chrono::ChCheckpoint.

◆ ReadJoints()

void chrono::ChCheckpointASCII::ReadJoints ( std::vector< std::shared_ptr< ChLink >> &  joints)
overridevirtual

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).

Implements chrono::ChCheckpoint.

◆ ReadLinMotors()

void chrono::ChCheckpointASCII::ReadLinMotors ( std::vector< std::shared_ptr< ChLinkMotorLinear >> &  motors)
overridevirtual

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.

Implements chrono::ChCheckpoint.

◆ ReadLinSprings()

void chrono::ChCheckpointASCII::ReadLinSprings ( std::vector< std::shared_ptr< ChLinkTSDA >> &  springs)
overridevirtual

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.

Implements chrono::ChCheckpoint.

◆ ReadRotMotors()

void chrono::ChCheckpointASCII::ReadRotMotors ( std::vector< std::shared_ptr< ChLinkMotorRotation >> &  motors)
overridevirtual

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.

Implements chrono::ChCheckpoint.

◆ ReadRotSprings()

void chrono::ChCheckpointASCII::ReadRotSprings ( std::vector< std::shared_ptr< ChLinkRSDA >> &  springs)
overridevirtual

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.

Implements chrono::ChCheckpoint.

◆ ReadShafts()

void chrono::ChCheckpointASCII::ReadShafts ( std::vector< std::shared_ptr< ChShaft >> &  shafts)
overridevirtual

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.

Implements chrono::ChCheckpoint.

◆ ReadState()

void chrono::ChCheckpointASCII::ReadState ( ChSystem sys)
overridevirtual

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.

Implements chrono::ChCheckpoint.

◆ ReadTime()

void chrono::ChCheckpointASCII::ReadTime ( double &  time)
overridevirtual

Read the checkpoint time from the input checkpoint database.

Only for a COMPONENT type checkpoint DB.

Implements chrono::ChCheckpoint.

◆ ReadVector()

void chrono::ChCheckpointASCII::ReadVector ( std::vector< double > &  vector)
overridevirtual

Read a sequence of double values and load them in the provided vector.

Only for a COMPONENT type checkpoint DB.

Implements chrono::ChCheckpoint.

◆ WriteBodies()

void chrono::ChCheckpointASCII::WriteBodies ( const std::vector< std::shared_ptr< ChBody >> &  bodies)
overridevirtual

Write states of the bodies in the provided list.

Only for a COMPONENT type checkpoint DB.

Implements chrono::ChCheckpoint.

◆ WriteBodyBodyLoads()

void chrono::ChCheckpointASCII::WriteBodyBodyLoads ( const std::vector< std::shared_ptr< ChLoadBodyBody >> &  loads)
overridevirtual

Write states of the body-body loads in the provided list.

Only for a COMPONENT type checkpoint DB.

Implements chrono::ChCheckpoint.

◆ WriteChQuaternion()

void chrono::ChCheckpointASCII::WriteChQuaternion ( const ChQuaterniond quat)
overridevirtual

Write the components of the specified quaternion (with double values).

Only for a COMPONENT type checkpoint DB.

Implements chrono::ChCheckpoint.

◆ WriteChVector3()

void chrono::ChCheckpointASCII::WriteChVector3 ( const ChVector3d vector)
overridevirtual

Write the components of the specified 3D vector (with double values).

Only for a COMPONENT type checkpoint DB.

Implements chrono::ChCheckpoint.

◆ WriteCouples()

void chrono::ChCheckpointASCII::WriteCouples ( const std::vector< std::shared_ptr< ChShaftsCouple >> &  couples)
overridevirtual

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).

Implements chrono::ChCheckpoint.

◆ WriteDouble()

void chrono::ChCheckpointASCII::WriteDouble ( double  value)
overridevirtual

Write the specified double value.

Only for a COMPONENT type checkpoint DB.

Implements chrono::ChCheckpoint.

◆ WriteInteger()

void chrono::ChCheckpointASCII::WriteInteger ( int  value)
overridevirtual

Write the specified integer value.

Only for a COMPONENT type checkpoint DB.

Implements chrono::ChCheckpoint.

◆ WriteJoints()

void chrono::ChCheckpointASCII::WriteJoints ( const std::vector< std::shared_ptr< ChLink >> &  joints)
overridevirtual

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).

Implements chrono::ChCheckpoint.

◆ WriteLinMotors()

void chrono::ChCheckpointASCII::WriteLinMotors ( const std::vector< std::shared_ptr< ChLinkMotorLinear >> &  motors)
overridevirtual

Write states of the linear motors in the provided list.

Only for a COMPONENT type checkpoint DB.

Implements chrono::ChCheckpoint.

◆ WriteLinSprings()

void chrono::ChCheckpointASCII::WriteLinSprings ( const std::vector< std::shared_ptr< ChLinkTSDA >> &  springs)
overridevirtual

Write states of the linear springs (TSDAs) in the provided list.

Only for a COMPONENT type checkpoint DB.

Implements chrono::ChCheckpoint.

◆ WriteRotMotors()

void chrono::ChCheckpointASCII::WriteRotMotors ( const std::vector< std::shared_ptr< ChLinkMotorRotation >> &  motors)
overridevirtual

Write states of the rotational motors in the provided list.

Only for a COMPONENT type checkpoint DB.

Implements chrono::ChCheckpoint.

◆ WriteRotSprings()

void chrono::ChCheckpointASCII::WriteRotSprings ( const std::vector< std::shared_ptr< ChLinkRSDA >> &  springs)
overridevirtual

Write states of the rotational springs (RSDAs) in the provided list.

Only for a COMPONENT type checkpoint DB.

Implements chrono::ChCheckpoint.

◆ WriteShafts()

void chrono::ChCheckpointASCII::WriteShafts ( const std::vector< std::shared_ptr< ChShaft >> &  shafts)
overridevirtual

Write states of the shafts in the provided list.

Only for a COMPONENT type checkpoint DB.

Implements chrono::ChCheckpoint.

◆ WriteState()

void chrono::ChCheckpointASCII::WriteState ( ChSystem sys)
overridevirtual

Write the entire state of the provided Chrono system.

Only for a SYSTEM type checkpoint DB.

Implements chrono::ChCheckpoint.

◆ WriteTime()

void chrono::ChCheckpointASCII::WriteTime ( double  time)
overridevirtual

Write the checkpoint time.

Only for a COMPONENT type checkpoint DB.

Implements chrono::ChCheckpoint.

◆ WriteVector()

void chrono::ChCheckpointASCII::WriteVector ( const std::vector< double > &  vector)
overridevirtual

Write the components of the specified vector of doubles.

Only for a COMPONENT type checkpoint DB.

Implements chrono::ChCheckpoint.


The documentation for this class was generated from the following files:
  • /builds/uwsbel/chrono/src/chrono/input_output/ChCheckpointASCII.h
  • /builds/uwsbel/chrono/src/chrono/input_output/ChCheckpointASCII.cpp