#include <DriverMED_W_Field.h>
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_Mesh * | myMesh |
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 |
|
inherited |
DriverMED_W_Field::DriverMED_W_Field | ( | ) |
Constructor.
|
protectedinherited |
Stores an error message.
We consider an error fatal if none mesh can be read
References Driver_Mesh::DRS_FAIL, Driver_Mesh::DRS_WARN_SKIP_ELEM, MESSAGE, Driver_Mesh::myErrorMessages, and Driver_Mesh::myStatus.
Referenced by DriverGMF_Read::Perform(), DriverGMF_Write::Perform(), Perform(), PerformInternal(), and DriverGMF_Read::storeBadNodeIds().
void DriverMED_W_Field::AddODOnVertices | ( | bool | toAdd | ) |
Referenced by MEDFileSpeCls::exportField(), and MEDFileMemSpeCls::exportField().
void DriverMED_W_Field::AddValue | ( | double | val | ) |
void DriverMED_W_Field::AddValue | ( | int | val | ) |
Adds an integer field value.
References _intValues.
|
staticprotectedinherited |
Assure a string is UTF-8 valid by replacing invalid chars.
|
virtualinherited |
Return a structure containing description of errors.
References COMPERR_OK, Driver_Mesh::DRS_OK, Driver_Mesh::myErrorMessages, Driver_Mesh::myStatus, and SMESH_ComputeError::New().
Referenced by SMESH_Mesh::ExportCGNS(), SMESH_Mesh_i::exportMEDFields(), SMESH_Mesh::GMFToMesh(), and SMESH_Mesh::MEDToMesh().
|
virtualinherited |
References Driver_Mesh::myMeshName.
Referenced by SMESH_Mesh::CGNSToMesh().
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().
|
staticinherited |
|
overridevirtual |
Writes a field to the file.
Implements Driver_Mesh.
Reimplemented in DriverMED_W_Field_Mem.
References Driver_Mesh::addMessage(), MED::CrWrapperW(), MED::GetMEDVersion(), Driver_Mesh::myFile, and PerformInternal().
Referenced by SMESH_Mesh_i::exportMEDFields().
|
protected |
References _compNames, _dblValues, _dt, _elemType, _fieldName, _intValues, _it, _nbElemsByGeom, Driver_Mesh::addMessage(), Driver_Mesh::DRS_OK, MED::eFLOAT64, MED::eINT, MED::eMAILLE, MED::eNOEUD, DriverMED::GetMedGeoType(), Driver_SMESHDS_Mesh::myMesh, Driver_Mesh::myMeshId, Driver_Mesh::myMeshName, SMDSAbs_Node, and SMDSEntity_0D.
Referenced by Perform(), and DriverMED_W_Field_Mem::Perform().
bool DriverMED_W_Field::Set | ( | SMESHDS_Mesh * | mesh, |
const std::string & | fieldName, | ||
SMDSAbs_ElementType | type, | ||
const int | nbComps, | ||
const bool | isIntData | ||
) |
Sets basic data.
[in] | mesh | - supporting mesh |
[in] | fieldName | - name of a field |
[in] | type | - type of supporting elements |
[in] | nbComps | - number of components |
[in] | isIntData | - type of data: double or integer |
References _addODOnVertices, _compNames, _dblValues, _elemsByGeom, _elemType, _fieldName, _intValues, _nbElemsByGeom, SMDS_Mesh::elementsIterator(), SMDS_MeshCell::ElemType(), SMDS_MeshElement::GetEntityType(), SMDS_Mesh::GetMeshInfo(), DriverMED_W_SMESHDS_Mesh::getNodesOfMissing0DOnVert(), SMESHUtils::Increment(), Driver_SMESHDS_Mesh::myMesh, SMDS_Mesh::NbEdges(), SMDS_MeshInfo::NbElements(), SMDS_Mesh::NbFaces(), SMDS_Mesh::NbVolumes(), Driver_SMESHDS_Mesh::SetMesh(), SMDSAbs_0DElement, SMDSAbs_All, SMDSAbs_Edge, SMDSAbs_Face, SMDSAbs_Node, SMDSAbs_Volume, SMDSEntity_0D, SMDSEntity_Last, and SMDSEntity_Node.
Referenced by SMESH_Mesh_i::exportMEDFields().
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().
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().
|
virtualinherited |
References Driver_Mesh::myFile.
Referenced by SMESH_Mesh::CGNSToMesh(), SMESH_Gen_i::CreateMeshesFromCGNS(), SMESH_Gen_i::CreateMeshesFromMED(), SMESH_Mesh::ExportCGNS(), SMESH_Mesh::ExportDAT(), MEDFileSpeCls::exportField(), SMESH_Mesh::ExportGMF(), SMESH_Mesh::ExportSTL(), SMESH_Mesh::ExportUNV(), SMESH_PreMeshInfo::FullLoadFromFile(), MG_ADAPT::MgAdapt::getCommandToRun(), GetMGLicenseKeyImpl(), SMESH_Mesh::GMFToMesh(), SMESH_Mesh::MEDToMesh(), DriverMED_W_SMESHDS_Mesh::SetFile(), SMESH_Mesh::STLToMesh(), and SMESH_Mesh::UNVToMesh().
|
inherited |
|
inherited |
References Driver_Mesh::myMeshId.
Referenced by SMESH_Mesh::CGNSToMesh(), SMESH_Gen_i::CreateMeshesFromMED(), SMESH_Mesh::ExportDAT(), SMESH_Mesh::exportMEDCommmon(), SMESH_Mesh::ExportSTL(), SMESH_Mesh::ExportUNV(), SMESH_PreMeshInfo::FullLoadFromFile(), SMESH_Mesh::MEDToMesh(), SMESH_Gen_i::Save(), SMESH_Mesh::STLToMesh(), and SMESH_Mesh::UNVToMesh().
|
virtualinherited |
References Driver_Mesh::myMeshName.
Referenced by SMESH_Mesh::ExportCGNS(), MEDFileSpeCls::exportField(), MEDFileMemSpeCls::exportField(), and SMESH_Mesh::exportMEDCommmon().
|
virtualinherited |
|
private |
Referenced by Set().
|
private |
Referenced by PerformInternal(), Set(), and SetCompName().
|
private |
Referenced by AddValue(), PerformInternal(), Set(), and SetDtIt().
|
private |
Referenced by PerformInternal(), and SetDtIt().
|
private |
Referenced by GetOrderedElems(), and Set().
|
private |
Referenced by GetOrderedElems(), PerformInternal(), and Set().
|
private |
Referenced by PerformInternal(), and Set().
|
private |
Referenced by AddValue(), PerformInternal(), Set(), and SetDtIt().
|
private |
Referenced by PerformInternal(), and SetDtIt().
|
private |
Referenced by GetOrderedElems(), PerformInternal(), and Set().
|
protectedinherited |
Referenced by Driver_Mesh::addMessage(), and Driver_Mesh::GetError().
|
protectedinherited |
Referenced by DriverGMF_Read::GetMeshInfo(), DriverGMF_Read::Perform(), DriverGMF_Write::Perform(), DriverSTL_R_SMDS_Mesh::Perform(), Perform(), DriverMED_W_Field_Mem::Perform(), DriverMED_W_SMESHDS_Mesh::Perform(), DriverMED_W_SMESHDS_Mesh_Mem::Perform(), DriverSTL_R_SMDS_Mesh::readAscii(), Driver_Mesh::SetFile(), DriverSTL_W_SMDS_Mesh::writeAscii(), and DriverSTL_W_SMDS_Mesh::writeBinary().
|
protectedinherited |
|
protectedinherited |
Referenced by DriverMED_W_SMESHDS_Mesh::PerformInternal(), PerformInternal(), and Driver_Mesh::SetMeshId().
|
protectedinherited |
|
protectedinherited |
Referenced by Driver_Mesh::addMessage(), Driver_Mesh::GetError(), and DriverGMF_Read::storeBadNodeIds().