Version: 9.12.0
DriverMED_W_SMESHDS_Mesh_Mem Class Reference

Write a mesh to a MEDCoupling DS. More...

#include <DriverMED_W_SMESHDS_Mesh.h>

Inheritance diagram for DriverMED_W_SMESHDS_Mesh_Mem:

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

Status Perform () override
 Write my mesh to a MEDCoupling DS. More...
 
MEDCoupling::MCAuto< MEDCoupling::DataArrayByte > getData ()
 
void SetFile (const std::string &theFileName, int theVersion=-1)
 Set a file name and a version. More...
 
virtual void SetFile (const std::string &theFileName)
 
void SetAutoDimension (bool toFindOutDimension)
 
void SetZTolerance (double tol)
 
void SetSaveNumbers (bool toSave)
 
void AddGroupOfNodes ()
 
void AddGroupOfEdges ()
 
void AddGroupOfFaces ()
 
void AddGroupOfVolumes ()
 
void AddGroupOf0DElems ()
 
void AddGroupOfBalls ()
 
void AddGroup (SMESHDS_GroupBase *theGroup)
 functions to prepare adding one mesh More...
 
void AddAllSubMeshes ()
 
void AddSubMesh (SMESHDS_SubMesh *theSubMesh, int theID)
 
void AddODOnVertices (bool toAdd)
 
template<class LowLevelWriter >
Driver_Mesh::Status PerformInternal (LowLevelWriter myMed)
 Write my mesh. More...
 
void SetMesh (SMESHDS_Mesh *theMesh)
 
void SetMeshId (int theMeshId)
 
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

static std::string GetVersionString (int theMinor, int theNbDigits=2)
 MED version is either the latest available, or with an inferior minor, to ensure backward compatibility on writing med files. More...
 
static bool getNodesOfMissing0DOnVert (SMESHDS_Mesh *mesh, std::vector< const SMDS_MeshElement * > &nodes)
 Returns nodes on VERTEXes where 0D elements are absent. More...
 
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 Attributes

MEDCoupling::MCAuto< MEDCoupling::DataArrayByte > _data
 
std::list< SMESHDS_GroupBase * > myGroups
 
bool myAllSubMeshes
 
std::vector< SMESHDS_SubMesh * > mySubMeshes
 
bool myDoGroupOfNodes
 
bool myDoGroupOfEdges
 
bool myDoGroupOfFaces
 
bool myDoGroupOfVolumes
 
bool myDoGroupOf0DElems
 
bool myDoGroupOfBalls
 
bool myAutoDimension
 
bool myAddODOnVertices
 
bool myDoAllInGroups
 
int myVersion
 
double myZTolerance
 
bool mySaveNumbers
 

Detailed Description

Write a mesh to a MEDCoupling DS.

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 

Member Function Documentation

◆ AddAllSubMeshes()

void DriverMED_W_SMESHDS_Mesh::AddAllSubMeshes ( )
inherited

◆ AddGroup()

void DriverMED_W_SMESHDS_Mesh::AddGroup ( SMESHDS_GroupBase theGroup)
inherited

functions to prepare adding one mesh

References DriverMED_W_SMESHDS_Mesh::myGroups.

Referenced by SMESH_Mesh::exportMEDCommmon(), and SMESH_Gen_i::Save().

◆ AddGroupOf0DElems()

void DriverMED_W_SMESHDS_Mesh::AddGroupOf0DElems ( )
inherited

◆ AddGroupOfBalls()

void DriverMED_W_SMESHDS_Mesh::AddGroupOfBalls ( )
inherited

◆ AddGroupOfEdges()

void DriverMED_W_SMESHDS_Mesh::AddGroupOfEdges ( )
inherited

◆ AddGroupOfFaces()

void DriverMED_W_SMESHDS_Mesh::AddGroupOfFaces ( )
inherited

◆ AddGroupOfNodes()

void DriverMED_W_SMESHDS_Mesh::AddGroupOfNodes ( )
inherited

◆ AddGroupOfVolumes()

void DriverMED_W_SMESHDS_Mesh::AddGroupOfVolumes ( )
inherited

◆ addMessage()

Driver_Mesh::Status Driver_Mesh::addMessage ( const std::string &  msg,
const bool  isFatal = false 
)
protectedinherited

◆ AddODOnVertices()

void DriverMED_W_SMESHDS_Mesh::AddODOnVertices ( bool  toAdd)
inherited

◆ AddSubMesh()

void DriverMED_W_SMESHDS_Mesh::AddSubMesh ( SMESHDS_SubMesh theSubMesh,
int  theID 
)
inherited

◆ fixUTF8()

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

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

◆ getData()

MEDCoupling::MCAuto<MEDCoupling::DataArrayByte> DriverMED_W_SMESHDS_Mesh_Mem::getData ( )

◆ GetError()

◆ GetMeshName()

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

◆ getNodesOfMissing0DOnVert()

bool DriverMED_W_SMESHDS_Mesh::getNodesOfMissing0DOnVert ( SMESHDS_Mesh mesh,
std::vector< const SMDS_MeshElement * > &  nodes 
)
staticinherited

◆ GetVersionString()

string DriverMED_W_SMESHDS_Mesh::GetVersionString ( int  theMinor,
int  theNbDigits = 2 
)
staticinherited

MED version is either the latest available, or with an inferior minor, to ensure backward compatibility on writing med files.

Referenced by SMESH_Mesh_i::GetVersionString().

◆ IsMeshTooLarge()

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

◆ Perform()

Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh_Mem::Perform ( )
overridevirtual

Write my mesh to a MEDCoupling DS.

Reimplemented from DriverMED_W_SMESHDS_Mesh.

References _data, MED::CrWrapperW(), Driver_Mesh::DRS_OK, EXCEPTION, and Driver_Mesh::myFile.

◆ PerformInternal()

template<class LowLevelWriter >
Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::PerformInternal ( LowLevelWriter  myMed)
inherited

Write my mesh.

References MED::aXGetCoord, MED::aXYGetCoord, MED::aXYZGetCoord, MED::aXZGetCoord, MED::aYGetCoord, MED::aYZGetCoord, MED::aZGetCoord, SMDS_Mesh::DownCast(), Driver_Mesh::DRS_OK, Driver_Mesh::DRS_TOO_LARGE_MESH, MED::eARETE, MED::eBALL, MED::eCART, Edge, MED::eFACE, MED::eFAUX, MED::eFULL_INTERLACE, MED::eHEXA20, MED::eHEXA27, MED::eHEXA8, SMDS_Mesh::elementEntityIterator(), SMDS_Mesh::elementGeomIterator(), SMDS_Mesh::elementsIterator(), MED::eMAILLE, MED::eNOD, MED::eNOEUD_ELEMENT, MED::eOCTA12, MED::ePENTA15, MED::ePENTA18, MED::ePENTA6, MED::ePOINT1, MED::ePOLYEDRE, MED::ePOLYGON2, MED::ePOLYGONE, MED::ePYRA13, MED::ePYRA5, MED::eQUAD4, MED::eQUAD8, MED::eQUAD9, MED::eSEG2, MED::eSEG3, MED::eSTRUCT_ELEMENT, MED::eTETRA10, MED::eTETRA4, MED::eTRIA3, MED::eTRIA6, MED::eTRIA7, MED::eVRAI, Face, SMDS_MeshElement::GetID(), SMDS_Mesh::GetMeshInfo(), MED::GetNbNodes(), SMDS_MeshNode::GetNode(), SMDS_MeshElement::GetNode(), DriverMED_W_SMESHDS_Mesh::getNodesOfMissing0DOnVert(), SMDS_MeshElement::IsPoly(), DriverMED_Family::MakeFamilies(), SMDS_Mesh::MaxElementID(), DriverMED_W_SMESHDS_Mesh::myAddODOnVertices, DriverMED_W_SMESHDS_Mesh::myAllSubMeshes, DriverMED_W_SMESHDS_Mesh::myAutoDimension, DriverMED_W_SMESHDS_Mesh::myDoAllInGroups, DriverMED_W_SMESHDS_Mesh::myDoGroupOf0DElems, DriverMED_W_SMESHDS_Mesh::myDoGroupOfBalls, DriverMED_W_SMESHDS_Mesh::myDoGroupOfEdges, DriverMED_W_SMESHDS_Mesh::myDoGroupOfFaces, DriverMED_W_SMESHDS_Mesh::myDoGroupOfNodes, DriverMED_W_SMESHDS_Mesh::myDoGroupOfVolumes, DriverMED_W_SMESHDS_Mesh::myGroups, Driver_SMESHDS_Mesh::myMesh, Driver_Mesh::myMeshId, Driver_Mesh::myMeshName, DriverMED_W_SMESHDS_Mesh::mySaveNumbers, DriverMED_W_SMESHDS_Mesh::mySubMeshes, DriverMED_W_SMESHDS_Mesh::myZTolerance, SMDS_Mesh::Nb0DElements(), SMDS_MeshInfo::Nb0DElements(), SMDS_Mesh::NbBalls(), SMDS_MeshInfo::NbBalls(), SMDS_MeshInfo::NbBiQuadPrisms(), SMDS_MeshInfo::NbBiQuadQuadrangles(), SMDS_MeshInfo::NbBiQuadTriangles(), SMDS_Mesh::NbEdges(), SMDS_MeshInfo::NbEdges(), SMDS_MeshVolume::NbFaceNodes(), SMDS_Mesh::NbFaces(), SMDS_MeshVolume::NbFaces(), SMDS_MeshElement::NbFaces(), SMDS_MeshInfo::NbHexas(), SMDS_MeshInfo::NbHexPrisms(), SMDS_Mesh::NbNodes(), SMDS_MeshElement::NbNodes(), SMDS_MeshInfo::NbPolygons(), SMDS_MeshInfo::NbPolyhedrons(), SMDS_MeshInfo::NbPrisms(), SMDS_MeshInfo::NbPyramids(), SMDS_MeshInfo::NbQuadPrisms(), SMDS_MeshInfo::NbQuadrangles(), SMDS_MeshInfo::NbTetras(), SMDS_MeshInfo::NbTriangles(), SMDS_MeshInfo::NbTriQuadHexas(), SMDS_Mesh::NbVolumes(), NIG_0DELEM_FAMILY, NIG_BALL_FAMILY, NIG_EDGES_FAMILY, NIG_FACES_FAMILY, NIG_VOLS_FAMILY, SMDS_Mesh::nodesIterator(), SMDS_MeshElement::nodesIterator(), ORDER_LINEAR, ORDER_QUADRATIC, REST_0DELEM_FAMILY, REST_BALL_FAMILY, REST_EDGES_FAMILY, REST_FACES_FAMILY, REST_NODES_FAMILY, REST_VOLUMES_FAMILY, SMESHDS_Mesh::ShapeToMesh(), SMDSAbs_0DElement, SMDSAbs_Ball, SMDSAbs_Edge, SMDSAbs_Face, SMDSAbs_NbElementTypes, SMDSAbs_Node, SMDSAbs_Volume, SMDSEntity_Polygon, SMDSEntity_Quad_Polygon, SMDSGeom_POLYHEDRA, SMESHDS_Mesh::SubMeshes(), SMESHDS_Mesh::SubMeshIndices(), SMDS_MeshNode::X(), SMDS_MeshNode::Y(), and SMDS_MeshNode::Z().

◆ SetAutoDimension()

void DriverMED_W_SMESHDS_Mesh::SetAutoDimension ( bool  toFindOutDimension)
inherited

◆ SetFile() [1/2]

◆ SetFile() [2/2]

void DriverMED_W_SMESHDS_Mesh::SetFile ( const std::string &  theFileName,
int  theVersion = -1 
)
inherited

Set a file name and a version.

Parameters
[in]theFileName- output file name
[in]theVersion- desired MED file version == major * 10 + minor

References DriverMED_W_SMESHDS_Mesh::myVersion, and Driver_Mesh::SetFile().

Referenced by SMESH_Mesh::ExportMED(), and SMESH_Gen_i::Save().

◆ 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

◆ SetSaveNumbers()

void DriverMED_W_SMESHDS_Mesh::SetSaveNumbers ( bool  toSave)
inherited

◆ SetZTolerance()

void DriverMED_W_SMESHDS_Mesh::SetZTolerance ( double  tol)
inherited

Field Documentation

◆ _data

MEDCoupling::MCAuto<MEDCoupling::DataArrayByte> DriverMED_W_SMESHDS_Mesh_Mem::_data
private

Referenced by Perform().

◆ myAddODOnVertices

bool DriverMED_W_SMESHDS_Mesh::myAddODOnVertices
privateinherited

◆ myAllSubMeshes

bool DriverMED_W_SMESHDS_Mesh::myAllSubMeshes
privateinherited

◆ myAutoDimension

bool DriverMED_W_SMESHDS_Mesh::myAutoDimension
privateinherited

◆ myDoAllInGroups

bool DriverMED_W_SMESHDS_Mesh::myDoAllInGroups
privateinherited

◆ myDoGroupOf0DElems

bool DriverMED_W_SMESHDS_Mesh::myDoGroupOf0DElems
privateinherited

◆ myDoGroupOfBalls

bool DriverMED_W_SMESHDS_Mesh::myDoGroupOfBalls
privateinherited

◆ myDoGroupOfEdges

bool DriverMED_W_SMESHDS_Mesh::myDoGroupOfEdges
privateinherited

◆ myDoGroupOfFaces

bool DriverMED_W_SMESHDS_Mesh::myDoGroupOfFaces
privateinherited

◆ myDoGroupOfNodes

bool DriverMED_W_SMESHDS_Mesh::myDoGroupOfNodes
privateinherited

◆ myDoGroupOfVolumes

bool DriverMED_W_SMESHDS_Mesh::myDoGroupOfVolumes
privateinherited

◆ myErrorMessages

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

◆ myFile

◆ myGroups

std::list<SMESHDS_GroupBase*> DriverMED_W_SMESHDS_Mesh::myGroups
privateinherited

◆ myMesh

◆ myMeshId

int Driver_Mesh::myMeshId
protectedinherited

◆ myMeshName

◆ mySaveNumbers

bool DriverMED_W_SMESHDS_Mesh::mySaveNumbers
privateinherited

◆ myStatus

Status Driver_Mesh::myStatus
protectedinherited

◆ mySubMeshes

std::vector<SMESHDS_SubMesh*> DriverMED_W_SMESHDS_Mesh::mySubMeshes
privateinherited

◆ myVersion

int DriverMED_W_SMESHDS_Mesh::myVersion
privateinherited

◆ myZTolerance

double DriverMED_W_SMESHDS_Mesh::myZTolerance
privateinherited