Version: 6.3.1

MEDLoaderNS Namespace Reference

Classes

class  FieldPerTypeCopier
class  ConnReaderML

Functions

std::vector< std::string > getMeshNamesFid (med_idt fid)
void readFieldDoubleDataInMedFile (const char *fileName, const char *meshName, const char *fieldName, int iteration, int order, ParaMEDMEM::TypeOfField typeOfOutField, std::list< MEDLoader::MEDFieldDoublePerCellType > &field, double &time, std::vector< std::string > &infos)
std::vector< int > getIdsFromFamilies (const char *fileName, const char *meshName, const std::vector< std::string > &fams)
std::vector< int > getIdsFromGroups (const char *fileName, const char *meshName, const std::vector< std::string > &grps)
med_int getIdFromMeshName (med_idt fid, const char *meshName, std::string &trueMeshName) throw (INTERP_KERNEL::Exception)
void dispatchElems (int nbOfElemCell, int nbOfElemFace, int &nbOfElem, med_entity_type &whichEntity)
int readUMeshDimFromFile (const char *fileName, const char *meshName, std::vector< int > &possibilities)
void readUMeshDataInMedFile (med_idt fid, med_int meshId, DataArrayDouble *&coords, std::list< MEDLoader::MEDConnOfOneElemType > &conn, std::string &desc)
int buildMEDSubConnectivityOfOneType (const std::vector< const DataArrayInt * > &conn, const std::vector< const DataArrayInt * > &connIndex, const std::vector< const DataArrayInt * > &families, INTERP_KERNEL::NormalizedCellType type, std::vector< int > &conn4MEDFile, std::vector< int > &connIndex4MEDFile, std::vector< int > &connIndexRk24MEDFile, std::vector< int > &fam4MEDFile, std::vector< int > &renumber)
MEDCouplingUMeshreadUMeshFromFileLev1 (const char *fileName, const char *meshName, int meshDimRelToMax, const std::vector< int > &ids, const std::vector< INTERP_KERNEL::NormalizedCellType > &typesToKeep, unsigned &meshDimExtract, int *&cellRenum) throw (INTERP_KERNEL::Exception)
void tradMEDFileCoreFrmt2MEDCouplingUMesh (const std::list< MEDLoader::MEDConnOfOneElemType > &medConnFrmt, const std::vector< int > &familiesToKeep, DataArrayInt *&conn, DataArrayInt *&connIndex, int *&cellRenum)
ParaMEDMEM::DataArrayDoublebuildArrayFromRawData (const std::list< MEDLoader::MEDFieldDoublePerCellType > &fieldPerType, const std::vector< std::string > &infos)
int buildMEDSubConnectivityOfOneTypesPolyg (const std::vector< const DataArrayInt * > &conn, const std::vector< const DataArrayInt * > &connIndex, const std::vector< const DataArrayInt * > &families, std::vector< int > &conn4MEDFile, std::vector< int > &connIndex4MEDFile, std::vector< int > &fam4MEDFile, std::vector< int > &renumber)
int buildMEDSubConnectivityOfOneTypesPolyh (const std::vector< const DataArrayInt * > &conn, const std::vector< const DataArrayInt * > &connIndex, const std::vector< const DataArrayInt * > &families, std::vector< int > &conn4MEDFile, std::vector< int > &connIndex4MEDFile, std::vector< int > &connIndexRk24MEDFile, std::vector< int > &fam4MEDFile, std::vector< int > &renumber)
int buildMEDSubConnectivityOfOneTypeStaticTypes (const std::vector< const DataArrayInt * > &conn, const std::vector< const DataArrayInt * > &connIndex, const std::vector< const DataArrayInt * > &families, INTERP_KERNEL::NormalizedCellType type, std::vector< int > &conn4MEDFile, std::vector< int > &fam4MEDFile, std::vector< int > &renumber)
ParaMEDMEM::MEDCouplingFieldDoublereadFieldDoubleLev1 (const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order, ParaMEDMEM::TypeOfField typeOfOutField) throw (INTERP_KERNEL::Exception)
ParaMEDMEM::MEDCouplingFieldDoublereadFieldDoubleLev2 (const char *fileName, ParaMEDMEM::TypeOfField typeOfOutField, unsigned meshDim, const int *renumCell, const ParaMEDMEM::MEDCouplingUMesh *mesh, const std::vector< std::string > &infos, const char *fieldName, int iteration, int order, double time, std::list< MEDLoader::MEDFieldDoublePerCellType > &fieldPerCellType) throw (INTERP_KERNEL::Exception)
med_idt appendFieldSimpleAtt (const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, med_int &numdt, med_int &numo, med_float &dt)
void appendFieldDirectly (const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f)
void appendNodeProfileField (const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, const int *thisMeshNodeIds)
void appendCellProfileField (const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, const int *thisMeshCellIds)
void prepareCellFieldDoubleForWriting (const ParaMEDMEM::MEDCouplingFieldDouble *f, const int *cellIds, std::list< MEDLoader::MEDFieldDoublePerCellType > &split)
void fillGaussDataOnField (const char *fileName, const std::list< MEDLoader::MEDFieldDoublePerCellType > &data, MEDCouplingFieldDouble *f)
void writeUMeshesDirectly (const char *fileName, const std::vector< const ParaMEDMEM::MEDCouplingUMesh * > &mesh, const std::vector< const DataArrayInt * > &families, bool forceFromScratch, bool &isRenumbering)
void writeUMeshesPartitionDirectly (const char *fileName, const char *meshName, const std::vector< const ParaMEDMEM::MEDCouplingUMesh * > &meshes, bool forceFromScratch)
void writeFieldAndMeshDirectly (const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool forceFromScratch)
void writeFieldTryingToFitExistingMesh (const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f)
template<class T >
unsigned calculateHighestMeshDim (const std::list< T > &conn)
template<class T >
void keepSpecifiedMeshDim (typename std::list< T > &conn, unsigned meshDim)
template<class T >
void keepTypes (typename std::list< T > &conn, const std::vector< INTERP_KERNEL::NormalizedCellType > &typesToKeep)
template<class T >
void releaseMEDFileCoreFrmt (typename std::list< T > &medConnFrmt)

Function Documentation

std::vector< std::string > MEDLoaderNS::getMeshNamesFid ( med_idt  fid)
void MEDLoaderNS::readFieldDoubleDataInMedFile ( const char *  fileName,
const char *  meshName,
const char *  fieldName,
int  iteration,
int  order,
ParaMEDMEM::TypeOfField  typeOfOutField,
std::list< MEDLoader::MEDFieldDoublePerCellType > &  field,
double &  time,
std::vector< std::string > &  infos 
)

This method reads all the content of a field 'fieldName' at a time specified by (iteration,order) lying on a mesh 'meshName' with a specified type 'TypeOfOutField' The returned values are strored in 'field' (sorted by type of cell), time corresponding to field, and 'infos' to load properly little strings. The principle of this method is to put into 'field' only data that fulfills perfectly request.

References ParaMEDMEM::ON_CELLS, ParaMEDMEM::ON_GAUSS_NE, ParaMEDMEM::ON_GAUSS_PT, ParaMEDMEM::ON_NODES, typmai, typmai2, and typmainoeud.

Referenced by readFieldDoubleLev1(), and MEDLoader::ReadFieldsOnSameMesh().

std::vector< int > MEDLoaderNS::getIdsFromFamilies ( const char *  fileName,
const char *  meshName,
const std::vector< std::string > &  fams 
)
std::vector< int > MEDLoaderNS::getIdsFromGroups ( const char *  fileName,
const char *  meshName,
const std::vector< std::string > &  grps 
)
med_int MEDLoaderNS::getIdFromMeshName ( med_idt  fid,
const char *  meshName,
std::string &  trueMeshName 
) throw (INTERP_KERNEL::Exception)
void MEDLoaderNS::dispatchElems ( int  nbOfElemCell,
int  nbOfElemFace,
int &  nbOfElem,
med_entity_type &  whichEntity 
)

This methods allows to merger all entities and to considerate only cell types.

Referenced by readUMeshDataInMedFile(), and readUMeshDimFromFile().

int MEDLoaderNS::readUMeshDimFromFile ( const char *  fileName,
const char *  meshName,
std::vector< int > &  possibilities 
)

This method returns a first quick overview of mesh with name 'meshName' into the file 'fileName'.

Parameters:
possibilitiesthe relativeToMeshDim authorized to returned maxdim. This vector is systematically cleared at the begin of this method.
Returns:
the maximal mesh dimension of specified mesh. If nothing found -1 is returned.

References dispatchElems(), getIdFromMeshName(), typmai, and typmai2.

Referenced by MEDLoader::ReadUMeshDimFromFile(), and writeFieldTryingToFitExistingMesh().

int MEDLoaderNS::buildMEDSubConnectivityOfOneType ( const std::vector< const DataArrayInt * > &  conn,
const std::vector< const DataArrayInt * > &  connIndex,
const std::vector< const DataArrayInt * > &  families,
INTERP_KERNEL::NormalizedCellType  type,
std::vector< int > &  conn4MEDFile,
std::vector< int > &  connIndex4MEDFile,
std::vector< int > &  connIndexRk24MEDFile,
std::vector< int > &  fam4MEDFile,
std::vector< int > &  renumber 
)

This method builds a sub set of connectivity for a given type 'type'.

Parameters:
conninput containing connectivity with MEDCoupling format.
connIndexinput containing connectivity index in MEDCoupling format.
familiesinput containing, if any, the family number of each cells
typeinput specifying which cell types will be extracted in conn4MEDFile.
conn4MEDFileoutput containing the connectivity directly understandable by MEDFile; conn4MEDFile has to be empty before this method called.
connIndex4MEDFileoutput containing index connectivity understandable by MEDFile; only used by polygons and polyhedrons (it is face nodal connec).
connIndexRk24MEDFileoutput containing index of rank 2 understandable by MEDFile; only used by polyhedrons.
fam4MEDFileoutput containing families id of cells whose type is 'type'.
Returns:
nb of elements extracted.

References buildMEDSubConnectivityOfOneTypesPolyg(), buildMEDSubConnectivityOfOneTypesPolyh(), buildMEDSubConnectivityOfOneTypeStaticTypes(), and INTERP_KERNEL::NORM_POLYGON.

Referenced by writeUMeshesDirectly().

MEDCouplingUMesh * MEDLoaderNS::readUMeshFromFileLev1 ( const char *  fileName,
const char *  meshName,
int  meshDimRelToMax,
const std::vector< int > &  ids,
const std::vector< INTERP_KERNEL::NormalizedCellType > &  typesToKeep,
unsigned &  meshDimExtract,
int *&  cellRenum 
) throw (INTERP_KERNEL::Exception)
Parameters:
idsis a in vector containing families ids whose cells have to be kept. If empty all cells are kept.
typesToKeepis a in vector that indicates which types to keep after dimension filtering.
meshDimExtractout parameter that gives the mesh dimension.
cellRenumout parameter that specifies the renumbering (if !=0) of cells in file.

References ParaMEDMEM::RefCountObject::decrRef(), getIdFromMeshName(), readUMeshDataInMedFile(), ParaMEDMEM::MEDCouplingUMesh::setConnectivity(), ParaMEDMEM::MEDCouplingPointSet::setCoords(), ParaMEDMEM::MEDCouplingMesh::setDescription(), ParaMEDMEM::MEDCouplingUMesh::setMeshDimension(), ParaMEDMEM::MEDCouplingMesh::setName(), and tradMEDFileCoreFrmt2MEDCouplingUMesh().

Referenced by readFieldDoubleLev1(), MEDLoader::ReadFieldsOnSameMesh(), MEDLoader::ReadUMeshFromFamilies(), MEDLoader::ReadUMeshFromFile(), and MEDLoader::ReadUMeshFromGroups().

void MEDLoaderNS::tradMEDFileCoreFrmt2MEDCouplingUMesh ( const std::list< MEDLoader::MEDConnOfOneElemType > &  medConnFrmt,
const std::vector< int > &  familiesToKeep,
DataArrayInt *&  conn,
DataArrayInt *&  connIndex,
int *&  cellRenum 
)

This method fills unstructured connectivity using basic MED file format 'medConnFrmt'. If in each elements of 'medConnFrmt' a renumbering cell array is found the aggregate array 'cellRenum' is returned.

References ParaMEDMEM::DataArrayInt::alloc(), ParaMEDMEM::DataArrayInt::getPointer(), and PolyCounterForFams::getSigma().

Referenced by readUMeshFromFileLev1().

ParaMEDMEM::DataArrayDouble * MEDLoaderNS::buildArrayFromRawData ( const std::list< MEDLoader::MEDFieldDoublePerCellType > &  fieldPerType,
const std::vector< std::string > &  infos 
)
int MEDLoaderNS::buildMEDSubConnectivityOfOneTypesPolyg ( const std::vector< const DataArrayInt * > &  conn,
const std::vector< const DataArrayInt * > &  connIndex,
const std::vector< const DataArrayInt * > &  families,
std::vector< int > &  conn4MEDFile,
std::vector< int > &  connIndex4MEDFile,
std::vector< int > &  fam4MEDFile,
std::vector< int > &  renumber 
)
int MEDLoaderNS::buildMEDSubConnectivityOfOneTypesPolyh ( const std::vector< const DataArrayInt * > &  conn,
const std::vector< const DataArrayInt * > &  connIndex,
const std::vector< const DataArrayInt * > &  families,
std::vector< int > &  conn4MEDFile,
std::vector< int > &  connIndex4MEDFile,
std::vector< int > &  connIndexRk24MEDFile,
std::vector< int > &  fam4MEDFile,
std::vector< int > &  renumber 
)
int MEDLoaderNS::buildMEDSubConnectivityOfOneTypeStaticTypes ( const std::vector< const DataArrayInt * > &  connV,
const std::vector< const DataArrayInt * > &  connVIndex,
const std::vector< const DataArrayInt * > &  familiesV,
INTERP_KERNEL::NormalizedCellType  type,
std::vector< int > &  conn4MEDFile,
std::vector< int > &  fam4MEDFile,
std::vector< int > &  renumber 
)

This method builds a sub set of connectivity for a given type 'type'. WARNING connV,connVIndex and familiesV must have same size !

Parameters:
connVinput containing connectivity with MEDCoupling format.
connVIndexinput containing connectivity index in MEDCoupling format.
familiesVinput that may be equal to 0. This specifies an array specifying cell family foreach cell.
typeinput specifying which cell types will be extracted in conn4MEDFile.
conn4MEDFileoutput containing the connectivity directly understandable by MEDFile; conn4MEDFile has to be empty before this method called.
connIndex4MEDFileoutput containing index connectivity understandable by MEDFile; only used by polygons and polyhedrons (it is face nodal connec).
connIndexRk24MEDFileoutput containing index of rank 2 understandable by MEDFile; only used by polyhedrons.
fam4MEDFileoutput containing family number of cells whose type is 'type'. This output is updated only if 'families' is different than 0.
Returns:
nb of elements extracted.

References ParaMEDMEM::DataArrayInt::getConstPointer(), and ParaMEDMEM::DataArray::getNbOfElems().

Referenced by buildMEDSubConnectivityOfOneType().

ParaMEDMEM::MEDCouplingFieldDouble * MEDLoaderNS::readFieldDoubleLev1 ( const char *  fileName,
const char *  meshName,
int  meshDimRelToMax,
const char *  fieldName,
int  iteration,
int  order,
ParaMEDMEM::TypeOfField  typeOfOutField 
) throw (INTERP_KERNEL::Exception)
ParaMEDMEM::MEDCouplingFieldDouble * MEDLoaderNS::readFieldDoubleLev2 ( const char *  fileName,
ParaMEDMEM::TypeOfField  typeOfOutField,
unsigned  meshDim,
const int *  renumCell,
const ParaMEDMEM::MEDCouplingUMesh mesh,
const std::vector< std::string > &  infos,
const char *  fieldName,
int  iteration,
int  order,
double  time,
std::list< MEDLoader::MEDFieldDoublePerCellType > &  fieldPerCellType 
) throw (INTERP_KERNEL::Exception)
void MEDLoaderNS::appendNodeProfileField ( const char *  fileName,
const ParaMEDMEM::MEDCouplingFieldDouble f,
const int *  thisMeshNodeIds 
)

This method makes the assumption that f->getMesh() nodes are fully included in already written mesh in 'fileName'.

Parameters:
thisMeshNodeIdspoints to a tab of size f->getMesh()->getNumberOfNodes() that says for a node i in f->getMesh() that its id is thisMeshNodeIds[i] is already written mesh.

References MEDLoader::_TOO_LONG_STR, appendFieldSimpleAtt(), ParaMEDMEM::MEDCouplingFieldDouble::getArray(), ParaMEDMEM::DataArrayDouble::getConstPointer(), ParaMEDMEM::MEDCouplingField::getMesh(), ParaMEDMEM::MEDCouplingField::getName(), ParaMEDMEM::MEDCouplingMesh::getName(), and ParaMEDMEM::MEDCouplingMesh::getNumberOfNodes().

Referenced by writeFieldTryingToFitExistingMesh().

void MEDLoaderNS::appendCellProfileField ( const char *  fileName,
const ParaMEDMEM::MEDCouplingFieldDouble f,
const int *  thisMeshCellIdsPerType 
)

This method makes the assumption that f->getMesh() cells are fully included in already written mesh in 'fileName'.

Parameters:
thisMeshCellIdsPerTypepoints to a tab of size f->getMesh()->getNumberOfCells() that says for a cell i in f->getMesh() that its id is thisMeshCellIds[i] of corresponding type is already written mesh.

References MEDLoader::_TOO_LONG_STR, appendFieldSimpleAtt(), ParaMEDMEM::MEDCouplingFieldDouble::getArray(), ParaMEDMEM::DataArrayDouble::getConstPointer(), ParaMEDMEM::MEDCouplingField::getMesh(), ParaMEDMEM::MEDCouplingField::getName(), ParaMEDMEM::MEDCouplingMesh::getName(), ParaMEDMEM::MEDCouplingFieldDouble::getNumberOfComponents(), prepareCellFieldDoubleForWriting(), and typmai3.

Referenced by writeFieldTryingToFitExistingMesh().

void MEDLoaderNS::prepareCellFieldDoubleForWriting ( const ParaMEDMEM::MEDCouplingFieldDouble f,
const int *  cellIdsPerType,
std::list< MEDLoader::MEDFieldDoublePerCellType > &  split 
)
void MEDLoaderNS::fillGaussDataOnField ( const char *  fileName,
const std::list< MEDLoader::MEDFieldDoublePerCellType > &  data,
MEDCouplingFieldDouble f 
)
void MEDLoaderNS::writeUMeshesDirectly ( const char *  fileName,
const std::vector< const ParaMEDMEM::MEDCouplingUMesh * > &  mesh,
const std::vector< const DataArrayInt * > &  families,
bool  forceFromScratch,
bool &  isRenumbering 
)
Parameters:
familiesinput parameter that specifies the field on int on each cells of 'mesh'.
isRenumberingoutput parameter that specifies if a renumbering of mesh has been needed.

References MEDLoader::_TOO_LONG_STR, buildMEDSubConnectivityOfOneType(), ParaMEDMEM::DataArray::getInfoOnComponent(), ParaMEDMEM::DataArrayDouble::getPointer(), typmai, and typmai2.

Referenced by writeFieldAndMeshDirectly(), MEDLoader::WriteUMesh(), MEDLoader::WriteUMeshDep(), MEDLoader::WriteUMeshes(), and writeUMeshesPartitionDirectly().

void MEDLoaderNS::writeUMeshesPartitionDirectly ( const char *  fileName,
const char *  meshName,
const std::vector< const ParaMEDMEM::MEDCouplingUMesh * > &  meshes,
bool  forceFromScratch 
)

In this method meshes are assumed to shared the same coords. This method makes the assumption that 'meshes' is not empty, no check on that is done (responsability of the caller)

References MEDLoader::_TOO_LONG_STR, ParaMEDMEM::MEDCouplingUMesh::FuseUMeshesOnSameCoords(), and writeUMeshesDirectly().

Referenced by MEDLoader::WriteUMeshesPartition(), and MEDLoader::WriteUMeshesPartitionDep().

void MEDLoaderNS::writeFieldTryingToFitExistingMesh ( const char *  fileName,
const ParaMEDMEM::MEDCouplingFieldDouble f 
)

When called this method expectes that file 'fileName' is already existing and has a mesh with name equal to f->getMesh()->getName(). If not the behaviour of this method is not warranted. This method reads the corresponding mesh into the file and try to fit it with f->getMesh(). If it appears that f->getMesh() equals exactly mesh into the file

References MEDLoader::_COMP_FOR_CELL, MEDLoader::_EPS_FOR_NODE_COMP, appendCellProfileField(), appendNodeProfileField(), ParaMEDMEM::MEDCouplingField::getMesh(), ParaMEDMEM::MEDCouplingMesh::getMeshDimension(), ParaMEDMEM::MEDCouplingMesh::getName(), ParaMEDMEM::MEDCouplingField::getTypeOfField(), ParaMEDMEM::MEDCouplingUMesh::mergeNodes(), ParaMEDMEM::ON_CELLS, ParaMEDMEM::ON_NODES, readUMeshDimFromFile(), and MEDLoader::ReadUMeshFromFile().

Referenced by MEDLoader::WriteField().

template<class T >
unsigned MEDLoaderNS::calculateHighestMeshDim ( const std::list< T > &  conn)
template<class T >
void MEDLoaderNS::keepSpecifiedMeshDim ( typename std::list< T > &  conn,
unsigned  meshDim 
)
template<class T >
void MEDLoaderNS::keepTypes ( typename std::list< T > &  conn,
const std::vector< INTERP_KERNEL::NormalizedCellType > &  typesToKeep 
)
template<class T >
void MEDLoaderNS::releaseMEDFileCoreFrmt ( typename std::list< T > &  medConnFrmt)
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS