Description
Parser for YAML specification files for Chrono::TDPF models and simulations.
The parser caches model information and simulation settings from a YAML input file and then allows populating an FSI Chrono::TDPF system and setting solver and simulation parameters.
#include <ChParserTdpfYAML.h>


Public Member Functions | |
| ChParserTdpfYAML (const std::string &yamlfilename, bool verbose=false) | |
| bool | HasSolverData () const |
| Return true if a YAML solver file has been loaded. | |
| bool | HasModelData () const |
| Return true if a YAML model file has been loaded. | |
| void | LoadFile (const std::string &yaml_filename) |
| Load the specified MBS simulation input YAML file. | |
| void | LoadSimData (const YAML::Node &yaml) override |
| Load the simulation, output, and visualization settings from the specified YAML node. More... | |
| void | LoadModelData (const YAML::Node &yaml) |
| Load the MBS model from the specified YAML node. | |
| void | LoadSolverData (const YAML::Node &yaml) |
| Load the solver parameters from the specified YAML node. More... | |
| std::shared_ptr< fsi::tdpf::ChFsiSystemTDPF > | CreateFsiSystemTDPF (bool initialize=true) |
| Create and return a Chrono FSI problem configured from cached model and simulation parameters. More... | |
| virtual std::shared_ptr< fsi::ChFsiSystem > | GetFsiSystem () override |
| Access the underlying FSI system. | |
| virtual std::shared_ptr< fsi::ChFsiFluidSystem > | GetFluidSystem () override |
| Access the underlying fluid system. | |
| std::shared_ptr< fsi::tdpf::ChFsiFluidSystemTDPF > | GetFluidSystemTDPF () |
| Access the underlying fluid system. | |
| virtual void | WriteOutput (int frame, double time) override |
| Write simulation output results at the current time. | |
Public Member Functions inherited from chrono::parsers::ChParserCfdYAML | |
| ChParserCfdYAML (bool verbose=false) | |
| FluidSystemType | GetType () const |
| Return the fluid system type. | |
Public Member Functions inherited from chrono::parsers::ChParserYAML | |
| void | SetVerbose (bool verbose) |
| Set verbose terminal output (default: false). | |
| virtual void | SetOutputDir (const std::string &out_dir) |
| Set root output directory (default: "."). More... | |
| const std::string & | GetName () const |
| Return the name of the YAML model. | |
| virtual bool | OutputEnabled () const |
| Return true if generating output. | |
| const ChOutput::Settings & | GetOutputSettings () const |
| Return all output settings. | |
| ChOutput::Format | GetOutputFormat () const |
| Return the output type. | |
| ChOutput::Mode | GetOutputMode () const |
| Return the output mode. | |
| virtual double | GetOutputFPS () const |
| Return the output frequency. | |
| virtual bool | VisualizationEnabled () const |
| Return true if visualization is enabled. | |
| const ChVisualSystem::Settings & | GetVisualizationSettings () const |
| Return all visualization settings. | |
| double | GetRenderFPS () const |
| CameraVerticalDir | GetCameraVerticalDir () const |
| const ChVector3d & | GetCameraLocation () const |
| const ChVector3d & | GetCameraTarget () const |
| bool | EnableShadows () const |
| bool | WriteImages () const |
| const std::string & | GetImageDir () const |
| virtual void | Output (double time) |
| Generate output at the current frame. More... | |
| virtual bool | Render (ChVisualSystem &vis, double time) |
| Render the current frame using the specified visual system if run-time visualization is available and enabled. More... | |
Additional Inherited Members | |
Public Types inherited from chrono::parsers::ChParserCfdYAML | |
| enum | FluidSystemType { SPH, TDPF } |
Public Types inherited from chrono::parsers::ChParserYAML | |
| enum | YamlFileType { MBS, SPH, TDPF, FSI, VEHICLE, CUSTOM } |
Type of a Chrono YAML specification file, as declared by its type key. More... | |
Static Public Member Functions inherited from chrono::parsers::ChParserCfdYAML | |
| static FluidSystemType | ReadFluidSystemType (const std::string &yaml_filename) |
| Peek in specified YAML file and read the fluid system type. More... | |
Static Public Member Functions inherited from chrono::parsers::ChParserYAML | |
| static YamlFileType | ReadYamlFileType (const std::string &yaml_filename) |
| Peek in the specified YAML file and read the declared file type. More... | |
Static Protected Member Functions inherited from chrono::parsers::ChParserYAML | |
| static YamlFileType | ReadYamlFileType (const YAML::Node &a) |
| Read the YAML file type from the given node. More... | |
Protected Attributes inherited from chrono::parsers::ChParserCfdYAML | |
| FluidSystemType | m_type |
Protected Attributes inherited from chrono::parsers::ChParserYAML | |
| std::string | m_name |
| name of the YAML model | |
| bool | m_verbose |
| verbose terminal output (default: false) | |
| bool | m_use_degrees |
| all angles given in degrees (default: true) | |
| ChVisualSystem::Settings | m_vis_settings |
| visualization settings | |
| ChOutput::Settings | m_output_settings |
| output settings | |
| std::string | m_output_dir |
| root output directory | |
| std::shared_ptr< ChOutput > | m_output_db |
| output database | |
| ChYamlFileHandler | m_file_handler |
| handler for data file paths | |
Member Function Documentation
◆ CreateFsiSystemTDPF()
| std::shared_ptr< fsi::tdpf::ChFsiSystemTDPF > chrono::parsers::ChParserTdpfYAML::CreateFsiSystemTDPF | ( | bool | initialize = true | ) |
Create and return a Chrono FSI problem configured from cached model and simulation parameters.
By default, the Chrono FSI problem is initialized (with no associated MBS system). If a system is attached after creation, the caller must create the FSI problem with initialize=false, attach an MBS to the problem, and then explicitly initialize the FSI problem.
◆ LoadSimData()
|
overridevirtual |
Load the simulation, output, and visualization settings from the specified YAML node.
The optional simulation object may specify gravity (default: [0, 0, -9.8]), the gravitational acceleration applied to the fluid phase. Note that in a coupled FSI simulation the gravity given in the FSI simulation file governs both phases and overrides this value; it therefore takes effect when the TDPF fluid system is driven on its own, as it is through the Chrono preCICE adapter.
Reimplemented from chrono::parsers::ChParserYAML.
◆ LoadSolverData()
| void chrono::parsers::ChParserTdpfYAML::LoadSolverData | ( | const YAML::Node & | yaml | ) |
Load the solver parameters from the specified YAML node.
All sections and keys are optional; any that are absent keep the Chrono::FSI-TDPF defaults. The expected structure is:
radiation:
method: RIRF_CONVOLUTION # RIRF_CONVOLUTION (default) or STATE_SPACE
truncation_time: 0 # [s] truncate the RIRF kernel; 0 = use the full kernel
smoothing: # RIRF_CONVOLUTION only
type: NONE # NONE (default), SG (Savitzky-Golay), or MOVING_AVERAGE
window_length: 5 # forced to be odd and at least 3
taper: # RIRF_CONVOLUTION only; presence of this block enables tapering
enabled: true
start_fraction: 0.8 # taper start, as a fraction of the RIRF length
end_fraction: 1.0 # taper end, as a fraction of the RIRF length
final_amplitude: 0.0 # kernel scale at the end of the taper (0 = zero, 1 = unchanged)
state_space: # STATE_SPACE only
max_order: 10
r2_threshold: 0.95
max_hankel_size: 200
r2_num_samples: 50
diagnostics:
export_csv: false # write before/after RIRF kernels
excitation:
method: AUTO # AUTO (default), IRF_CONVOLUTION, or FREQUENCY_DOMAIN
interpolation: CARTESIAN # CARTESIAN (default) or POLAR
truncation_time: 0 # [s] truncate the excitation IRF; 0 = use the full kernel
diagnostics:
output_dir: "" # directory for solver diagnostics; empty = none
Enumeration values are read case-insensitively, so the SEA-Stack spellings (e.g. state_space, irf_convolution) are accepted as well.
The documentation for this class was generated from the following files:
- /builds/uwsbel/chrono/src/chrono_parsers/yaml/ChParserTdpfYAML.h
- /builds/uwsbel/chrono/src/chrono_parsers/yaml/ChParserTdpfYAML.cpp
Public Member Functions inherited from