From: Anthony Geay Date: Fri, 1 May 2020 03:07:00 +0000 (+0200) Subject: MEDFileUMesh.LoadPartCoords : make it cleaner X-Git-Tag: V9_5_0b1~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=00e5782d063571db066308518020221b813e0a0c;p=tools%2Fmedcoupling.git MEDFileUMesh.LoadPartCoords : make it cleaner --- diff --git a/src/MEDLoader/MEDFileMesh.cxx b/src/MEDLoader/MEDFileMesh.cxx index 91eb1d774..0d0a16c6f 100644 --- a/src/MEDLoader/MEDFileMesh.cxx +++ b/src/MEDLoader/MEDFileMesh.cxx @@ -2478,11 +2478,31 @@ MEDFileUMesh *MEDFileUMesh::LoadPartOf(med_idt fid, const std::string& mName, co return ret.retn(); } -void MEDFileUMesh::LoadPartCoords(const std::string& fileName, const std::vector& infosOnComp, const std::string& mName, int dt, int it, mcIdType nMin, mcIdType nMax, +/*! + * This method is an helper to load only consecutive nodes chunk of data of MED file pointed by \a fileName. + * Consecutive chunk is specified classicaly by start (included) stop (excluded) format with \a startNodeId and \a stopNodeId respectively. + * This method returns 5 elements. + * + * \param [in] fileName - Name of file nodes to be read of. + * \param [in] mName - Name of the mesh inside file pointed be \a fileName nodes to be read of. + * \param [in] dt - Time iteration inside file pointed be \a fileName nodes to be read of. + * \param [in] it - Time order inside file pointed be \a fileName nodes to be read of. + * \param [in] infosOnCompo - Components info of nodes to be read of. The size of string vector should be equal to space dimension of mesh to be read. + * \param [in] startNodeId - Start Node Id (included) of chunk of data to be read + * \param [in] stopNodeId - Start Node Id (included) of chunk of data to be read + * \param [out] coords - output coordinates of requested chunk (DataArrayDouble) + * \param [out] partCoords - output PartDefinition object of chunk + * \param [out] famCoords - output family id field of requested chunk (DataArrayIdType) + * \param [out] numCoords - output num id field of requested chunk (DataArrayIdType) + * \param [out] nameCoords - output names on nodes of requested chunk (DataArrayAsciiChar) + * + * \sa MEDLoaderUMesh::LoadPartOf + */ +void MEDFileUMesh::LoadPartCoords(const std::string& fileName, const std::string& mName, int dt, int it, const std::vector& infosOnComp, mcIdType startNodeId, mcIdType stopNodeId, MCAuto& coords, MCAuto& partCoords, MCAuto& famCoords, MCAuto& numCoords, MCAuto& nameCoords) { MEDFileUtilities::AutoFid fid(OpenMEDFileForRead(fileName)); - MEDFileUMeshL2::LoadPartCoords(fid,infosOnComp,mName,dt,it,nMin,nMax,coords,partCoords,famCoords,numCoords,nameCoords); + MEDFileUMeshL2::LoadPartCoords(fid,infosOnComp,mName,dt,it,startNodeId,stopNodeId,coords,partCoords,famCoords,numCoords,nameCoords); } std::size_t MEDFileUMesh::getHeapMemorySizeWithoutChildren() const diff --git a/src/MEDLoader/MEDFileMesh.hxx b/src/MEDLoader/MEDFileMesh.hxx index c621b9e34..d5efa2ecd 100644 --- a/src/MEDLoader/MEDFileMesh.hxx +++ b/src/MEDLoader/MEDFileMesh.hxx @@ -268,7 +268,7 @@ namespace MEDCoupling MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileUMesh"); } MEDLOADER_EXPORT static MEDFileUMesh *LoadPartOf(const std::string& fileName, const std::string& mName, const std::vector& types, const std::vector& slicPerTyp, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0); MEDLOADER_EXPORT static MEDFileUMesh *LoadPartOf(med_idt fid, const std::string& mName, const std::vector& types, const std::vector& slicPerTyp, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0); - MEDLOADER_EXPORT static void LoadPartCoords(const std::string& fileName, const std::vector& infosOnComp, const std::string& mName, int dt, int it, mcIdType nMin, mcIdType nMax, + MEDLOADER_EXPORT static void LoadPartCoords(const std::string& fileName, const std::string& mName, int dt, int it, const std::vector& infosOnComp, mcIdType startNodeId, mcIdType stopNodeId, MCAuto& coords, MCAuto& partCoords, MCAuto& famCoords, MCAuto& numCoords, MCAuto& nameCoords); MEDLOADER_EXPORT static const char *GetSpeStr4ExtMesh() { return SPE_FAM_STR_EXTRUDED_MESH; } MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; diff --git a/src/MEDLoader/Swig/MEDLoaderCommon.i b/src/MEDLoader/Swig/MEDLoaderCommon.i index 782723003..3d051d513 100644 --- a/src/MEDLoader/Swig/MEDLoaderCommon.i +++ b/src/MEDLoader/Swig/MEDLoaderCommon.i @@ -1457,13 +1457,13 @@ namespace MEDCoupling return MEDFileUMesh::LoadPartOf(fileName,mName,typesCpp2,slicPerTyp,dt,it,mrs); } - static PyObject *LoadPartCoords(const std::string& fileName, const std::vector& infosOnComp, const std::string& mName, int dt, int it, mcIdType nMin, mcIdType nMax) + static PyObject *LoadPartCoords(const std::string& fileName, const std::string& mName, int dt, int it, const std::vector& infosOnComp, mcIdType startNodeId, mcIdType stopNodeId) { MCAuto coords; MCAuto partCoords; MCAuto famCoords,numCoords; MCAuto nameCoord; - MEDFileUMesh::LoadPartCoords(fileName,infosOnComp,mName,dt,it,nMin,nMax,coords,partCoords,famCoords,numCoords,nameCoord); + MEDFileUMesh::LoadPartCoords(fileName,mName,dt,it,infosOnComp,startNodeId,stopNodeId,coords,partCoords,famCoords,numCoords,nameCoord); PyObject *ret(PyTuple_New(5)); PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(coords.retn()),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 )); PyTuple_SetItem(ret,1,convertPartDefinition(partCoords.retn(),SWIG_POINTER_OWN | 0));