Skip to main content

Common Fluids Format 2026 R1

ansys::CffBase Class Reference

Last update: 24.03.2026

Base class that provides common function used by both CffConsumer and CffProvider classes. More...

#include "CffInterface/CffBase.hpp"

Inheritance diagram for ansys::CffBase:
ansys::CffVersionansys::CffConsumeransys::CffProvideransys::CffFileConsumeransys::CffFileProvider

Public Member Functions

 CffBase ()
 Constructor. More...
 
virtual ~CffBase ()
 Destructor. More...
 
void setPartitionId (const PartitionIdType pId)
 
PartitionIdType getPartitionId () const
 
virtual void setDebugOn (bool debug)
 Turn on/off debugging information. More...
 
virtual void setReadNCIOn (bool readNCI)
 Turn on/off non-conformal interface reading. More...
 
void setMeshId (const MeshIdType meshId)
 Set the Identifier for active mesh being read or written. More...
 
MeshIdType getMeshId () const
 Get the Identifier of the active mesh. More...
 
void setTarget (const TargetCategory target)
 Set the target category for which the data is intended. More...
 
TargetCategory getTarget () const
 Get the target category for which the data is intended. More...
 
void setMeshSize (const MeshSizeType type, const ElemIdType size)
 Sets a value that defines the dimension or the global number of objects of a specific mesh entity. More...
 
void getMeshSize (const MeshSizeType type, ElemIdType &size) const
 Obtains a value that defines the dimension or the global number of objects of a specific mesh entity. More...
 
void setMeshUnits (const std::string &units="m")
 Define the units of length the mesh is defined in. More...
 
void getMeshUnits (std::string &unit) const
 Obtains the unit of length the mesh is defined in. More...
 
void setZoneIds (const ZoneCategory zoneCategory, const ZoneIds &zonesIds)
 Define the zones that are of a specific category. More...
 
virtual size_t getNumZones (const ZoneCategory) const
 Returns the number of zones in a specific category. More...
 
virtual void getZoneIds (const ZoneCategory zoneCategory, ZoneIds &zoneIds) const
 Request the collection of zone Ids that are of a specific category.
More...
 
void setNodeZoneInfo (const ZoneIdType nodeZoneId, const NodeZoneInfoType nodeZoneInfoType, const int info) const
 set certain zone level info for a node zone.
More...
 
void getNodeZoneInfo (const ZoneIdType nodeZoneId, const NodeZoneInfoType nodeZoneInfoType, int &info) const
 get certain zone level info for a node zone.
More...
 
void setAllFaceZoneFlags (const ZoneIdType faceZoneId, const int allFlags)
 Set flags for a face zone. More...
 
void getAllFaceZoneFlags (const ZoneIdType faceZoneId, int &allFlags) const
 Get flags for a face zone. More...
 
void setFaceZoneType (const ZoneIdType faceZoneId, const FaceZoneType zoneType)
 set zone type of a face zone. More...
 
void getFaceZoneType (const ZoneIdType faceZoneId, FaceZoneType &zoneType) const
 get the zone type of a face zone. More...
 
void setFaceZoneInfo (const ZoneIdType faceZoneId, const FaceZoneInfoType faceZoneInfoType, const int info) const
 set certain zone level info for a face zone. More...
 
void getFaceZoneInfo (const ZoneIdType faceZoneId, const FaceZoneInfoType faceZoneInfoType, int &info) const
 get certain zone level info for a face zone. More...
 
void setFaceZoneProp (const ZoneIdType faceZoneId, const FaceZonePropType faceZonePropType)
 
bool getFaceZoneProp (const ZoneIdType faceZoneId, const FaceZonePropType) const
 
void setZoneSizeInfo (const ZoneIdType zoneId, const ZoneSizeType sizeType, const ElemIdType size)
 Sets a size setting of a zone. More...
 
void getZoneSizeInfo (const ZoneIdType zoneId, const ZoneSizeType sizeType, ElemIdType &size) const
 Obtains a size setting of a zone. More...
 
void setCellZoneInfo (const ZoneIdType cellZoneId, const CellZoneInfoType cellZoneInfoType, const int info)
 set certain zone level info for a cell zone. More...
 
void getCellZoneInfo (const ZoneIdType cellZoneId, const CellZoneInfoType cellZoneInfoType, int &info) const
 get certain zone level info for a cell zone. More...
 
void setEdgeZoneType (const ZoneIdType edgeZoneId, const EdgeZoneType zoneType)
 set zone type of a edge zone.
More...
 
void getEdgeZoneType (const ZoneIdType edgeZoneId, EdgeZoneType &zoneType) const
 get the zone type of a edge zone. More...
 
void setEdgeZoneInfo (const ZoneIdType edgeZoneId, const EdgeZoneInfoType edgeZoneInfoType, const int info)
 set certain zone level info for a edge zone. More...
 
void getEdgeZoneInfo (const ZoneIdType edgeZoneId, const EdgeZoneInfoType edgeZoneInfoType, int &info) const
 get certain zone level info for a edge zone. More...
 
void setZoneStringInfo (const ZoneIdType zoneId, const ZoneStringInfoType type, const std::string &info)
 Sets a string value associated with a zone. More...
 
void getZoneStringInfo (const ZoneIdType zoneId, const ZoneStringInfoType type, std::string &info) const
 Obtains a string value associated with a zone. More...
 
void getFaceCellZone0Ids (const ZoneIdType faceZoneId, std::list< ZoneIdType > &zoneIds)
 Get a list of cell zones on side zero of a face zone. More...
 
void getFaceCellZone1Ids (const ZoneIdType faceZoneId, std::list< ZoneIdType > &zoneIds)
 Get a list of cell zones on side one of a face zone. More...
 
void getCellFaceZoneIds (const ZoneIdType cellZoneId, std::list< ZoneIdType > &zoneIds)
 Get a list of face zones touching a cell zone. More...
 
virtual void setSolverType (SolverType solverType)
 Set the name of the application that is supplying the data. More...
 
SolverType getSolverType () const
 Obtains the owner of the data in the model. More...
 
const CffLocationModelgetLocationModel () const
 Get a query interface to the underlying topology model. More...
 
void setVariableAttributeProvider (const CffVariableAttributeProvider *, bool takeOwnership=false)
 Register an alternative variable attribute provider. More...
 
CffMessageRegistrar * getMessageRegistrar () const
 Obtains a message registrar object so that external plug-ins can register messages with the API. More...
 
bool hasError () const
 returns whether there are unprocessed error messages registered. More...
 
bool hasWarning () const
 returns whether there are unprocessed warning messages registered. More...
 
bool hasInfo () const
 returns whether there are unprocessed informative messages registered. More...
 
std::vector< std::string > getErrors (bool formated=true, bool clear=false) const
 returns, as strings, any unprocessed error messages registered More...
 
std::vector< std::string > getWarnings (bool formated=true, bool clear=false) const
 returns, as strings, any unprocessed warning messages registered More...
 
std::vector< std::string > getInfos (bool formated=true, bool clear=false) const
 returns, as strings, any unprocessed information messages registered More...
 
void registerSettingsParser (CffSettingsParser *)
 Sets a parser for processing settings. More...
 
bool addSetting (const DataClass dataClass, const std::string &key, const std::string &value, const SolverType &solverType="CFF_GENERIC")
 Sets a specific setting by supplying a key and a value. More...
 
bool addSettingsDataSet (const DataClass dataClass, const std::string &dataSetPath, const std::string &data, const SolverType &solverType="CFF_GENERIC", const std::vector< std::string > &settingsKeys=std::vector< std::string >())
 Defines a set of data that contain the more than one setting. More...
 
- Public Member Functions inherited from ansys::CffVersion
 CffVersion ()
 
 ~CffVersion ()
 

Static Public Attributes

static std::string _defaultSettingsPath = "settings"
 

Protected Types

enum class  UpdateMethod { CaseOnly = 1 , ResultsOnly , CaseAndResults }
 

Protected Member Functions

CffReadable isSupported (const std::string &version) const
 Check whether the version can be read by this version of the CFF SDK. More...
 
void setMeshSize (const ElemIdType nDims, const ElemIdType nodesCount, const ElemIdType edgesCount, const ElemIdType facesCount, const ElemIdType cellsCount)
 Set the mesh size info This function is for providing top level meta data: the total mesh size of all zones In case you do not save certain entity, for example, edges, then the input edgesCount should be 0. More...
 
virtual void setZoneAdjacency ()
 
void setFaceCellZone0Ids (const std::map< ZoneIdType, std::list< ZoneIdType > > &)
 Set the c0 cell zones of all face zones The CellZone0 (c0) cell zones are the cell zones adjacent to the face zone and at the side of face normal direction The information provided here will be helpful for quicker establishment of zone level topology when reading the mesh Mesh without those information can still be read, but would be much slower. More...
 
void setFaceCellZone1Ids (const std::map< ZoneIdType, std::list< ZoneIdType > > &)
 Set the c1 cell zones of all face zones The CellZone1 (c1) cell zones are the cell zones adjacent to the face zone and at the side opposite to face normal direction The information provided here will be helpful for quicker establishment of zone level topology when reading the mesh Mesh without those information can still be read, but would be much slower. More...
 
void getFaceCellZone0Ids (std::map< ZoneIdType, std::list< ZoneIdType > > &)
 
void getFaceCellZone1Ids (std::map< ZoneIdType, std::list< ZoneIdType > > &)
 
void setCellFaceZoneIds (const std::map< ZoneIdType, std::list< ZoneIdType > > &)
 Set the face zones ids of all cell zones The face zones of a cell zone are all face zones that adjacent to the cell zone The information provided here will be helpful for quicker establishment of zone level topology when reading the mesh Mesh without those information can still be read, but would be much slower. More...
 
void getSortedMinIdZoneId (const ZoneCategory, std::vector< std::pair< ElemIdType, ZoneIdType > > &minIdZoneId) const
 
std::string getGroupNameForPhase (PhaseIdType phaseId) const
 
CffSolutionModel * solutionModel () const
 
virtual void initLocationModel () const
 
CffLocationModellocationModel () const
 
void initializeVariableAttributeProvider (const SolverType &solverType, const std::string &variableTarget)
 
virtual bool updateData (DataClass)
 
bool setMeshContext (MeshId, TargetCategory, PartitionIdType, UpdateMethod=UpdateMethod::CaseAndResults)
 
virtual void finalizeMeshContext ()
 
void setZoneCategory (const ZoneIds &, const ZoneCategory)
 set the zone categories of all zones of the same zone category More...
 
ZoneCategory getZoneCategory (const ZoneIdType zoneId) const
 get the zone category of a given zone by zone id More...
 
void addVariableOfCategory (VariableIdType, ZoneCategory) const
 

Protected Attributes

std::unique_ptr< DataInterface > _data
 
std::unique_ptr< const CffVariableAttributeProvider > _varAttrProvider
 
void setApplicationName (const std::string &applicationName)
 Sets an application name for error purposes and when logging to a file. More...
 
std::string getApplicationName () const
 Obtains the application name that was set by calling setApplicationName logging when writing a file. More...
 
void getPhaseIds (PhaseIds &phaseIds) const
 Obtain the Identifiers of all Phase. More...
 
bool getPhaseName (const PhaseIdType phaseId, PhaseName &phaseName) const
 Obtain the unique name a specific Phase. More...
 
PhaseName getPhaseName (const PhaseIdType phaseId) const
 Obtain the unique name a specific Phase. More...
 
bool getActivePhase (PhaseIdType &) const
 
bool setActivePhase (PhaseIdType) const
 
bool getActivePhase (PhaseName &) const
 
bool setActivePhase (const PhaseName &) const
 
const TimeLevelsgetTimeLevels () const
 
TimeLevelType getTimeLevel () const
 
void addTimeLevel (TimeLevelType) const
 
bool setTimeLevel (TimeLevelType) const
 

Additional Inherited Members

- Static Public Member Functions inherited from ansys::CffVersion
static unsigned int getMajor ()
 
static unsigned int getMinor ()
 
static unsigned int getPatch ()
 
static std::string getSHA ()
 
static bool isBeta ()
 
static std::string apiVersionAsString (const std::string &separator=".")
 
static std::string ansysApplicationVersion (const std::string &appName)
 
static std::string copyright (bool allRightsReserved)
 

Detailed Description

Base class that provides common function used by both CffConsumer and CffProvider classes.

CffBase cannot be instantiated itself but must be used via the derived classes ansys::CffConsumer (when writing to CFF) and ansys::CffProvider (when reading from CFF).

Member Enumeration Documentation

◆ UpdateMethod

enum class ansys::CffBase::UpdateMethod
strongprotected
Enumerator
CaseOnly 
ResultsOnly 
CaseAndResults 

Constructor & Destructor Documentation

◆ CffBase()

ansys::CffBase::CffBase ( )

Constructor.

A CffBase object cannot be constructed directly but needs to be constructed by a create an object that has been derived from it.

◆ ~CffBase()

ansys::CffBase::~CffBase ( )
virtual

Destructor.

Destroys an instance of a type CffBase

Member Function Documentation

◆ addSetting()

bool ansys::CffBase::addSetting ( const DataClass  type,
const std::string &  key,
const std::string &  value,
const SolverType solverType = "CFF_GENERIC" 
)

Sets a specific setting by supplying a key and a value.

Parameters
type[in] - The class of data to which the setting applies
key[in] - The key of the setting being set
value[in] - The value to be associated with the key
solverType[in] - The solver writing the data
Returns
- True if successully added, false otherwise

◆ addSettingsDataSet()

bool ansys::CffBase::addSettingsDataSet ( const DataClass  dataClass,
const std::string &  dataSetPath,
const std::string &  settings,
const SolverType solverType = "CFF_GENERIC",
const std::vector< std::string > &  settingsKeys = std::vector<std::string>() 
)

Defines a set of data that contain the more than one setting.

A complete dataset containing multiple settings may be supplied to the interface that are typically in a solvers native language. When called this function parsers the settings uusing the parser appropriate for the solver type supplied, thus breaking the settings into key value pairs, and stores mattched subset of the settings controlled by settingsKeys.

A non-default parser may be supplied by the user calling registerSettingsParser prior to this function being called.

The settings will override any settings already stored in the dataset

Parameters
dataClass[in] - The class of data to which the setting applies
dataSetPath[in] - The data set in which to store the settings
settings[in] - The settings to parse prior to storing in the dataset
solverType[in] - The solver providing the settings data
settingsKeys[in] - A set of keys that is used to restrict the settings to a subset key values. If empty all supplied settings are stored
Returns
- true if a valid parser is found, otherwise false

◆ addTimeLevel()

void ansys::CffBase::addTimeLevel ( TimeLevelType  timeLevel) const
protected

◆ addVariableOfCategory()

void ansys::CffBase::addVariableOfCategory ( VariableIdType  varId,
ZoneCategory  category 
) const
protected

◆ finalizeMeshContext()

virtual void ansys::CffBase::finalizeMeshContext ( )
inlineprotectedvirtual

◆ getActivePhase() [1/2]

bool ansys::CffBase::getActivePhase ( PhaseIdType phaseId) const
protected

◆ getActivePhase() [2/2]

bool ansys::CffBase::getActivePhase ( PhaseName phaseName) const
protected

◆ getAllFaceZoneFlags()

void ansys::CffBase::getAllFaceZoneFlags ( const ZoneIdType  faceZoneId,
int &  allFlags 
) const

Get flags for a face zone.

Flags are returned in an integer using a 'C' style bit pattern.

The application developer using the API is assumed to have full knowledge of the bitwise operations in the C programming language and should consider this when writing the flags associated with the face zone.

Please note this is a Fluent solver concept for coupled walls to handle baffles or solid zones. Where a zone/shadow zone pair is defined: The first bit is reserved for the major zone. The second bit is reserved for the minor zone. Only if the shadow face zones pair is a wall (i.e. Conjugate Heat Transfer (CHT) case), the third bit is used to indicate that each zone is in fact a wall.

Parameters
faceZoneId[in] - The zone Id, from which the flag will be get
allFlags[out] - The flags stored as a bit pattern

◆ getApplicationName()

std::string ansys::CffBase::getApplicationName ( ) const
protected

Obtains the application name that was set by calling setApplicationName logging when writing a file.

Returns
- The application name

◆ getCellFaceZoneIds()

void ansys::CffBase::getCellFaceZoneIds ( const ZoneIdType  cellZoneId,
std::list< ZoneIdType > &  zoneIds 
)

Get a list of face zones touching a cell zone.

Parameters
cellZoneId- cell zone ID to get the face zones for
zoneIds- list of face zones IDs

◆ getCellZoneInfo()

void ansys::CffBase::getCellZoneInfo ( const ZoneIdType  cellZoneId,
const CellZoneInfoType  cellZoneInfoType,
int &  info 
) const

get certain zone level info for a cell zone.

Parameters
cellZoneId[in] - The zone Id, of which the zone info will be get
cellZoneInfoType[in] - The zone info type to get, refer CffCellZoneInfoType for all cell zone info types
info[out] - The actual data for the zone info type

◆ getEdgeZoneInfo()

void ansys::CffBase::getEdgeZoneInfo ( const ZoneIdType  edgeZoneId,
const EdgeZoneInfoType  edgeZoneInfoType,
int &  info 
) const

get certain zone level info for a edge zone.

Parameters
edgeZoneId[in] - The zone Id, of which the zone info will be get
edgeZoneInfoType[in] - The zone info type to get, refer CffEdgeZoneInfoType for all edge zone info types
info[out] - The actual data for the zone info type

◆ getEdgeZoneType()

void ansys::CffBase::getEdgeZoneType ( const ZoneIdType  edgeZoneId,
EdgeZoneType zoneType 
) const

get the zone type of a edge zone.

Zone types of edges zones indicate edge type of the edge zone. For all defined edge zone types, see CffEdgeZoneType

Parameters
edgeZoneId[in] - The zone Id, of which the zone type will be get
zoneType[out] - The edge zone type

◆ getErrors()

std::vector< std::string > ansys::CffBase::getErrors ( bool  formatted = true,
bool  clear = false 
) const

returns, as strings, any unprocessed error messages registered

Parameters
[in]formatted- true if the message should be returned in a format that includes its type.
[in]clear- clear errors on return
Returns
- vector of messages

◆ getFaceCellZone0Ids() [1/2]

void ansys::CffBase::getFaceCellZone0Ids ( const ZoneIdType  faceZoneId,
std::list< ZoneIdType > &  zoneIds 
)

Get a list of cell zones on side zero of a face zone.

Parameters
faceZoneId- face zone ID to get the cell0 for
zoneIds- list of cell0 zones IDs

◆ getFaceCellZone0Ids() [2/2]

void ansys::CffBase::getFaceCellZone0Ids ( std::map< ZoneIdType, std::list< ZoneIdType > > &  )
protected

◆ getFaceCellZone1Ids() [1/2]

void ansys::CffBase::getFaceCellZone1Ids ( const ZoneIdType  faceZoneId,
std::list< ZoneIdType > &  zoneIds 
)

Get a list of cell zones on side one of a face zone.

Parameters
faceZoneId- face zone ID to get the cell1 for
zoneIds- list of cell1 zones IDs

◆ getFaceCellZone1Ids() [2/2]

void ansys::CffBase::getFaceCellZone1Ids ( std::map< ZoneIdType, std::list< ZoneIdType > > &  )
protected

◆ getFaceZoneInfo()

void ansys::CffBase::getFaceZoneInfo ( const ZoneIdType  faceZoneId,
const FaceZoneInfoType  faceZoneInfoType,
int &  info 
) const

get certain zone level info for a face zone.

Parameters
faceZoneId[in] - The zone Id, of which the zone info will be get
faceZoneInfoType[in] - The zone info type to get, refer CffFaceZoneInfoType for all face zone info types
info[in] - The actual data for the zone info type

◆ getFaceZoneProp()

bool ansys::CffBase::getFaceZoneProp ( const ZoneIdType  faceZoneId,
const FaceZonePropType  faceZonePropType 
) const

◆ getFaceZoneType()

void ansys::CffBase::getFaceZoneType ( const ZoneIdType  faceZoneId,
FaceZoneType zoneType 
) const

get the zone type of a face zone.

Zone types of edges zones indicate face element type of the face zone. For all defined face zone types, see CffFaceZoneType

Parameters
faceZoneId[in] - The zone Id, of which the zone type will be get
zoneType[out] - The face zone type

◆ getGroupNameForPhase()

std::string ansys::CffBase::getGroupNameForPhase ( PhaseIdType  phaseId) const
protected

◆ getInfos()

std::vector< std::string > ansys::CffBase::getInfos ( bool  formatted = true,
bool  clear = false 
) const

returns, as strings, any unprocessed information messages registered

Parameters
[in]formatted- true if the message should be returned in a format that includes its type.
[in]clear- clear informtion messages on return
Returns
- vector of messages

◆ getLocationModel()

const CffLocationModel * ansys::CffBase::getLocationModel ( ) const

Get a query interface to the underlying topology model.

◆ getMeshId()

MeshIdType ansys::CffBase::getMeshId ( ) const

Get the Identifier of the active mesh.

Returns
The Id of the active mesh

◆ getMeshSize()

void ansys::CffBase::getMeshSize ( const MeshSizeType  type,
ElemIdType size 
) const

Obtains a value that defines the dimension or the global number of objects of a specific mesh entity.

Parameters
type[in] - Type of mesh size for which the value is to be obtained.
size[out] - The value for the type of mesh sizing requested.

◆ getMeshUnits()

void ansys::CffBase::getMeshUnits ( std::string &  units) const

Obtains the unit of length the mesh is defined in.

By default the units are in the SI unit of length "m"

Parameters
units[out] - The unit the mesh is defined in.

◆ getMessageRegistrar()

CffMessageRegistrar * ansys::CffBase::getMessageRegistrar ( ) const

Obtains a message registrar object so that external plug-ins can register messages with the API.

Returns
- A pointer to the message registration object.

Note: The registrar remains in the ownership of the API and should not be destroyed

◆ getNodeZoneInfo()

void ansys::CffBase::getNodeZoneInfo ( const ZoneIdType  nodeZoneId,
const NodeZoneInfoType  nodeZoneInfoType,
int &  info 
) const

get certain zone level info for a node zone.

Parameters
nodeZoneId[in] - The zone Id, of which the zone info will be get
nodeZoneInfoType[in] - The zone info type to get, refer CffNodeZoneInfoType for all node zone info types
info[out] - The actual data for the zone info type

◆ getNumZones()

size_t ansys::CffBase::getNumZones ( const ZoneCategory  zoneCategory) const
virtual

Returns the number of zones in a specific category.

Parameters
zoneCategory[in] - The category to query.
Returns
- The number of zones defined of that category.

◆ getPartitionId()

PartitionIdType ansys::CffBase::getPartitionId ( ) const

◆ getPhaseIds()

void ansys::CffBase::getPhaseIds ( PhaseIds phaseIds) const

Obtain the Identifiers of all Phase.

Parameters
phaseIds[out] - The Identifiers of all Phases.

◆ getPhaseName() [1/2]

PhaseName ansys::CffBase::getPhaseName ( const PhaseIdType  phaseId) const

Obtain the unique name a specific Phase.

This function is deprecated in favour of getPhaseName(const PhaseIdType, PhaseName&) const

Parameters
phaseId[in] - The Phase Identifier for which to obtain the name.
Returns
- The unique name obtained.

◆ getPhaseName() [2/2]

bool ansys::CffBase::getPhaseName ( const PhaseIdType  phaseId,
PhaseName phaseName 
) const

Obtain the unique name a specific Phase.

Parameters
phaseId[in] - The Phase Identifier for which to obtain the name.
phaseName[out] - The unique name obtained.
Returns
- Whether the Phase supplied was valid.

◆ getSolverType()

SolverType ansys::CffBase::getSolverType ( ) const

Obtains the owner of the data in the model.

Returns
- The name of the application that supplied the data.

◆ getSortedMinIdZoneId()

void ansys::CffBase::getSortedMinIdZoneId ( const ZoneCategory  zoneCategory,
std::vector< std::pair< ElemIdType, ZoneIdType > > &  minIdZoneId 
) const
protected

◆ getTarget()

TargetCategory ansys::CffBase::getTarget ( ) const

Get the target category for which the data is intended.

The target category defines whether the mesh and solution data is written as a CFF Solver Restart data or a CFF Post Processing file.

Typically for some applications, such as ANSYS Fluent, restart data may not be used for Post processing without careful understanding of how the restart data has been written.

Returns
- The category of data being processed.

◆ getTimeLevel()

TimeLevelType ansys::CffBase::getTimeLevel ( ) const

Get the current time level that is being read or written to the results data

◆ getTimeLevels()

const TimeLevels & ansys::CffBase::getTimeLevels ( ) const

Get the time levels that have been read/written to the results data

◆ getWarnings()

std::vector< std::string > ansys::CffBase::getWarnings ( bool  formatted = true,
bool  clear = false 
) const

returns, as strings, any unprocessed warning messages registered

Parameters
[in]formatted- true if the message should be returned in a format that includes its type.
[in]clear- clear warnings on return
Returns
- vector of messages

◆ getZoneCategory()

ZoneCategory ansys::CffBase::getZoneCategory ( const ZoneIdType  zoneId) const
protected

get the zone category of a given zone by zone id

Parameters
zoneId[in] - the zone id, of which zone, the zone category will be retrieved
Returns
- zone category of all the zones indicated by the input argument, all supported zone categories are defined in ZoneCategory

◆ getZoneIds()

void ansys::CffBase::getZoneIds ( const ZoneCategory  zoneCategory,
ZoneIds zoneIds 
) const
virtual

Request the collection of zone Ids that are of a specific category.

Parameters
zoneCategory[in] - The category too query.
zoneIds[out] - The zone Ids in the category.

Note: zoneIds is correctly sized by the function.

◆ getZoneSizeInfo()

void ansys::CffBase::getZoneSizeInfo ( const ZoneIdType  zoneId,
const ZoneSizeType  sizeType,
ElemIdType size 
) const

Obtains a size setting of a zone.

Zones are defined with a dimension, number of objects, and the object Id range (start Id and end Id). This function allows the user to obtain the value of each individual size setting independently. The type of setting is defined by an enum ZoneSizeType.

Parameters
zoneId[in] - The id of the zone for which the value is being set.
sizeType[in] - The setting being defined. e.g. CFF_ZONE_DIMENSION
size[out] - The value associated with the zone or 0 if in error.

◆ getZoneStringInfo()

void ansys::CffBase::getZoneStringInfo ( const ZoneIdType  zoneId,
const ZoneStringInfoType  type,
std::string &  info 
) const

Obtains a string value associated with a zone.

Typically a mesh zone will have a name that identifies it, it may also have a type represented as a string.

To obtaint the appropriate value ZoneStringInfoType is passed to the function to indicate the type of setting being requested.

Parameters
zoneId[in] - The Zone Id for which information is to be obtained.
type[in] - The Type of string setting being obtained.
info[out] - The value of the setting.

◆ hasError()

bool ansys::CffBase::hasError ( ) const

returns whether there are unprocessed error messages registered.

Returns
- true if messages are unprocessed, false otherwise

◆ hasInfo()

bool ansys::CffBase::hasInfo ( ) const

returns whether there are unprocessed informative messages registered.

Returns
- true if messages are unprocessed, false otherwise

◆ hasWarning()

bool ansys::CffBase::hasWarning ( ) const

returns whether there are unprocessed warning messages registered.

Returns
- true if messages are unprocessed, false otherwise

◆ initializeVariableAttributeProvider()

void ansys::CffBase::initializeVariableAttributeProvider ( const SolverType solverType,
const std::string &  variableTarget 
)
protected

◆ initLocationModel()

virtual void ansys::CffBase::initLocationModel ( ) const
inlineprotectedvirtual

◆ isSupported()

CffReadable ansys::CffBase::isSupported ( const std::string &  version) const
protected

Check whether the version can be read by this version of the CFF SDK.

Parameters
version[in] - The version number string representing the data being processed.
Returns
- CFF_READABLE_OK if the API can read the data, CFF_READABLE_WARN if the data can be read partially or with warnings, CFF_READABLE_ERROR if the data is incompatible with this version of the API.

◆ locationModel()

CffLocationModel * ansys::CffBase::locationModel ( ) const
protected

◆ registerSettingsParser()

void ansys::CffBase::registerSettingsParser ( CffSettingsParser *  parser)

Sets a parser for processing settings.

Settings are typically stored within a CFF file as a set of strings in order to provide common access to these settings a settings parser may be provided as an alternative to those installed by default that read the strings, manipulate the settings and return them in a form that is common across all applications.

It is unlikley that a user will need to supply an alternative parser

Parameters
parser[in] - The parser to install.

◆ setActivePhase() [1/2]

bool ansys::CffBase::setActivePhase ( const PhaseName phaseName) const
protected

◆ setActivePhase() [2/2]

bool ansys::CffBase::setActivePhase ( PhaseIdType  phaseId) const
protected

◆ setAllFaceZoneFlags()

void ansys::CffBase::setAllFaceZoneFlags ( const ZoneIdType  faceZoneId,
const int  allFlags 
)

Set flags for a face zone.

Flags are supplied in an integer using a 'C' style bit pattern.

The application developer using the API is assumed to have full knowledge of the bitwise operations in the C programming language and should consider this when writing the flags associated with the face zone.

Please note this is a Fluent solver concept for coupled walls to handle baffles or solid zones. Where a zone/shadow zone pair is defined: The first bit is reserved for the major zone. The second bit is reserved for the minor zone. Only if the shadow face zones pair is a wall (i.e. Conjugate Heat Transfer (CHT) case), the third bit is used to indicate that each zone is in fact a wall.

Parameters
faceZoneId[in] - The Id of the zone, for which the flags will be set
allFlags[in] - The flags stored as a bit pattern

◆ setApplicationName()

void ansys::CffBase::setApplicationName ( const std::string &  applicationName)

Sets an application name for error purposes and when logging to a file.

Parameters
applicationName[in] - The application name to set

◆ setCellFaceZoneIds()

void ansys::CffBase::setCellFaceZoneIds ( const std::map< ZoneIdType, std::list< ZoneIdType > > &  cfz)
protected

Set the face zones ids of all cell zones The face zones of a cell zone are all face zones that adjacent to the cell zone The information provided here will be helpful for quicker establishment of zone level topology when reading the mesh Mesh without those information can still be read, but would be much slower.

Parameters
cfz[in] - A std map, for each entity in the map, the key is the cell zone id, the value is a list, whose elements are face zone ids of the corresponding cell zone

◆ setCellZoneInfo()

void ansys::CffBase::setCellZoneInfo ( const ZoneIdType  cellZoneId,
const CellZoneInfoType  cellZoneInfoType,
const int  info 
)

set certain zone level info for a cell zone.

Parameters
cellZoneId[in] - The zone Id, of which the zone info will be set
cellZoneInfoType[in] - The zone info type to set, refer CffCellZoneInfoType for all cell zone info types
info[in] - The actual data for the zone info type

◆ setDebugOn()

void ansys::CffBase::setDebugOn ( bool  debug)
virtual

Turn on/off debugging information.

Parameters
debug[in] - If true debugging is turned on, otherwise turned off

◆ setEdgeZoneInfo()

void ansys::CffBase::setEdgeZoneInfo ( const ZoneIdType  edgeZoneId,
const EdgeZoneInfoType  edgeZoneInfoType,
const int  info 
)

set certain zone level info for a edge zone.

Parameters
edgeZoneId[in] - The zone Id, of which the zone info will be set
edgeZoneInfoType[in] - The zone info type to set, refer CffEdgeZoneInfoType for all edge zone info types
info[in] - The actual data for the zone info type

◆ setEdgeZoneType()

void ansys::CffBase::setEdgeZoneType ( const ZoneIdType  edgeZoneId,
const EdgeZoneType  zoneType 
)

set zone type of a edge zone.

Zone types of edges zones indicate edge type of the edge zone. For all defined edge zone types, see CffEdgeZoneType

Parameters
edgeZoneId[in] - The zone Id, to which the zone type will be set
zoneType[in] - The edge zone type

◆ setFaceCellZone0Ids()

void ansys::CffBase::setFaceCellZone0Ids ( const std::map< ZoneIdType, std::list< ZoneIdType > > &  fc0)
protected

Set the c0 cell zones of all face zones The CellZone0 (c0) cell zones are the cell zones adjacent to the face zone and at the side of face normal direction The information provided here will be helpful for quicker establishment of zone level topology when reading the mesh Mesh without those information can still be read, but would be much slower.

Parameters
fc0[in] - A std map, for each entity in the map, the key is the face zone id, the value is a list, whose elements are c0 cell zone ids of the corresponding face zone

◆ setFaceCellZone1Ids()

void ansys::CffBase::setFaceCellZone1Ids ( const std::map< ZoneIdType, std::list< ZoneIdType > > &  fc1)
protected

Set the c1 cell zones of all face zones The CellZone1 (c1) cell zones are the cell zones adjacent to the face zone and at the side opposite to face normal direction The information provided here will be helpful for quicker establishment of zone level topology when reading the mesh Mesh without those information can still be read, but would be much slower.

Parameters
fc1[in] - A std map, for each entity in the map, the key is the face zone id, the value is a list, whose elements are c1 cell zone ids of the corresponding face zone

◆ setFaceZoneInfo()

void ansys::CffBase::setFaceZoneInfo ( const ZoneIdType  faceZoneId,
const FaceZoneInfoType  faceZoneInfoType,
const int  info 
) const

set certain zone level info for a face zone.

Parameters
faceZoneId[in] - The zone Id, of which the zone info will be set
faceZoneInfoType[in] - The zone info type to set, refer CffFaceZoneInfoType for all face zone info types
info[in] - The actual data for the zone info type

◆ setFaceZoneProp()

void ansys::CffBase::setFaceZoneProp ( const ZoneIdType  faceZoneId,
const FaceZonePropType  faceZonePropType 
)

◆ setFaceZoneType()

void ansys::CffBase::setFaceZoneType ( const ZoneIdType  faceZoneId,
const FaceZoneType  zoneType 
)

set zone type of a face zone.

Zone types of edges zones indicate face element type of the face zone. For all defined face zone types, see CffFaceZoneType

Parameters
faceZoneId[in] - The zone Id, to which the zone type will be set
zoneType[in] - The face zone type

◆ setMeshContext()

bool ansys::CffBase::setMeshContext ( MeshId  meshId,
TargetCategory  target,
PartitionIdType  partition,
UpdateMethod  method = UpdateMethod::CaseAndResults 
)
protected

◆ setMeshId()

void ansys::CffBase::setMeshId ( const MeshIdType  meshId)

Set the Identifier for active mesh being read or written.

Parameters
meshId[in] - The Id of the mesh

◆ setMeshSize() [1/2]

void ansys::CffBase::setMeshSize ( const ElemIdType  nDims,
const ElemIdType  nodesCount,
const ElemIdType  edgesCount,
const ElemIdType  facesCount,
const ElemIdType  cellsCount 
)
protected

Set the mesh size info This function is for providing top level meta data: the total mesh size of all zones In case you do not save certain entity, for example, edges, then the input edgesCount should be 0.

Parameters
nDims[in] - the dimension of mesh, if the mesh is 3D, then nDims should be 3
nodesCount[in] - total number of nodes
edgesCount[in] - total number of edges,
facesCount[in] - total number of faces
cellsCount[in] - total number of cells

◆ setMeshSize() [2/2]

void ansys::CffBase::setMeshSize ( const MeshSizeType  type,
const ElemIdType  size 
)

Sets a value that defines the dimension or the global number of objects of a specific mesh entity.

Ahead of any mesh being written, the mesh dimension and global mesh sizes must be set. Typically the number of Cells, Faces and Nodes must be supplied. The type of the data being set is defined using the MeshSizeType enumerated type

Parameters
type[in] - The type of mesh size for which the value is to be set.
size[in] - The value to be set.

◆ setMeshUnits()

void ansys::CffBase::setMeshUnits ( const std::string &  units = "m")

Define the units of length the mesh is defined in.

By default the units are in the SI unit of length "m"

Parameters
units[in] - The units the mesh is defined in.

◆ setNodeZoneInfo()

void ansys::CffBase::setNodeZoneInfo ( const ZoneIdType  nodeZoneId,
const NodeZoneInfoType  nodeZoneInfoType,
const int  info 
) const

set certain zone level info for a node zone.

Parameters
nodeZoneId[in] - The zone Id, of which the zone info will be set
nodeZoneInfoType[in] - The zone info type to set, refer CffNodeZoneInfoType for all node zone info types
info[in] - The actual data for the zone info type

◆ setPartitionId()

void ansys::CffBase::setPartitionId ( const PartitionIdType  pId)

◆ setReadNCIOn()

void ansys::CffBase::setReadNCIOn ( bool  nci)
virtual

Turn on/off non-conformal interface reading.

Parameters
nci[in] - If true, NCI reading is enabled

◆ setSolverType()

void ansys::CffBase::setSolverType ( SolverType  solverType)
virtual

Set the name of the application that is supplying the data.

When supplyingn a model this function should be called to definie the owner of the data that is in the model. This name is used automatically by the API to determine the CffVariableAttributeProvider that is used to populate the Ansys Common Fluids Solution Data Model.

Parameters
solverType[in] - String representing the application name writing the data e.g. "ANSYS_FLUENT".

◆ setTarget()

void ansys::CffBase::setTarget ( const TargetCategory  target)

Set the target category for which the data is intended.

The target category defines whether the mesh and solution data is written as a CFF Solver Restart data or a CFF Post Processing file.

Restart data is typically intended for use within the solver that wrote the data. This sometimes means that the data read from the file will not be suitable for Post Processing without further manipulation using domain knowledge. See CFF Restart Format.

Post processing data is always written corrected and in a simplified model that makes Post Processing in ANSYS Ensight quicker. See CFF Post Format

Parameters
target- The category of data being definied.

◆ setTimeLevel()

bool ansys::CffBase::setTimeLevel ( TimeLevelType  timeLevel) const
protected

◆ setVariableAttributeProvider()

void ansys::CffBase::setVariableAttributeProvider ( const CffVariableAttributeProvider *  vap,
bool  takeOwnership = false 
)

Register an alternative variable attribute provider.

Often the user may wish to supply variable attributes when reading or writing data. In the reading case this may be because the variable attributes are not in the file and a default provider doesn't exist. When writing the data this may also be the case if the attributes can be supplied from an alternative data source such as a configuration file.

Parameters
vap[in] - The alternative variable attribute provider.
takeOwnership[in] - The managementof the memory pointed to by vap is controlled by the CFFAPI if true or remains with the user otherwise. In the later case the user should call the function again with a null pointer to remove the reference in the API when no longer required.

◆ setZoneAdjacency()

void ansys::CffBase::setZoneAdjacency ( )
protectedvirtual

◆ setZoneCategory()

void ansys::CffBase::setZoneCategory ( const ZoneIds zoneIds,
const ZoneCategory  zoneCategory 
)
protected

set the zone categories of all zones of the same zone category

This function can be used to set zone categories of a batch of zones with the same zone category.

Parameters
zoneIds[in] - zone ids that have the same zone category indicated by the second argument
zoneCategory[in] - zone category of all the zones indicated by the first argument, all supported zone categories are defined in ZoneCategory

◆ setZoneIds()

void ansys::CffBase::setZoneIds ( const ZoneCategory  zoneCategory,
const ZoneIds zoneIds 
)

Define the zones that are of a specific category.

Zones define collections of nodes, faces or cells. This function defines the zones that exist a specific ZoneCategory.

Parameters
zoneCategory[in] - The category of the zones being supplied.
zoneIds[in] - Collection of zones Ids that are of category.

◆ setZoneSizeInfo()

void ansys::CffBase::setZoneSizeInfo ( const ZoneIdType  zoneId,
const ZoneSizeType  sizeType,
const ElemIdType  size 
)

Sets a size setting of a zone.

Zones are defined with a dimension, number of objects, and the object Id range (start Id and end Id). This function allows the setting of each individual size independently. The type ofsetting is defined by an enum ZoneSizeType.

Parameters
zoneId[in] - The id of the zone for which the value is being set.
sizeType[in] - The setting being defined. e.g. CFF_ZONE_DIMENSION
size[in] - The value being set. e.g. 3

◆ setZoneStringInfo()

void ansys::CffBase::setZoneStringInfo ( const ZoneIdType  zoneId,
const ZoneStringInfoType  type,
const std::string &  info 
)

Sets a string value associated with a zone.

Typically a mesh zone will have a name that identifies it, it may also have a type represented as a string.

To set the appropriate value ZoneStringInfoType is passed to the function to indicate the type of setting being supplied.

Parameters
zoneId[in] - The Id of the Zone for which information is to be set.
type[in] - The type of string setting being set.
info[in] - The value of the setting being set.

◆ solutionModel()

CffSolutionModel * ansys::CffBase::solutionModel ( ) const
protected

◆ updateData()

virtual bool ansys::CffBase::updateData ( DataClass  )
inlineprotectedvirtual

Member Data Documentation

◆ _data

std::unique_ptr<DataInterface> ansys::CffBase::_data
protected

◆ _defaultSettingsPath

std::string ansys::CffBase::_defaultSettingsPath = "settings"
static

◆ _varAttrProvider

std::unique_ptr<const CffVariableAttributeProvider> ansys::CffBase::_varAttrProvider
protected

Connect with Ansys