Description
Utility class to parse YAML specification files for Chrono models and simulations.
The parser caches model information and simulation settings from the corresponding YAML input files and then allows populating a Chrono system and setting solver and simulation parameters.
#include <ChParserMbsYAML.h>
Public Member Functions | |
ChParserMbsYAML (const std::string &yaml_model_filename, const std::string &yaml_sim_filename, bool verbose=false) | |
Create a YAML parser and load the model from the specified input YAML file. | |
void | SetVerbose (bool verbose) |
Set verbose termsinal output (default: false). | |
bool | HasSimulationData () const |
Return true if a YAML simulation file has been loaded. | |
bool | HasModelData () const |
Return true if a YAML model file has been loaded. | |
void | LoadSimulationFile (const std::string &yaml_filename) |
Load the simulation parameters from the specified input YAML simulation file. | |
double | GetTimestep () const |
double | GetEndtime () const |
bool | EnforceRealtime () const |
bool | Render () const |
double | GetRenderFPS () const |
CameraVerticalDir | GetCameraVerticalDir () const |
const ChVector3d & | GetCameraLocation () const |
const ChVector3d & | GetCameraTarget () const |
bool | EnableShadows () const |
ChOutput::Type | GetOutputType () const |
double | GetOutputFPS () const |
std::shared_ptr< ChSystem > | CreateSystem () |
Create and return a Chrono system configured from cached simulation parameters. More... | |
void | SetSimulationParameters (ChSystem &sys) |
Set solver and integrator settings from cached values. More... | |
void | LoadModelFile (const std::string &yaml_filename) |
Load the model from the specified input YAML model file. | |
const std::string & | GetName () const |
Return the name of the YAML model. | |
int | Populate (ChSystem &sys, const ChFramed &model_frame=ChFramed(), const std::string &model_prefix="") |
Populate the given system with the cached Chrono components. More... | |
void | Depopulate (ChSystem &sys, int instance_index) |
Remove from the specified system the Chrono objects from the specified instance. | |
bool | Output () const |
Return true if generating output. | |
void | SetOutputDir (const std::string &out_dir) |
Set root output directory (default: ""). | |
void | SaveOutput (ChSystem &sys, int frame) |
Save simulation output results at the current time. | |
Static Public Member Functions | |
static ChVector3d | ReadVector (const YAML::Node &a) |
Load and return a ChVector3d from the specified node. | |
static ChQuaterniond | ReadQuaternion (const YAML::Node &a) |
Load and return a ChQuaternion from the specified node. | |
static ChQuaterniond | ReadCardanAngles (const YAML::Node &a, bool use_degrees) |
Load a Cardan angle sequence from the specified node and return as a quaternion. More... | |
static ChQuaterniond | ReadRotation (const YAML::Node &a, bool use_degrees) |
Return a quaternion loaded from the specified node. More... | |
static ChCoordsysd | ReadCoordinateSystem (const YAML::Node &a, bool use_degrees) |
Load and return a coordinate system from the specified node. | |
static ChColor | ReadColor (const YAML::Node &a) |
Load and return a ChColor from the specified node. | |
Friends | |
class | ChParserFsiYAML |
Member Function Documentation
◆ CreateSystem()
std::shared_ptr< ChSystem > chrono::parsers::ChParserMbsYAML::CreateSystem | ( | ) |
Create and return a Chrono system configured from cached simulation parameters.
If no YAML simulation file was loaded, this function returns a ChSystemNSC with default settings.
◆ Populate()
int chrono::parsers::ChParserMbsYAML::Populate | ( | ChSystem & | sys, |
const ChFramed & | model_frame = ChFramed() , |
||
const std::string & | model_prefix = "" |
||
) |
Populate the given system with the cached Chrono components.
An instance of the underlying Chrono model can be created at the specified frame (relative to the global frame), with all Chrono object names using the specified prefix. Throws an error if no YAML model file was loaded.
◆ ReadCardanAngles()
|
static |
Load a Cardan angle sequence from the specified node and return as a quaternion.
The sequence is assumed to be extrinsic rotations X-Y-Z.
◆ ReadRotation()
|
static |
Return a quaternion loaded from the specified node.
Data is assumed to provide a quaternion or a Cardan extrinsic X-Y-Z angle set.
◆ SetSimulationParameters()
void chrono::parsers::ChParserMbsYAML::SetSimulationParameters | ( | ChSystem & | sys | ) |
Set solver and integrator settings from cached values.
If no YAML simulation file was loaded, this function is a no-op.
The documentation for this class was generated from the following files:
- /builds/uwsbel/chrono/src/chrono_parsers/yaml/ChParserMbsYAML.h
- /builds/uwsbel/chrono/src/chrono_parsers/yaml/ChParserMbsYAML.cpp