Skip to main content

Common Fluids Format 2024 R1

ansys::Project::SimBase Class Reference

Last update: 16.07.2025

Base class for Run and Simulation - shared functions. More...

#include "SimBase.hpp"

Inheritance diagram for ansys::Project::SimBase:
ansys::Project::Runansys::Project::Simulationansys::Project::RunGroup

Public Member Functions

std::string getName () const
 Returns the object name in the project.
 
virtual Iterator getCase () const
 Returns the case file associated with this folder.
 
Iterator setCase (Iterator pCaseFile)
 Set the case file associated with this item. More...
 
void setMainDataType (const std::string &pDataType)
 Set the result type expected as default output for runs. More...
 
std::string getMainDataType () const
 Returns the result type expected as default output for runs (see: setMainDataType() )
 
Iterator copyInput (Path pPath, bool pInInputFolder=false)
 Copy the specified project file into the current folder. More...
 
Iterator setInput (Path pPath)
 Register a files as Input/ to this folder. More...
 
std::vector< IteratorgetInputs (Error *pErrorPtr=0) const
 Return the list of registered inputs for this simulation. More...
 
Iterator getInputByType (const std::string &pType, std::string pSubtype="") const
 Search for a -single- input of the specified type (and optionally, subtype) More...
 
std::vector< IteratorgetInputsByType (const std::string &pType, std::string pSubtype="", Error *pErrorPtr=0) const
 Search for one or multiple input of the specified type (and optionally, subtype) More...
 
MetadatagetMeta ()
 Access the Iterator Metadata, equivalent to getIterator().getMeta()
 
const MetadatagetMeta () const
 Access the Iterator Metadata, equivalent to getIterator().getMeta()
 
virtual Iterator getIterator () const
 Access the Iterator for this item.
 

Detailed Description

Base class for Run and Simulation - shared functions.

Not to be used directly, use Run and Simulation.

Member Function Documentation

◆ copyInput()

Iterator ansys::Project::SimBase::copyInput ( Path  pPath,
bool  pInInputFolder = false 
)

Copy the specified project file into the current folder.

Parameters
pPathThe project path (global or relative) to the target
pInInputFolderThe file will be copied to the Input/ subfolder

◆ getInputByType()

Iterator ansys::Project::SimBase::getInputByType ( const std::string &  pType,
std::string  pSubtype = "" 
) const

Search for a -single- input of the specified type (and optionally, subtype)

If no such input exist, the null iterator is returned. If there are multiple matches, or lead to a broken link, an invalid iterator (with error message) is returned. A link input is resolved to the target iterator

◆ getInputs()

std::vector< Iterator > ansys::Project::SimBase::getInputs ( Error pErrorPtr = 0) const

Return the list of registered inputs for this simulation.

Inputs are items in the Input/ subfolder, which are either a file with DataType property, or a link to a file in the project named with the DataType property name

◆ getInputsByType()

std::vector< Iterator > ansys::Project::SimBase::getInputsByType ( const std::string &  pType,
std::string  pSubtype = "",
Error pErrorPtr = 0 
) const

Search for one or multiple input of the specified type (and optionally, subtype)

If no such input exist, empty vector is returned The list of items found is returned If any match lead to a broken input link, and the error argument is provided it will be updated with the list of errors. Erroneous items are not included in the return vector. A link input is resolved to the target iterator

◆ setCase()

Iterator ansys::Project::SimBase::setCase ( Iterator  pCaseFile)

Set the case file associated with this item.

The case file is registered as an Input, and stored in a Input/ subfolder (hidden, project only) see setInput()

◆ setInput()

Iterator ansys::Project::SimBase::setInput ( Path  pPath)

Register a files as Input/ to this folder.

The inputs are links stored in the hidden subfolder Input/ For example, in a Simulation the "current" case file can be stored as input, then once a Run is created, the case file is registered in the Run itself. If the current case file is changed, each previous Run still has a link to the specific case file which was used for them.

Parameters
pPathThe project path (global or relative) to the target

◆ setMainDataType()

void ansys::Project::SimBase::setMainDataType ( const std::string &  pDataType)

Set the result type expected as default output for runs.

The main data type is used to get the 'default' output file from a run with multiple data types registered. If this is defined, it will dictate the automatic behavior of Output::getData()

Connect with Ansys