Version: 9.16.0
DriverStructuredCGNS_Write Class Reference

Driver writinging a mesh into the CGNS file. More...

#include <DriverStructuredCGNS_Write.hxx>

Inheritance diagram for DriverStructuredCGNS_Write:

Public Types

enum  Status {
  DRS_OK , DRS_EMPTY , DRS_WARN_RENUMBER , DRS_WARN_SKIP_ELEM ,
  DRS_WARN_DESCENDING , DRS_FAIL , DRS_TOO_LARGE_MESH
}
 

Public Member Functions

 DriverStructuredCGNS_Write ()
 Constructor. More...
 
 ~DriverStructuredCGNS_Write ()
 Close the cgns file at destruction. More...
 
virtual Status Perform ()
 Write the mesh into the CGNS file. More...
 
std::string GetGroupName (const int shapeToIndex, int dim)
 Search for a SMESHDS_GroupOnGeom associated to the geometry and return his name. More...
 
void CheckForGroupNameOnFaceInterfaces (const SMESHUtils::SMESH_RegularGrid *grid, std::vector< std::string > &interfaceNames)
 Fill name of face interfaces associated to mesh groups. More...
 
void CheckForGroupNameOnEdgeInterfaces (const SMESHUtils::SMESH_RegularGrid *grid, std::vector< std::string > &interfaceNames)
 Fill name of edge interfaces associated to mesh groups. More...
 
void SetMesh (SMESHDS_Mesh *theMesh)
 
void SetMeshId (int theMeshId)
 
virtual void SetFile (const std::string &theFileName)
 
virtual void SetMeshName (const std::string &theMeshName)
 
virtual std::string GetMeshName () const
 
virtual void SetOption (const std::string &, const std::string &)
 
virtual SMESH_ComputeErrorPtr GetError ()
 Return a structure containing description of errors. More...
 

Static Public Member Functions

template<typename IDTYPE >
static bool IsMeshTooLarge (const SMDS_Mesh *mesh, bool checkIDs)
 

Protected Member Functions

Status addMessage (const std::string &msg, const bool isFatal=false)
 Stores an error message. More...
 

Static Protected Member Functions

static std::string fixUTF8 (const std::string &s)
 Assure a string is UTF-8 valid by replacing invalid chars. More...
 

Protected Attributes

SMESHDS_MeshmyMesh
 
std::string myFile
 
std::string myMeshName
 
int myMeshId
 
std::vector< std::string > myErrorMessages
 
Status myStatus
 

Private Member Functions

void GetGroupNamesMap (const TopoDS_Shape &shape, int dim, std::map< size_t, std::string > &groupNameMapById)
 Get the map between a solid (or face) id and its unique name. More...
 

Private Attributes

int _fn
 file index More...
 

Detailed Description

Driver writinging a mesh into the CGNS file.

Member Enumeration Documentation

◆ Status

enum Driver_Mesh::Status
inherited
Enumerator
DRS_OK 
DRS_EMPTY 
DRS_WARN_RENUMBER 
DRS_WARN_SKIP_ELEM 
DRS_WARN_DESCENDING 
DRS_FAIL 
DRS_TOO_LARGE_MESH 

Constructor & Destructor Documentation

◆ DriverStructuredCGNS_Write()

DriverStructuredCGNS_Write::DriverStructuredCGNS_Write ( )

Constructor.

◆ ~DriverStructuredCGNS_Write()

DriverStructuredCGNS_Write::~DriverStructuredCGNS_Write ( )

Close the cgns file at destruction.

References _fn.

Member Function Documentation

◆ addMessage()

◆ CheckForGroupNameOnEdgeInterfaces()

void DriverStructuredCGNS_Write::CheckForGroupNameOnEdgeInterfaces ( const SMESHUtils::SMESH_RegularGrid grid,
std::vector< std::string > &  interfaceNames 
)

◆ CheckForGroupNameOnFaceInterfaces()

void DriverStructuredCGNS_Write::CheckForGroupNameOnFaceInterfaces ( const SMESHUtils::SMESH_RegularGrid grid,
std::vector< std::string > &  interfaceNames 
)

◆ fixUTF8()

std::string Driver_Mesh::fixUTF8 ( const std::string &  s)
staticprotectedinherited

Assure a string is UTF-8 valid by replacing invalid chars.

Referenced by DriverMED_R_SMESHDS_Mesh::Perform().

◆ GetError()

◆ GetGroupName()

std::string DriverStructuredCGNS_Write::GetGroupName ( const int  shapeToIndex,
int  dim 
)

Search for a SMESHDS_GroupOnGeom associated to the geometry and return his name.

Parameters
shapeToIndex,theindex of the shape as given by shapeToIndex method
Returns
the name of the group if found or an empty name

References SMESHDS_Mesh::GetGroups(), SMESHDS_GroupOnGeom::GetShape(), SMESHDS_GroupBase::GetStoreName(), Driver_SMESHDS_Mesh::myMesh, and SMESHDS_Mesh::ShapeToIndex().

Referenced by GetGroupNamesMap().

◆ GetGroupNamesMap()

void DriverStructuredCGNS_Write::GetGroupNamesMap ( const TopoDS_Shape &  shape,
int  dim,
std::map< size_t, std::string > &  groupNameMapById 
)
private

Get the map between a solid (or face) id and its unique name.

Add a suffix if needed to avoid duplicate group name.

References Face, GetGroupName(), Driver_SMESHDS_Mesh::myMesh, and SMESHDS_Mesh::ShapeToIndex().

Referenced by Perform().

◆ GetMeshName()

std::string Driver_Mesh::GetMeshName ( ) const
virtualinherited

◆ IsMeshTooLarge()

template<typename IDTYPE >
static bool Driver_Mesh::IsMeshTooLarge ( const SMDS_Mesh mesh,
bool  checkIDs 
)
staticinherited

◆ Perform()

◆ SetFile()

◆ SetMesh()

◆ SetMeshId()

◆ SetMeshName()

void Driver_Mesh::SetMeshName ( const std::string &  theMeshName)
virtualinherited

◆ SetOption()

virtual void Driver_Mesh::SetOption ( const std::string &  ,
const std::string &   
)
virtualinherited

Field Documentation

◆ _fn

int DriverStructuredCGNS_Write::_fn
private

file index

Referenced by Perform(), and ~DriverStructuredCGNS_Write().

◆ myErrorMessages

std::vector< std::string > Driver_Mesh::myErrorMessages
protectedinherited

◆ myFile

◆ myMesh

◆ myMeshId

◆ myMeshName

◆ myStatus

Status Driver_Mesh::myStatus
protectedinherited