return const_cast<DataArrayDouble *>(ret);
}
-void MEDFileFieldPerMeshPerTypePerDisc::fillValues(int discId, int& startTupleId, int& startEntryId, std::vector< std::pair<std::pair<int,int>,std::pair<int,int> > >& entries, double *vals) const
+void MEDFileFieldPerMeshPerTypePerDisc::fillValues(int discId, int& startTupleId, int& startEntryId, std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries, double *vals) const
{
int endTupleId=startTupleId+_arr->getNumberOfTuples();
- entries[startEntryId]=std::pair<std::pair<int,int> ,std::pair<int,int> >(std::pair<int,int>((int)getGeoType(),discId),std::pair<int,int>(startTupleId,endTupleId));
+ entries[startEntryId]=std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int> ,std::pair<int,int> >(std::pair<INTERP_KERNEL::NormalizedCellType,int>(getGeoType(),discId),std::pair<int,int>(startTupleId,endTupleId));
std::copy(_arr->begin(),_arr->end(),vals+startTupleId*_arr->getNumberOfComponents());
startEntryId++;
startTupleId=endTupleId;
return _field_pm_pt_pd[0]->getUndergroundDataArray();
}
-void MEDFileFieldPerMeshPerType::fillValues(int& startTupleId, int& startEntryId, std::vector< std::pair<std::pair<int,int>,std::pair<int,int> > >& entries, double *vals) const
+void MEDFileFieldPerMeshPerType::fillValues(int& startTupleId, int& startEntryId, std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries, double *vals) const
{
int i=0;
for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> >::const_iterator it=_field_pm_pt_pd.begin();it!=_field_pm_pt_pd.end();it++,i++)
return _field_pm_pt[0]->getUndergroundDataArray();
}
-DataArrayDouble *MEDFileFieldPerMesh::getUndergroundDataArrayExt(std::vector< std::pair<std::pair<int,int>,std::pair<int,int> > >& entries) const throw(INTERP_KERNEL::Exception)
+DataArrayDouble *MEDFileFieldPerMesh::getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const throw(INTERP_KERNEL::Exception)
{
int globalSz=0;
int nbOfEntries=0;
* id attached to it. The second pair of pair precise the range [begin,end) into the returned array.
* This method makes the hypothesis that the field lies only on one mesh. If it is not the case an exception will be thrown.
*/
-DataArrayDouble *MEDFileField1TSWithoutDAS::getUndergroundDataArrayExt(std::vector< std::pair<std::pair<int,int>,std::pair<int,int> > >& entries) const throw(INTERP_KERNEL::Exception)
+DataArrayDouble *MEDFileField1TSWithoutDAS::getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const throw(INTERP_KERNEL::Exception)
{
if(_field_per_mesh.size()!=1)
throw INTERP_KERNEL::Exception("MEDFileField1TSWithoutDAS::getUndergroundDataArrayExt : field lies on several meshes, this method has no sense !");
/*!
* See doc at MEDFileField1TSWithoutDAS::getUndergroundDataArrayExt
*/
-DataArrayDouble *MEDFileFieldMultiTSWithoutDAS::getUndergroundDataArrayExt(int iteration, int order, std::vector< std::pair<std::pair<int,int>,std::pair<int,int> > >& entries) const throw(INTERP_KERNEL::Exception)
+DataArrayDouble *MEDFileFieldMultiTSWithoutDAS::getUndergroundDataArrayExt(int iteration, int order, std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const throw(INTERP_KERNEL::Exception)
{
return getTimeStepEntry(iteration,order).getUndergroundDataArrayExt(entries);
}
void getFieldAtLevel(TypeOfField type, const MEDFieldFieldGlobsReal *glob, std::vector<const DataArrayDouble *>& dads, std::vector<const DataArrayInt *>& pfls, std::vector<int>& locs,
std::vector<INTERP_KERNEL::NormalizedCellType>& geoTypes) const;
DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception);
- void fillValues(int discId, int& startTupleId, int& startEntryId, std::vector< std::pair<std::pair<int,int>,std::pair<int,int> > >& entries, double *vals) const;
+ void fillValues(int discId, int& startTupleId, int& startEntryId, std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries, double *vals) const;
static int ConvertType(TypeOfField type, int locId) throw(INTERP_KERNEL::Exception);
private:
MEDFileFieldPerMeshPerTypePerDisc(MEDFileFieldPerMeshPerType *fath, med_idt fid, TypeOfField type, int profileIt) throw(INTERP_KERNEL::Exception);
std::vector<std::string> getLocsReallyUsed() const;
void getFieldAtLevel(int meshDim, TypeOfField type, const MEDFieldFieldGlobsReal *glob, std::vector<const DataArrayDouble *>& dads, std::vector<const DataArrayInt *>& pfls, std::vector<int>& locs, std::vector<INTERP_KERNEL::NormalizedCellType>& geoTypes) const;
DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception);
- void fillValues(int& startTupleId, int& startEntryId, std::vector< std::pair<std::pair<int,int>,std::pair<int,int> > >& entries, double *vals) const;
+ void fillValues(int& startTupleId, int& startEntryId, std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries, double *vals) const;
static med_entity_type ConvertIntoMEDFileType(TypeOfField ikType, INTERP_KERNEL::NormalizedCellType ikGeoType, med_geometry_type& medfGeoType);
private:
std::vector<int> addNewEntryIfNecessary(const MEDCouplingFieldDouble *field, int offset, int nbOfCells) throw(INTERP_KERNEL::Exception);
MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDFieldFieldGlobsReal *glob, const MEDCouplingMesh *mesh, bool& isPfl) const throw(INTERP_KERNEL::Exception);
DataArrayDouble *getFieldOnMeshAtLevelWithPfl(TypeOfField type, const MEDCouplingMesh *mesh, DataArrayInt *&pfl, const MEDFieldFieldGlobsReal *glob) const throw(INTERP_KERNEL::Exception);
DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *getUndergroundDataArrayExt(std::vector< std::pair<std::pair<int,int>,std::pair<int,int> > >& entries) const throw(INTERP_KERNEL::Exception);
+ DataArrayDouble *getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const throw(INTERP_KERNEL::Exception);
private:
int addNewEntryIfNecessary(INTERP_KERNEL::NormalizedCellType type);
MEDCouplingFieldDouble *finishField(TypeOfField type, const MEDFieldFieldGlobsReal *glob,
MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int renumPol, const MEDFieldFieldGlobsReal *glob, const MEDCouplingMesh *mesh, const DataArrayInt *cellRenum, const DataArrayInt *nodeRenum) const throw(INTERP_KERNEL::Exception);
DataArrayDouble *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl, const MEDFieldFieldGlobsReal *glob) const throw(INTERP_KERNEL::Exception);
DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *getUndergroundDataArrayExt(std::vector< std::pair<std::pair<int,int>,std::pair<int,int> > >& entries) const throw(INTERP_KERNEL::Exception);
+ DataArrayDouble *getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const throw(INTERP_KERNEL::Exception);
protected:
int addNewEntryIfNecessary(const MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
int getMeshIdFromMeshName(const char *mName) const throw(INTERP_KERNEL::Exception);
std::string getMeshName() const throw(INTERP_KERNEL::Exception);
const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
DataArrayDouble *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception);
- DataArrayDouble *getUndergroundDataArrayExt(int iteration, int order, std::vector< std::pair<std::pair<int,int>,std::pair<int,int> > >& entries) const throw(INTERP_KERNEL::Exception);
+ DataArrayDouble *getUndergroundDataArrayExt(int iteration, int order, std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const throw(INTERP_KERNEL::Exception);
public:
std::vector<std::string> getPflsReallyUsed2() const;
std::vector<std::string> getLocsReallyUsed2() const;
* - the space dimension
* - the number of nodes
*/
-std::vector< std::vector< std::pair<int,int> > > MEDLoader::GetUMeshGlobalInfo(const char *fileName, const char *meshName, int &meshDim, int& spaceDim, int& numberOfNodes) throw(INTERP_KERNEL::Exception)
+std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > MEDLoader::GetUMeshGlobalInfo(const char *fileName, const char *meshName, int &meshDim, int& spaceDim, int& numberOfNodes) throw(INTERP_KERNEL::Exception)
{
CheckFileForRead(fileName);
MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY);
MEDmeshComputationStepInfo(fid,nommaa,1,&numdt,&numit,&dt);
// endlimitation
std::vector<int> dims;
- std::vector< std::pair<int,int> > geoTypes;
+ std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > geoTypes;
med_bool changement,transformation;
for(int i=0;i<MED_N_CELL_FIXED_GEO;i++)
{
INTERP_KERNEL::NormalizedCellType typp=typmai2[i];
int mdimCell=INTERP_KERNEL::CellModel::GetCellModel(typp).getDimension();
dims.push_back(mdimCell);
- geoTypes.push_back(std::pair<int,int>((int)typp,curNbOfElemM));
+ geoTypes.push_back(std::pair<INTERP_KERNEL::NormalizedCellType,int>(typp,curNbOfElemM));
}
}
int maxLev=*std::max_element(dims.begin(),dims.end());
int lowLev=*std::min_element(dims.begin(),dims.end());
int nbOfLevels=maxLev-lowLev+1;
- std::vector< std::vector< std::pair<int,int> > > ret(nbOfLevels);
+ std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > ret(nbOfLevels);
for(std::size_t i=0;i<dims.size();i++)
{
ret[maxLev-dims[i]].push_back(geoTypes[i]);
static void setTooLongStrPolicy(int val) throw(INTERP_KERNEL::Exception);
static void CheckFileForRead(const char *fileName) throw(INTERP_KERNEL::Exception);
static std::vector<std::string> GetMeshNames(const char *fileName) throw(INTERP_KERNEL::Exception);
- static std::vector< std::vector< std::pair<int,int> > > GetUMeshGlobalInfo(const char *fileName, const char *meshName, int &meshDim, int& spaceDim, int& numberOfNodes) throw(INTERP_KERNEL::Exception);
+ static std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > GetUMeshGlobalInfo(const char *fileName, const char *meshName, int &meshDim, int& spaceDim, int& numberOfNodes) throw(INTERP_KERNEL::Exception);
static std::vector< std::pair<std::string,std::string> > GetComponentsNamesOfField(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception);
static std::vector<std::string> GetMeshNamesOnField(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception);
static std::vector<std::string> GetMeshGroupsNames(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
static PyObject *GetUMeshGlobalInfo(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception)
{
int meshDim,spaceDim,numberOfNodes;
- std::vector< std::vector< std::pair<int,int> > > res=MEDLoader::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
+ std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDLoader::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
PyObject *ret=PyTuple_New(4);
PyObject *elt0=PyList_New(res.size());
int i=0;
- for(std::vector< std::vector< std::pair<int,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
+ for(std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > >::const_iterator it=res.begin();it!=res.end();it++,i++)
{
- const std::vector< std::pair<int,int> >&obj2=(*it);
+ const std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >&obj2=(*it);
int j=0;
PyObject *elt1=PyList_New(obj2.size());
- for(std::vector< std::pair<int,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
+ for(std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++)
{
PyObject *elt2=PyTuple_New(2);
- PyTuple_SetItem(elt2,0,SWIG_From_int((*it2).first));
+ PyTuple_SetItem(elt2,0,SWIG_From_int((int)(*it2).first));
PyTuple_SetItem(elt2,1,SWIG_From_int((*it2).second));
PyList_SetItem(elt1,j,elt2);
}
PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception)
{
- std::vector< std::pair<std::pair<int,int>,std::pair<int,int> > > elt1Cpp;
+ std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
DataArrayDouble *elt0=self->getUndergroundDataArrayExt(elt1Cpp);
PyObject *ret=PyTuple_New(2);
PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
{
PyObject *elt1=PyTuple_New(2);
PyObject *elt2=PyTuple_New(2);
- PyTuple_SetItem(elt2,0,SWIG_From_int(elt1Cpp[i].first.first));
+ PyTuple_SetItem(elt2,0,SWIG_From_int((int)elt1Cpp[i].first.first));
PyTuple_SetItem(elt2,1,SWIG_From_int(elt1Cpp[i].first.second));
PyObject *elt3=PyTuple_New(2);
PyTuple_SetItem(elt3,0,SWIG_From_int(elt1Cpp[i].second.first));
}
PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception)
{
- std::vector< std::pair<std::pair<int,int>,std::pair<int,int> > > elt1Cpp;
+ std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > > elt1Cpp;
DataArrayDouble *elt0=self->getUndergroundDataArrayExt(iteration,order,elt1Cpp);
PyObject *ret=PyTuple_New(2);
PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(elt0),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));