ansys::Project::Simulation Class Reference
Last update: 16.07.2025Subfolder of a Project, regrouping input files and Run subfolders. More...
#include "Simulation.hpp"

Public Member Functions | |
| Simulation (Iterator pIter) | |
| Constructor from Iterator. More... | |
| virtual Error | isValid () const |
| Returns error with message if invalid. | |
| Iterator | getData () |
| Return the current Data for the simulation. More... | |
| Iterator | getResult (const std::string &pDataType) |
| Returns the latest result of the specified type, in the current Run. | |
| Run | newRun (std::string pName, Run::RunOutputType pType) |
| Create a Run folder in the current Simulation. More... | |
| Run | newRunInFolder (std::string pName, Run::RunOutputType pType, Iterator pFolder) |
| Create a Run folder in the current Simulation subfolder. More... | |
| Iterator | getRun (const std::string &pName) const |
| Returns Iterator to the children Run with the given name. | |
| std::vector< std::string > | getRuns () const |
| Returns list of children Run folders, as vector of their names (see: getRun() ) More... | |
| Error | removeRun (const std::string &pName, bool pFlagErase) |
| Remove the specified run from the simulation. More... | |
| RunGroup | newRunGroup (std::string pName, Run::RunOutputType pType) |
| Create a new RunGroup - a virtual group of separate runs, can be assigned a type. More... | |
| RunGroup | getRunGroup (const std::string &pName) const |
| Return the RunGroup by this name, in the current Simulation. More... | |
| std::vector< std::string > | getRunGroups () const |
| Return the list of RunGroups, by name, in this simulation. More... | |
| void | setCurrentRun (Iterator pRun) |
| Set the current Run in the simulation. More... | |
| Iterator | getCurrentRun () const |
| Return the current Run in the simulation - see setCurrentRun() | |
Public Member Functions inherited from ansys::Project::SimBase | |
| 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< Iterator > | getInputs (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< Iterator > | 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) More... | |
| Metadata & | getMeta () |
| Access the Iterator Metadata, equivalent to getIterator().getMeta() | |
| const Metadata & | getMeta () const |
| Access the Iterator Metadata, equivalent to getIterator().getMeta() | |
| virtual Iterator | getIterator () const |
| Access the Iterator for this item. | |
Protected Member Functions | |
| std::vector< std::string > | getListOfSubclass (const std::string &pSubclass) const |
| Search child hierarchy for items of the specified subclass. | |
Detailed Description
Subfolder of a Project, regrouping input files and Run subfolders.
Subclass of Iterator, can be constructed from an Iterator, the Simulation is ok() only if the provided iterator is of the appropriate subclass.
Iterator it = prj.get("/Sim1/");
Simulation sim(it);
sim.ok()
In a Simulation, one or multiple Run are created, to store the simulation Results, organized in Output subfolders. The Simulation might have settings (Metadata) related to the solver settings, or common to all results in this folder hiearchy.
Constructor & Destructor Documentation
◆ Simulation()
| ansys::Project::Simulation::Simulation | ( | Iterator | pIter | ) |
Constructor from Iterator.
The input Iterator must be of subclass Simulation If the subclass is not Simulation, the Simulation object is invalid ( !ok() )
Member Function Documentation
◆ getData()
| Iterator ansys::Project::Simulation::getData | ( | ) |
◆ getRunGroup()
| RunGroup ansys::Project::Simulation::getRunGroup | ( | const std::string & | pName | ) | const |
Return the RunGroup by this name, in the current Simulation.
If the rungroup is in a subfolder the path to it is expected (same path type returned by getRunGroups() ) Simulation/RunGroup -> RunGroup Simulation/folder/RunGroup -> folder/RunGroup
◆ getRunGroups()
| std::vector< std::string > ansys::Project::Simulation::getRunGroups | ( | ) | const |
Return the list of RunGroups, by name, in this simulation.
If the rungroup is in a subfolder the relative path to it is included Simulation/RunGroup -> RunGroup Simulation/folder/RunGroup -> folder/RunGroup
◆ getRuns()
| std::vector< std::string > ansys::Project::Simulation::getRuns | ( | ) | const |
◆ newRun()
| Run ansys::Project::Simulation::newRun | ( | std::string | pName, |
| Run::RunOutputType | pType | ||
| ) |
Create a Run folder in the current Simulation.
The Run folder is physical or virtual, depending of the project ProjectStoragePolicy The new run is given a name, and a type.
◆ newRunGroup()
| RunGroup ansys::Project::Simulation::newRunGroup | ( | std::string | pName, |
| Run::RunOutputType | pType | ||
| ) |
Create a new RunGroup - a virtual group of separate runs, can be assigned a type.
From the type, the mandatory and automatic variable constraints will apply to the RunGroup->Run association, as it would normally for Run->Output.
A RunGroup permits to define multiple levels of run type, for example a parametric RunGroup would contain transient Runs. The design point parameters are then assigned at the Run level, while the varying time values at the Output level.
◆ newRunInFolder()
| Run ansys::Project::Simulation::newRunInFolder | ( | std::string | pName, |
| Run::RunOutputType | pType, | ||
| Iterator | pFolder | ||
| ) |
Create a Run folder in the current Simulation subfolder.
The Run folder is physical or virtual, depending of the project ProjectStoragePolicy The new run is given a name, and a type.
◆ removeRun()
| Error ansys::Project::Simulation::removeRun | ( | const std::string & | pName, |
| bool | pFlagErase | ||
| ) |
Remove the specified run from the simulation.
- Parameters
-
pFlagErase If enabled, will erase the run folder and its data
◆ setCurrentRun()
| void ansys::Project::Simulation::setCurrentRun | ( | Iterator | pRun | ) |
Public Member Functions inherited from