Skip to main content

Common Fluids Format 2026 R1

ansys::Project::SimProject Class Reference

Last update: 24.03.2026

Main object for Simulation based projects. More...

#include "SimProject.hpp"

Inheritance diagram for ansys::Project::SimProject:
ansys::Project::Project

Public Member Functions

 SimProject ()
 Constructor - See Project::Project() More...
 
virtual ~SimProject ()
 Constructor - See Project::~Project() More...
 
Error importMesh (const URL &pURL, Iterator &pIter, std::string pName="")
 Import a mesh in a Mesh/ subfolder of the project. More...
 
Iterator getMesh (const std::string &pName) const
 Retrieve Mesh iterator from Mesh/ folder, by name. More...
 
std::vector< std::string > getMeshes () const
 Retrieve all mesh names from Mesh/ folder. More...
 
Error importGeometry (const URL &pURL, Iterator &pIter, std::string pName="")
 Import a CAD in a Geo/ subfolder of the project. More...
 
Iterator getGeometry (const std::string &pName) const
 Retrieve Geometry iterator from Geometry/ folder, by name. More...
 
std::vector< std::string > getGeometries () const
 Retrieve all geometry file names from Geometry/ folder. More...
 
Error importItem (const std::string &pCategory, const URL &pURL, Iterator &pIter, std::string pName="")
 Import a file of any type in the Type/ subfolder of the project. More...
 
Iterator getItem (const std::string &pCategory, const std::string &pName) const
 Retrieve Item iterator from Category/ folder, by name. More...
 
std::vector< std::string > getItems (const std::string &pCategory) const
 Retrieve all item names from from Category/ folder. More...
 
Iterator newSimulation (const std::string &pName, const std::string &pType)
 Create a new Simulation folder in the SimProject. More...
 
Iterator getSimulation (const std::string &pName) const
 Retrieve a Simulation in the SimProject, by name. More...
 
std::vector< std::string > getSimulations () const
 Retrieve the list of Simulation names in the SimProject. More...
 
Error removeSimulation (const std::string &pName, bool pFlagErase)
 Remove a named simulation from the project. More...
 
Iterator duplicateSimulation (const std::string &pOld, const std::string &pNew)
 Duplicate a simulation to a new name. More...
 
void setCurrentSimulation (Iterator pSim)
 Set the current simulation link - i.e. the 'default' simulation. More...
 
Iterator getCurrentSimulation () const
 Returns the current simulation link - if any. More...
 
virtual Error checkProject (CheckProjectInfo &pInfo) const
 Check the currently loaded project for validity. More...
 
virtual Error upgradeProject ()
 Upgrade project to current version. More...
 
virtual Error copyMetadata (const Iterator &pSource, Iterator &pTarget) const
 Copy metadata between two project items. More...
 
virtual Error getInheritedMetadata (const Iterator &pIter, MetadataConst &pMeta)
 Return the metadata for the current iterator and include relevant data from parent iterators. More...
 
- Public Member Functions inherited from ansys::Project::Project
 Project ()
 Constructor. More...
 
virtual ~Project ()
 Destructor - Will close the project and release the lock (if any). More...
 
bool isLoaded () const
 Indicates if a project is currrently opened (or newly created with success). More...
 
virtual bool isProject (const URL &pLocation)
 Check if a filename is a project file (fast read, not entirely checked) More...
 
virtual Error newProject (const URL &pLocation)
 Create a project at the specified URL. More...
 
virtual Error openProject (const URL &pLocation, bool pReadOnly=false)
 Open a project at the specified URL. More...
 
virtual Error openProjectFromString (const std::string &pData, const URL &pProjectLocation, bool pReadOnly=false)
 Open a project by reading its data from a string. More...
 
Error saveProject ()
 Save the currently opened project. More...
 
Error saveProjectToString (std::string &pString)
 Save the currently opened project to an XML string. More...
 
Error saveAsProject (const URL &pLocation, bool pFlagCopyFiles=false, bool pFlagCopyExternal=false)
 Save the project index file to a new location. More...
 
Error exportProject (const URL &pLocation, bool pFlagCopyExternal=true, bool pFlagEnforceStructure=false)
 Export the project to a new location (keeping current project opened and unchanged). More...
 
Error archiveProject (const URL &pTargetArchive) const
 Compress the project to an archive (keeping current project opened and unchanged) More...
 
Error archiveProject (const URL &pTargetArchive, const std::vector< std::string > &pListIgnore) const
 Compress the project to an archive (keeping current project opened and unchanged) More...
 
Error forkProject (Iterator &pIter, const URL &pNewProjectFilename, Project *&pProject)
 Split the project at the specified location to a subproject. More...
 
bool isSubProject () const
 
Error loadSubProject (Iterator &pIter)
 Load the specified subproject. More...
 
std::vector< IteratorgetSubProjects ()
 Return the list of subprojects stored in the project. More...
 
Error loadAllSubProjects ()
 Load all subprojects stored in the project. More...
 
Error join (Iterator pIter)
 Join the subproject back to the master project. More...
 
Error getProjectLockInfo (const URL &pLocation, std::string &pLockInfo)
 Indicates if the specified project is locked and retrieve the lock information. More...
 
Error eraseProjectLock (const URL &pLocation)
 Erase the project lock. More...
 
Iterator copyItemTo (Iterator pSource, Project &pTarget, Iterator pTargetFolder=Iterator(), bool pRecursive=false)
 Copy the Iterator item to the target project. More...
 
Error closeProject ()
 Close the project and release the lock. More...
 
const URLgetProjectLocation () const
 Get the URL of the project file with path. More...
 
URL getProjectFolder () const
 Get the URL of the project folder, if enabled by policy. More...
 
ProjectStoragePolicygetStoragePolicy ()
 Return the StoragePolicy for the current project or to configure before newProject(). More...
 
const ProjectStoragePolicygetStoragePolicy () const
 
bool isLocalToProject (const URL &pURL) const
 Indicates if the specified absolute URL is inside the project folder. More...
 
bool isOwnedByProject (const URL &pURL) const
 If the specified URL is a file in the project folder, and registered, returns true. More...
 
Iterator getIteratorForURL (const URL &pURL) const
 If the specified URL is a file in the project folder, and registered, returns the Iterator. More...
 
URL getRelativePathToFile (const URL &pURL) const
 Future feature - Not available. More...
 
bool registerCallback (const std::string &pOwner, const std::string &pCallbackName, BaseCallback *pCallback)
 Register a function callback to a project event. More...
 
Error executeCallback (const std::string &pCallbackName, CallbackParams &pParams)
 Trigger any registered callback for this callback ID. More...
 
virtual Error copyRuntimeMetadata (const Iterator &pSource, Iterator &pTarget) const
 Copy all runtime metadata values from source to target iterator. More...
 
Iterator getDir ()
 
bool setDir (Iterator &pDir)
 
Iterator root () const
 Return the iterator to the project root folder. More...
 
Iterator get (const Path &pPath) const
 For a project Path, return the associated Iterator. More...
 
int getProjectId () const
 Return a project id, which will be the same as in the matching Iterator::getProjectId(). More...
 

Protected Member Functions

virtual Error updateFromPolicy ()
 
virtual Error setupNewProject ()
 
virtual ProjectprojectObjectFactory () const
 Create a new object of the current effective project type. More...
 
- Protected Member Functions inherited from ansys::Project::Project
virtual Error copyProjectContent (Iterator pFolder, const URL &pSourceFolder, const URL &pTargetFolder, std::map< Iterator, URL > &pURLChanges, bool pCopyExternalFiles, bool pEnforceStructure)
 Internal function - Copy a folder iterator content files from a source directory to target. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ansys::Project::Project
static Error unarchiveProject (const URL &pArchive, const URL &pTargetFolder)
 Extract the project to an from an archive,. More...
 
- Static Protected Member Functions inherited from ansys::Project::Project
static std::string getReleaseId ()
 
- Static Protected Attributes inherited from ansys::Project::Project
static int sFormatVersion = 2
 

Detailed Description

Main object for Simulation based projects.

The SimProject manages the .flprj index file, and (if enabled) the .cffdb folder. The project contains the global storage settings, and contains Simulation subfolders.

The project concept is detailed in Project API

Constructor & Destructor Documentation

◆ SimProject()

ansys::Project::SimProject::SimProject ( )

Constructor - See Project::Project()

◆ ~SimProject()

ansys::Project::SimProject::~SimProject ( )
virtual

Constructor - See Project::~Project()

Member Function Documentation

◆ checkProject()

Error ansys::Project::SimProject::checkProject ( CheckProjectInfo pInfo) const
virtual

Check the currently loaded project for validity.

Project::checkProject() will only check files and folders, while SimProject::checkProject() will check the Simulation and their files for consistency and project syntax compliance.

Parameters
pInfoCheckProjectInfo structure used to specify check project settings and return the results.

Reimplemented from ansys::Project::Project.

◆ copyMetadata()

Error ansys::Project::SimProject::copyMetadata ( const Iterator pSource,
Iterator pTarget 
) const
virtual

Copy metadata between two project items.

Reimplemented from ansys::Project::Project.

◆ duplicateSimulation()

Iterator ansys::Project::SimProject::duplicateSimulation ( const std::string &  pOld,
const std::string &  pNew 
)

Duplicate a simulation to a new name.

Metadata is copied Input files stored in the source simulation are copied over and linked to the new location. Input files referencing files outside of the simulation are kept as such.

Returns
Iterator of the newly created run

◆ getCurrentSimulation()

Iterator ansys::Project::SimProject::getCurrentSimulation ( ) const

Returns the current simulation link - if any.

◆ getGeometries()

std::vector< std::string > ansys::Project::SimProject::getGeometries ( ) const

Retrieve all geometry file names from Geometry/ folder.

◆ getGeometry()

Iterator ansys::Project::SimProject::getGeometry ( const std::string &  pName) const

Retrieve Geometry iterator from Geometry/ folder, by name.

◆ getInheritedMetadata()

Error ansys::Project::SimProject::getInheritedMetadata ( const Iterator pIter,
MetadataConst pMeta 
)
virtual

Return the metadata for the current iterator and include relevant data from parent iterators.

In Project this only returns the metadata for the current iterator, unless the parent item is a Transparent item, the data is then also included. Used in some UI elements.

Reimplemented from ansys::Project::Project.

◆ getItem()

Iterator ansys::Project::SimProject::getItem ( const std::string &  pCategory,
const std::string &  pName 
) const

Retrieve Item iterator from Category/ folder, by name.

◆ getItems()

std::vector< std::string > ansys::Project::SimProject::getItems ( const std::string &  pCategory) const

Retrieve all item names from from Category/ folder.

◆ getMesh()

Iterator ansys::Project::SimProject::getMesh ( const std::string &  pName) const

Retrieve Mesh iterator from Mesh/ folder, by name.

◆ getMeshes()

std::vector< std::string > ansys::Project::SimProject::getMeshes ( ) const

Retrieve all mesh names from Mesh/ folder.

◆ getSimulation()

Iterator ansys::Project::SimProject::getSimulation ( const std::string &  pName) const

Retrieve a Simulation in the SimProject, by name.

◆ getSimulations()

std::vector< std::string > ansys::Project::SimProject::getSimulations ( ) const

Retrieve the list of Simulation names in the SimProject.

◆ importGeometry()

Error ansys::Project::SimProject::importGeometry ( const URL pURL,
Iterator pIter,
std::string  pName = "" 
)

Import a CAD in a Geo/ subfolder of the project.

Parameters
pURLFile location of the file to copy
pInfoReturned Iterator of the newly imported file
pNameName of the new project entry in Geo/
Returns
Error state

◆ importItem()

Error ansys::Project::SimProject::importItem ( const std::string &  pCategory,
const URL pURL,
Iterator pIter,
std::string  pName = "" 
)

Import a file of any type in the Type/ subfolder of the project.

Parameters
pCategoryFile type - will also be assigned as DataType of the file
pURLFile location of the file to copy
pInfoReturned Iterator of the newly imported file
pNameName of the new project entry in Type/
Returns
Error state

◆ importMesh()

Error ansys::Project::SimProject::importMesh ( const URL pURL,
Iterator pIter,
std::string  pName = "" 
)

Import a mesh in a Mesh/ subfolder of the project.

Parameters
pURLFile location of the file to copy
pInfoReturned Iterator of the newly imported file
pNameName of the new project entry in Mesh/
Returns
Error state

◆ newSimulation()

Iterator ansys::Project::SimProject::newSimulation ( const std::string &  pName,
const std::string &  pType 
)

Create a new Simulation folder in the SimProject.

Parameters
pNameName of the new simulation, must be unique
pTypeSolver type of the simulation (ex: ANSYS_FLUENT)

◆ projectObjectFactory()

Project * ansys::Project::SimProject::projectObjectFactory ( ) const
protectedvirtual

Create a new object of the current effective project type.

Reimplemented from ansys::Project::Project.

◆ removeSimulation()

Error ansys::Project::SimProject::removeSimulation ( const std::string &  pName,
bool  pFlagErase 
)

Remove a named simulation from the project.

Parameters
pNameName of the simulation
pFlagEraseEnable to erase all files and subfolders

◆ setCurrentSimulation()

void ansys::Project::SimProject::setCurrentSimulation ( Iterator  pSim)

Set the current simulation link - i.e. the 'default' simulation.

The current simulation link is set automatically to any newly created simulation, and can be changed afterwards.

◆ setupNewProject()

Error ansys::Project::SimProject::setupNewProject ( )
protectedvirtual

Reimplemented from ansys::Project::Project.

◆ updateFromPolicy()

Error ansys::Project::SimProject::updateFromPolicy ( )
protectedvirtual

Reimplemented from ansys::Project::Project.

◆ upgradeProject()

Error ansys::Project::SimProject::upgradeProject ( )
virtual

Upgrade project to current version.

See Project::upgradeProject() The SimProject version will upgrade the Simulation and related concepts to the latest project file format.

Reimplemented from ansys::Project::Project.

Connect with Ansys