Version: 9.12.0
DriverMED_W_Field_Mem Class Reference

#include <DriverMED_W_Field.h>

Inheritance diagram for DriverMED_W_Field_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

 DriverMED_W_Field_Mem (MEDCoupling::MCAuto< MEDCoupling::DataArrayByte > data)
 
Status Perform () override
 Writes a field to a chunck of memory. More...
 
MEDCoupling::MCAuto< MEDCoupling::DataArrayByte > getData () const
 
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...
 
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

MEDCoupling::MCAuto< MEDCoupling::DataArrayByte > _data
 
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_Mem()

DriverMED_W_Field_Mem::DriverMED_W_Field_Mem ( MEDCoupling::MCAuto< MEDCoupling::DataArrayByte >  data)

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)
inherited

◆ AddValue() [1/2]

void DriverMED_W_Field::AddValue ( double  val)
inherited

Adds a float field value.

References DriverMED_W_Field::_dblValues.

Referenced by SMESH_Mesh_i::exportMEDFields().

◆ AddValue() [2/2]

void DriverMED_W_Field::AddValue ( int  val)
inherited

Adds an integer field value.

References DriverMED_W_Field::_intValues.

◆ 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_Field_Mem::getData ( ) const

◆ GetError()

◆ GetMeshName()

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

◆ GetOrderedElems()

SMDS_ElemIteratorPtr DriverMED_W_Field::GetOrderedElems ( )
inherited

◆ IsMeshTooLarge()

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

◆ Perform()

Driver_Mesh::Status DriverMED_W_Field_Mem::Perform ( )
overridevirtual

Writes a field to a chunck of memory.

Reimplemented from DriverMED_W_Field.

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

◆ PerformInternal()

◆ Set()

◆ SetCompName()

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

Set a name of a component countered from zero.

References DriverMED_W_Field::_compNames.

Referenced by SMESH_Mesh_i::exportMEDFields().

◆ SetDtIt()

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

Sets numdt and numit field features.

Call this fun before AddValue()!

References DriverMED_W_Field::_dblValues, DriverMED_W_Field::_dt, DriverMED_W_Field::_intValues, and DriverMED_W_Field::_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
privateinherited

Referenced by DriverMED_W_Field::Set().

◆ _compNames

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

◆ _data

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

Referenced by Perform().

◆ _dblValues

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

◆ _dt

int DriverMED_W_Field::_dt
privateinherited

◆ _elemsByGeom

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

◆ _elemType

◆ _fieldName

std::string DriverMED_W_Field::_fieldName
privateinherited

◆ _intValues

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

◆ _it

int DriverMED_W_Field::_it
privateinherited

◆ _nbElemsByGeom

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

◆ myErrorMessages

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

◆ myFile

◆ myMesh

◆ myMeshId

int Driver_Mesh::myMeshId
protectedinherited

◆ myMeshName

◆ myStatus

Status Driver_Mesh::myStatus
protectedinherited