From: ageay Date: Thu, 16 Feb 2012 15:03:37 +0000 (+0000) Subject: int->NormalizedCellType. X-Git-Tag: V6_main_FINAL~851 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c58101312e4d715bb1e7012a7fd889c1120d4e0f;p=tools%2Fmedcoupling.git int->NormalizedCellType. --- diff --git a/src/MEDLoader/MEDFileField.cxx b/src/MEDLoader/MEDFileField.cxx index 797b97394..773be4fec 100644 --- a/src/MEDLoader/MEDFileField.cxx +++ b/src/MEDLoader/MEDFileField.cxx @@ -451,10 +451,10 @@ DataArrayDouble *MEDFileFieldPerMeshPerTypePerDisc::getUndergroundDataArray() co return const_cast(ret); } -void MEDFileFieldPerMeshPerTypePerDisc::fillValues(int discId, int& startTupleId, int& startEntryId, std::vector< std::pair,std::pair > >& entries, double *vals) const +void MEDFileFieldPerMeshPerTypePerDisc::fillValues(int discId, int& startTupleId, int& startEntryId, std::vector< std::pair,std::pair > >& entries, double *vals) const { int endTupleId=startTupleId+_arr->getNumberOfTuples(); - entries[startEntryId]=std::pair ,std::pair >(std::pair((int)getGeoType(),discId),std::pair(startTupleId,endTupleId)); + entries[startEntryId]=std::pair ,std::pair >(std::pair(getGeoType(),discId),std::pair(startTupleId,endTupleId)); std::copy(_arr->begin(),_arr->end(),vals+startTupleId*_arr->getNumberOfComponents()); startEntryId++; startTupleId=endTupleId; @@ -817,7 +817,7 @@ DataArrayDouble *MEDFileFieldPerMeshPerType::getUndergroundDataArray() const thr return _field_pm_pt_pd[0]->getUndergroundDataArray(); } -void MEDFileFieldPerMeshPerType::fillValues(int& startTupleId, int& startEntryId, std::vector< std::pair,std::pair > >& entries, double *vals) const +void MEDFileFieldPerMeshPerType::fillValues(int& startTupleId, int& startEntryId, std::vector< std::pair,std::pair > >& entries, double *vals) const { int i=0; for(std::vector< MEDCouplingAutoRefCountObjectPtr >::const_iterator it=_field_pm_pt_pd.begin();it!=_field_pm_pt_pd.end();it++,i++) @@ -1282,7 +1282,7 @@ DataArrayDouble *MEDFileFieldPerMesh::getUndergroundDataArray() const throw(INTE return _field_pm_pt[0]->getUndergroundDataArray(); } -DataArrayDouble *MEDFileFieldPerMesh::getUndergroundDataArrayExt(std::vector< std::pair,std::pair > >& entries) const throw(INTERP_KERNEL::Exception) +DataArrayDouble *MEDFileFieldPerMesh::getUndergroundDataArrayExt(std::vector< std::pair,std::pair > >& entries) const throw(INTERP_KERNEL::Exception) { int globalSz=0; int nbOfEntries=0; @@ -2246,7 +2246,7 @@ DataArrayDouble *MEDFileField1TSWithoutDAS::getUndergroundDataArray() const thro * 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 > >& entries) const throw(INTERP_KERNEL::Exception) +DataArrayDouble *MEDFileField1TSWithoutDAS::getUndergroundDataArrayExt(std::vector< std::pair,std::pair > >& 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 !"); @@ -2546,7 +2546,7 @@ DataArrayDouble *MEDFileFieldMultiTSWithoutDAS::getUndergroundDataArray(int iter /*! * See doc at MEDFileField1TSWithoutDAS::getUndergroundDataArrayExt */ -DataArrayDouble *MEDFileFieldMultiTSWithoutDAS::getUndergroundDataArrayExt(int iteration, int order, std::vector< std::pair,std::pair > >& entries) const throw(INTERP_KERNEL::Exception) +DataArrayDouble *MEDFileFieldMultiTSWithoutDAS::getUndergroundDataArrayExt(int iteration, int order, std::vector< std::pair,std::pair > >& entries) const throw(INTERP_KERNEL::Exception) { return getTimeStepEntry(iteration,order).getUndergroundDataArrayExt(entries); } diff --git a/src/MEDLoader/MEDFileField.hxx b/src/MEDLoader/MEDFileField.hxx index f861fea33..5d3f44d4f 100644 --- a/src/MEDLoader/MEDFileField.hxx +++ b/src/MEDLoader/MEDFileField.hxx @@ -115,7 +115,7 @@ namespace ParaMEDMEM void getFieldAtLevel(TypeOfField type, const MEDFieldFieldGlobsReal *glob, std::vector& dads, std::vector& pfls, std::vector& locs, std::vector& geoTypes) const; DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception); - void fillValues(int discId, int& startTupleId, int& startEntryId, std::vector< std::pair,std::pair > >& entries, double *vals) const; + void fillValues(int discId, int& startTupleId, int& startEntryId, std::vector< std::pair,std::pair > >& 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); @@ -160,7 +160,7 @@ namespace ParaMEDMEM std::vector getLocsReallyUsed() const; void getFieldAtLevel(int meshDim, TypeOfField type, const MEDFieldFieldGlobsReal *glob, std::vector& dads, std::vector& pfls, std::vector& locs, std::vector& geoTypes) const; DataArrayDouble *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception); - void fillValues(int& startTupleId, int& startEntryId, std::vector< std::pair,std::pair > >& entries, double *vals) const; + void fillValues(int& startTupleId, int& startEntryId, std::vector< std::pair,std::pair > >& entries, double *vals) const; static med_entity_type ConvertIntoMEDFileType(TypeOfField ikType, INTERP_KERNEL::NormalizedCellType ikGeoType, med_geometry_type& medfGeoType); private: std::vector addNewEntryIfNecessary(const MEDCouplingFieldDouble *field, int offset, int nbOfCells) throw(INTERP_KERNEL::Exception); @@ -205,7 +205,7 @@ namespace ParaMEDMEM 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 > >& entries) const throw(INTERP_KERNEL::Exception); + DataArrayDouble *getUndergroundDataArrayExt(std::vector< std::pair,std::pair > >& entries) const throw(INTERP_KERNEL::Exception); private: int addNewEntryIfNecessary(INTERP_KERNEL::NormalizedCellType type); MEDCouplingFieldDouble *finishField(TypeOfField type, const MEDFieldFieldGlobsReal *glob, @@ -347,7 +347,7 @@ namespace ParaMEDMEM 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 > >& entries) const throw(INTERP_KERNEL::Exception); + DataArrayDouble *getUndergroundDataArrayExt(std::vector< std::pair,std::pair > >& 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); @@ -404,7 +404,7 @@ namespace ParaMEDMEM std::string getMeshName() const throw(INTERP_KERNEL::Exception); const std::vector& 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 > >& entries) const throw(INTERP_KERNEL::Exception); + DataArrayDouble *getUndergroundDataArrayExt(int iteration, int order, std::vector< std::pair,std::pair > >& entries) const throw(INTERP_KERNEL::Exception); public: std::vector getPflsReallyUsed2() const; std::vector getLocsReallyUsed2() const; diff --git a/src/MEDLoader/MEDLoader.cxx b/src/MEDLoader/MEDLoader.cxx index 09d8ddbe8..2803ff589 100644 --- a/src/MEDLoader/MEDLoader.cxx +++ b/src/MEDLoader/MEDLoader.cxx @@ -395,7 +395,7 @@ std::vector< std::pair > MEDLoader::GetComponentsNamesO * - the space dimension * - the number of nodes */ -std::vector< std::vector< std::pair > > MEDLoader::GetUMeshGlobalInfo(const char *fileName, const char *meshName, int &meshDim, int& spaceDim, int& numberOfNodes) throw(INTERP_KERNEL::Exception) +std::vector< std::vector< std::pair > > 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); @@ -427,7 +427,7 @@ std::vector< std::vector< std::pair > > MEDLoader::GetUMeshGlobalInfo(c MEDmeshComputationStepInfo(fid,nommaa,1,&numdt,&numit,&dt); // endlimitation std::vector dims; - std::vector< std::pair > geoTypes; + std::vector< std::pair > geoTypes; med_bool changement,transformation; for(int i=0;i > > MEDLoader::GetUMeshGlobalInfo(c INTERP_KERNEL::NormalizedCellType typp=typmai2[i]; int mdimCell=INTERP_KERNEL::CellModel::GetCellModel(typp).getDimension(); dims.push_back(mdimCell); - geoTypes.push_back(std::pair((int)typp,curNbOfElemM)); + geoTypes.push_back(std::pair(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 > > ret(nbOfLevels); + std::vector< std::vector< std::pair > > ret(nbOfLevels); for(std::size_t i=0;i GetMeshNames(const char *fileName) throw(INTERP_KERNEL::Exception); - static std::vector< std::vector< std::pair > > GetUMeshGlobalInfo(const char *fileName, const char *meshName, int &meshDim, int& spaceDim, int& numberOfNodes) throw(INTERP_KERNEL::Exception); + static std::vector< std::vector< std::pair > > GetUMeshGlobalInfo(const char *fileName, const char *meshName, int &meshDim, int& spaceDim, int& numberOfNodes) throw(INTERP_KERNEL::Exception); static std::vector< std::pair > GetComponentsNamesOfField(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception); static std::vector GetMeshNamesOnField(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception); static std::vector GetMeshGroupsNames(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception); diff --git a/src/MEDLoader/Swig/MEDLoader.i b/src/MEDLoader/Swig/MEDLoader.i index b10981ab5..6cabc1a70 100644 --- a/src/MEDLoader/Swig/MEDLoader.i +++ b/src/MEDLoader/Swig/MEDLoader.i @@ -215,19 +215,19 @@ public: static PyObject *GetUMeshGlobalInfo(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception) { int meshDim,spaceDim,numberOfNodes; - std::vector< std::vector< std::pair > > res=MEDLoader::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes); + std::vector< std::vector< std::pair > > 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 > >::const_iterator it=res.begin();it!=res.end();it++,i++) + for(std::vector< std::vector< std::pair > >::const_iterator it=res.begin();it!=res.end();it++,i++) { - const std::vector< std::pair >&obj2=(*it); + const std::vector< std::pair >&obj2=(*it); int j=0; PyObject *elt1=PyList_New(obj2.size()); - for(std::vector< std::pair >::const_iterator it2=obj2.begin();it2!=obj2.end();it2++,j++) + for(std::vector< std::pair >::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); } @@ -739,7 +739,7 @@ namespace ParaMEDMEM PyObject *getUndergroundDataArrayExt() const throw(INTERP_KERNEL::Exception) { - std::vector< std::pair,std::pair > > elt1Cpp; + std::vector< std::pair,std::pair > > 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 )); @@ -749,7 +749,7 @@ namespace ParaMEDMEM { 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)); @@ -892,7 +892,7 @@ namespace ParaMEDMEM } PyObject *getUndergroundDataArrayExt(int iteration, int order) const throw(INTERP_KERNEL::Exception) { - std::vector< std::pair,std::pair > > elt1Cpp; + std::vector< std::pair,std::pair > > 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 ));