ansys::Project::Result Class Reference
Last update: 24.03.2026Result (data) file, output of a Simulation Run. More...
#include "Result.hpp"

Public Member Functions | |
| Result (Iterator pIter) | |
| Constructor from Iterator. More... | |
| virtual | ~Result () |
| bool | ok () const |
| Indicates if the Iterator is valid and of correct subclass. More... | |
| virtual Error | isValid () const |
| Returns error with message if invalid. More... | |
| Iterator | getCase () const |
| Return the case link, if any. More... | |
| void | setCase (Iterator pCase) |
| Assign the case used/shared by results of this result, as link. More... | |
| Iterator | getInputByType (const std::string &pType, const std::string &pSubtype) const |
| Search the metadata links for the specified file type. More... | |
| virtual bool | hasValue (const std::string &pVar, bool pFlagInherited) const |
| Search the metadata (local and inherited) for the specified key. More... | |
| Iterator | getValueIter (const std::string &pVar) const |
| Search the metadata (local and inherited) for the specified metadata link and return the value as an iterator. More... | |
| virtual std::string | getValue (const std::string &pVar, bool pFlagInherited) const |
| Search the metadata (local and inherited) for the specified key and return the value as string. More... | |
| virtual int | getValueInt (const std::string &pVar, bool pFlagInherited) const |
| Search the metadata (local and inherited) for the specified key and return the value as string. More... | |
| virtual double | getValueDouble (const std::string &pVar, bool pFlagInherited) const |
| Search the metadata (local and inherited) for the specified key and return the value as string. More... | |
| virtual MetaVariableType | getValueType (const std::string &pVar, bool pFlagInherited) const |
| Search the metadata (local and inherited) for the specified key and return the its data type. More... | |
| virtual void | setValue (const std::string &pVar, const std::string &pValue) |
| Sets the local metadata to the specified key/value. More... | |
| virtual void | setValueInt (const std::string &pVar, int pValue) |
| Sets the local metadata to the specified key/value. More... | |
| virtual void | setValueDouble (const std::string &pVar, double pValue) |
| Sets the local metadata to the specified key/value. More... | |
| void | setValue (const std::string &pVar, int pValue) |
| void | setValue (const std::string &pVar, double pValue) |
| Iterator | getIterator () const |
| Returns the Iterator for this Result. More... | |
| operator Iterator () const | |
Public Member Functions inherited from ansys::Project::RunOutputAttr | |
| virtual | ~RunOutputAttr () |
| std::vector< std::string > | getValues (const std::vector< std::string > &pVars, bool pFlagInherited) const |
| Returns the values for a list of variables. More... | |
| int | getIndex () const |
| Returns the output index (incremental id in a run) - always available. More... | |
| int | getSolverIteration () const |
| Returns the number of solver iterations (if available) More... | |
| double | getTime () const |
| Returns the transient time value (if available) More... | |
| void | setIndex (int pValue) |
| Changes the specified variable. More... | |
| void | setSolverIteration (int pValue) |
| Changes the specified variable. More... | |
| void | setTime (double pValue) |
| Changes the specified variable. More... | |
| double | getCrankAngle () const |
| Returns the specified variable (if available) More... | |
| void | setCrankAngle (double pValue) |
| Changes the specified variable. More... | |
| int | getCaseId () const |
| Returns the specified variable (if available) More... | |
| int | getInputSettingsId () const |
| Returns the specified variable (if available) More... | |
| int | getDomainTransformationId () const |
| Returns the specified variable (if available) More... | |
| int | getPhysicsId () const |
| Returns the specified variable (if available) More... | |
| int | getOutputSettingsId () const |
| Returns the specified variable (if available) More... | |
| int | getMeshId () const |
| Returns the specified variable (if available) More... | |
| int | getTopologyId () const |
| Returns the specified variable (if available) More... | |
| int | getConnectivityId () const |
| Returns the specified variable (if available) More... | |
| int | getCoordinatesId () const |
| Returns the specified variable (if available) More... | |
| int | getLocationId () const |
| Returns the specified variable (if available) More... | |
| void | setCaseId (int pValue) |
| Changes the specified variable. More... | |
| void | setInputSettingsId (int pValue) |
| Changes the specified variable. More... | |
| void | setDomainTransformationId (int pValue) |
| Changes the specified variable. More... | |
| void | setPhysicsId (int pValue) |
| Changes the specified variable. More... | |
| void | setOutputSettingsId (int pValue) |
| Changes the specified variable. More... | |
| void | setMeshId (int pValue) |
| Changes the specified variable. More... | |
| void | setTopologyId (int pValue) |
| Changes the specified variable. More... | |
| void | setConnectivityId (int pValue) |
| Changes the specified variable. More... | |
| void | setCoordinatesId (int pValue) |
| Changes the specified variable. More... | |
| void | setLocationId (int pValue) |
| Changes the specified variable. More... | |
| Iterator | getFirstIteratorForCurrentCaseId () const |
| See getFirstIterator(const std::string&) More... | |
| Iterator | getFirstIteratorForCurrentPhysicsId () const |
| See getFirstIterator(const std::string&) More... | |
| Iterator | getFirstIteratorForCurrentInputSettingsId () const |
| See getFirstIterator(const std::string&) More... | |
| Iterator | getFirstIteratorForCurrentDomainTransformationId () const |
| See getFirstIterator(const std::string&) More... | |
| Iterator | getFirstIteratorForCurrentMeshId () const |
| See getFirstIterator(const std::string&) More... | |
| Iterator | getFirstIteratorForCurrentTopologyId () const |
| See getFirstIterator(const std::string&) More... | |
| Iterator | getFirstIteratorForCurrentConnectivityId () const |
| See getFirstIterator(const std::string&) More... | |
| Iterator | getFirstIteratorForCurrentCoordinatesId () const |
| See getFirstIterator(const std::string&) More... | |
| Iterator | getFirstIteratorForCurrentLocationId () const |
| See getFirstIterator(const std::string&) More... | |
| Iterator | getFirstIteratorForCurrent (const std::string &pVar) const |
| Return the first entry in the current Run, with same variable value. More... | |
Protected Attributes | |
| Iterator | aIter |
Additional Inherited Members | |
Static Public Attributes inherited from ansys::Project::RunOutputAttr | |
| static const std::string | sVarTime |
| static const std::string | sVarSolverIteration |
| static const std::string | sVarIndex |
| static const std::string | sVarCrankAngle |
| static const std::string | sVarCaseId |
| static const std::string | sVarInputSettingsId |
| static const std::string | sVarDomainTransformationId |
| static const std::string | sVarPhysicsId |
| static const std::string | sVarOutputSettingsId |
| static const std::string | sVarMeshId |
| static const std::string | sVarTopologyId |
| static const std::string | sVarConnectivityId |
| static const std::string | sVarCoordinatesId |
| static const std::string | sVarLocationId |
Detailed Description
Result (data) file, output of a Simulation Run.
A Result file is typically inside the Simulation/Run/Output subfolder, as results are registered at each output step of a run. But such files can also be imported to the project, and stored in another folder, such as in the Simulation folder (for example: the initial airflow solution)
Subclass of Iterator, can be constructed from an Iterator, the Result is ok() only if the provided iterator is of the appropriate subclass.
Iterator it = prj.get("/Sim1/Run1/out1/out.dat.h5");
Result res(it);
res.ok()
Medatada attributes will be stored locally, but can be queried with inheritance. For example getTime() will return the time value for the current Result, but the value might have been stored in the parent Output.
out.setValue("Temperature",300);
Result res(out.getResult("fluent-dat"));
out.getValue("Temperature",true) == 300
res.getValue("Temperature",true) == 300
res.setValue("Temperature",333);
res.getValue("Temperature",true) == 333
out.getValue("Temperature",true) == 300
Constructor & Destructor Documentation
◆ Result()
| ansys::Project::Result::Result | ( | Iterator | pIter | ) |
◆ ~Result()
|
inlinevirtual |
Member Function Documentation
◆ getCase()
| Iterator ansys::Project::Result::getCase | ( | ) | const |
Return the case link, if any.
If not defined at this level, the parent Output, Run or Simulation are searched for such a Case link.
◆ getInputByType()
| Iterator ansys::Project::Result::getInputByType | ( | const std::string & | pType, |
| const std::string & | pSubtype | ||
| ) | const |
Search the metadata links for the specified file type.
Links are stored in Result as metadata, in Simulation and Run they are stored as an Input/ subfolder entry
◆ getIterator()
|
virtual |
Returns the Iterator for this Result.
Implements ansys::Project::RunOutputAttr.
◆ getValue()
|
virtual |
Search the metadata (local and inherited) for the specified key and return the value as string.
- Parameters
-
pFlagInherited : If true, the parent Run/Simulation are searched for the metadata entry, if not defined locally
Implements ansys::Project::RunOutputAttr.
◆ getValueDouble()
|
virtual |
Search the metadata (local and inherited) for the specified key and return the value as string.
- Parameters
-
pFlagInherited : If true, the parent Run/Simulation are searched for the metadata entry, if not defined locally
Implements ansys::Project::RunOutputAttr.
◆ getValueInt()
|
virtual |
Search the metadata (local and inherited) for the specified key and return the value as string.
- Parameters
-
pFlagInherited : If true, the parent Run/Simulation are searched for the metadata entry, if not defined locally
Implements ansys::Project::RunOutputAttr.
◆ getValueIter()
| Iterator ansys::Project::Result::getValueIter | ( | const std::string & | pVar | ) | const |
Search the metadata (local and inherited) for the specified metadata link and return the value as an iterator.
- Parameters
-
pFlagInherited : If true, the parent Run/Simulation are searched for the metadata entry, if not defined locally
◆ getValueType()
|
virtual |
Search the metadata (local and inherited) for the specified key and return the its data type.
- Parameters
-
pFlagInherited : If true, the parent Run/Simulation are searched for the metadata entry, if not defined locally
Implements ansys::Project::RunOutputAttr.
◆ hasValue()
|
virtual |
Search the metadata (local and inherited) for the specified key.
- Parameters
-
pFlagInherited : If true, the parent Run/Simulation are searched for the metadata entry, if not defined locally
Implements ansys::Project::RunOutputAttr.
◆ isValid()
|
virtual |
Returns error with message if invalid.
◆ ok()
| bool ansys::Project::Result::ok | ( | ) | const |
Indicates if the Iterator is valid and of correct subclass.
◆ operator Iterator()
|
inline |
◆ setCase()
| void ansys::Project::Result::setCase | ( | Iterator | pCase | ) |
Assign the case used/shared by results of this result, as link.
◆ setValue() [1/3]
|
virtual |
Sets the local metadata to the specified key/value.
Implements ansys::Project::RunOutputAttr.
◆ setValue() [2/3]
|
inline |
◆ setValue() [3/3]
|
inline |
◆ setValueDouble()
|
virtual |
Sets the local metadata to the specified key/value.
Implements ansys::Project::RunOutputAttr.
◆ setValueInt()
|
virtual |
Sets the local metadata to the specified key/value.
Implements ansys::Project::RunOutputAttr.
Member Data Documentation
◆ aIter
|
protected |
Public Member Functions inherited from