Version: 9.12.0
DriverMED_W_Field Class Reference

#include <DriverMED_W_Field.h>

Inheritance diagram for DriverMED_W_Field:

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

 DriverMED_W_Field ()
 Constructor. More...
 
void AddODOnVertices (bool toAdd)
 
bool Set (SMESHDS_Mesh *mesh, const std::string &fieldName, SMDSAbs_ElementType type, const int nbComps, const bool isIntData)
 Sets basic data. More...
 
void SetCompName (const int iComp, const char *name)
 Set a name of a component countered from zero. More...
 
void SetDtIt (const int dt, const int it)
 Sets numdt and numit field features. More...
 
void AddValue (double val)
 Adds a float field value. More...
 
void AddValue (int val)
 Adds an integer field value. More...
 
SMDS_ElemIteratorPtr GetOrderedElems ()
 Returns elements in the order they are written in MED file. More...
 
Status Perform () override
 Writes a field to the file. 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 PerformInternal (MED::PWrapper &medFile)
 
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

std::string _fieldName
 
SMDSAbs_ElementType _elemType
 
std::vector< std::string > _compNames
 
std::vector< double > _dblValues
 
std::vector< int > _intValues
 
int _dt
 
int _it
 
bool _addODOnVertices
 
std::vector< const SMDS_MeshElement * > _elemsByGeom [SMDSEntity_Last]
 
std::vector< std::pair< SMDSAbs_EntityType, int > > _nbElemsByGeom
 

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

◆ DriverMED_W_Field()

DriverMED_W_Field::DriverMED_W_Field ( )

Constructor.

Member Function Documentation

◆ addMessage()

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

◆ AddODOnVertices()

void DriverMED_W_Field::AddODOnVertices ( bool  toAdd)

◆ AddValue() [1/2]

void DriverMED_W_Field::AddValue ( double  val)

Adds a float field value.

References _dblValues.

Referenced by SMESH_Mesh_i::exportMEDFields().

◆ AddValue() [2/2]

void DriverMED_W_Field::AddValue ( int  val)

Adds an integer field value.

References _intValues.

◆ fixUTF8()

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

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

◆ GetError()

◆ GetMeshName()

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

◆ GetOrderedElems()

SMDS_ElemIteratorPtr DriverMED_W_Field::GetOrderedElems ( )

Returns elements in the order they are written in MED file.

References _elemsByGeom, _elemType, _nbElemsByGeom, begin(), SMDS_Mesh::elementsIterator(), end(), and Driver_SMESHDS_Mesh::myMesh.

Referenced by SMESH_Mesh_i::exportMEDFields().

◆ IsMeshTooLarge()

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

◆ Perform()

Driver_Mesh::Status DriverMED_W_Field::Perform ( )
overridevirtual

◆ PerformInternal()

◆ Set()

bool DriverMED_W_Field::Set ( SMESHDS_Mesh mesh,
const std::string &  fieldName,
SMDSAbs_ElementType  type,
const int  nbComps,
const bool  isIntData 
)

◆ SetCompName()

void DriverMED_W_Field::SetCompName ( const int  iComp,
const char *  name 
)

Set a name of a component countered from zero.

References _compNames.

Referenced by SMESH_Mesh_i::exportMEDFields().

◆ SetDtIt()

void DriverMED_W_Field::SetDtIt ( const int  dt,
const int  it 
)

Sets numdt and numit field features.

Call this fun before AddValue()!

References _dblValues, _dt, _intValues, and _it.

Referenced by SMESH_Mesh_i::exportMEDFields().

◆ 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

◆ _addODOnVertices

bool DriverMED_W_Field::_addODOnVertices
private

Referenced by Set().

◆ _compNames

std::vector< std::string > DriverMED_W_Field::_compNames
private

Referenced by PerformInternal(), Set(), and SetCompName().

◆ _dblValues

std::vector< double > DriverMED_W_Field::_dblValues
private

◆ _dt

int DriverMED_W_Field::_dt
private

Referenced by PerformInternal(), and SetDtIt().

◆ _elemsByGeom

std::vector< const SMDS_MeshElement* > DriverMED_W_Field::_elemsByGeom[SMDSEntity_Last]
private

Referenced by GetOrderedElems(), and Set().

◆ _elemType

SMDSAbs_ElementType DriverMED_W_Field::_elemType
private

◆ _fieldName

std::string DriverMED_W_Field::_fieldName
private

Referenced by PerformInternal(), and Set().

◆ _intValues

std::vector< int > DriverMED_W_Field::_intValues
private

◆ _it

int DriverMED_W_Field::_it
private

Referenced by PerformInternal(), and SetDtIt().

◆ _nbElemsByGeom

std::vector< std::pair< SMDSAbs_EntityType, int > > DriverMED_W_Field::_nbElemsByGeom
private

◆ myErrorMessages

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

◆ myFile

◆ myMesh

◆ myMeshId

int Driver_Mesh::myMeshId
protectedinherited

◆ myMeshName

std::string Driver_Mesh::myMeshName
protectedinherited

◆ myStatus

Status Driver_Mesh::myStatus
protectedinherited