Skip to main content

Common Fluids Format 2025 R2

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

bool ok () const
 
virtual Error isValid () const =0
 
std::string getName () const
 Returns the object name in the project. More...
 
virtual Iterator getCase () const
 Returns the case file associated with this folder. More...
 
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() ) More...
 
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() More...
 
const MetadatagetMeta () const
 Access the Iterator Metadata, equivalent to getIterator().getMeta() More...
 
virtual Iterator getIterator () const
 Access the Iterator for this item. More...
 
 operator Iterator () const
 

Protected Member Functions

 SimBase (Iterator pIter)
 
virtual ~SimBase ()
 
Error copyDatafileMeta (const Iterator &pInput, Iterator &pOutput)
 

Protected Attributes

Iterator aIter
 

Detailed Description

Base class for Run and Simulation - shared functions.

Not to be used directly, use Run and Simulation.

Constructor & Destructor Documentation

◆ SimBase()

ansys::Project::SimBase::SimBase ( Iterator  pIter)
protected

◆ ~SimBase()

virtual ansys::Project::SimBase::~SimBase ( )
inlineprotectedvirtual

Member Function Documentation

◆ copyDatafileMeta()

Error ansys::Project::SimBase::copyDatafileMeta ( const Iterator pInput,
Iterator pOutput 
)
protected

◆ 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

◆ getCase()

Iterator ansys::Project::SimBase::getCase ( ) const
virtual

Returns the case file associated with this folder.

Reimplemented in ansys::Project::Run.

◆ 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

◆ getIterator()

Iterator ansys::Project::SimBase::getIterator ( ) const
virtual

Access the Iterator for this item.

Reimplemented in ansys::Project::Run, and ansys::Project::RunGroup.

◆ getMainDataType()

std::string ansys::Project::SimBase::getMainDataType ( ) const

Returns the result type expected as default output for runs (see: setMainDataType() )

◆ getMeta() [1/2]

Metadata & ansys::Project::SimBase::getMeta ( )

Access the Iterator Metadata, equivalent to getIterator().getMeta()

◆ getMeta() [2/2]

const Metadata & ansys::Project::SimBase::getMeta ( ) const

Access the Iterator Metadata, equivalent to getIterator().getMeta()

◆ getName()

std::string ansys::Project::SimBase::getName ( ) const

Returns the object name in the project.

◆ isValid()

virtual Error ansys::Project::SimBase::isValid ( ) const
pure virtual

◆ ok()

bool ansys::Project::SimBase::ok ( ) const

◆ operator Iterator()

ansys::Project::SimBase::operator Iterator ( ) const
inline

◆ 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()

Member Data Documentation

◆ aIter

Iterator ansys::Project::SimBase::aIter
protected

Connect with Ansys