From 624843c484225523ed6eb846d08dd2367495ef57 Mon Sep 17 00:00:00 2001 From: ageay Date: Mon, 29 Jul 2013 10:45:10 +0000 Subject: [PATCH] MEDReader ready -> debug is in progress. --- src/MEDCoupling/MEDCoupling1GTUMesh.cxx | 38 ++++++++++++++++++++++++ src/MEDCoupling/MEDCoupling1GTUMesh.hxx | 2 ++ src/MEDCoupling/MEDCouplingPointSet.hxx | 1 + src/MEDCoupling/MEDCouplingUMeshDesc.cxx | 5 ++++ src/MEDCoupling/MEDCouplingUMeshDesc.hxx | 1 + src/MEDLoader/MEDFileMesh.cxx | 23 +++----------- 6 files changed, 51 insertions(+), 19 deletions(-) diff --git a/src/MEDCoupling/MEDCoupling1GTUMesh.cxx b/src/MEDCoupling/MEDCoupling1GTUMesh.cxx index 6b8206290..193b34f2f 100644 --- a/src/MEDCoupling/MEDCoupling1GTUMesh.cxx +++ b/src/MEDCoupling/MEDCoupling1GTUMesh.cxx @@ -1192,6 +1192,25 @@ MEDCouplingPointSet *MEDCoupling1SGTUMesh::buildPartOfMySelfKeepCoords2(int star return ret.retn(); } +void MEDCoupling1SGTUMesh::computeNodeIdsAlg(std::vector& nodeIdsInUse) const throw(INTERP_KERNEL::Exception) +{ + int sz((int)nodeIdsInUse.size()); + int nbCells(getNumberOfCells()); + int nbOfNodesPerCell(getNumberOfNodesPerCell()); + const int *w(_conn->begin()); + for(int i=0;i=0 && *w ret(new MEDCoupling1SGTUMesh(getName().c_str(),*_cm)); @@ -2177,6 +2196,25 @@ MEDCouplingPointSet *MEDCoupling1DGTUMesh::buildPartOfMySelfKeepCoords2(int star return ret.retn(); } +void MEDCoupling1DGTUMesh::computeNodeIdsAlg(std::vector& nodeIdsInUse) const throw(INTERP_KERNEL::Exception) +{ + int sz((int)nodeIdsInUse.size()); + int nbCells(getNumberOfCells()); + const int *w(_conn->begin()),*wi(_conn_indx->begin()); + for(int i=0;i=0 && *pt& nodeIdsInUse) const throw(INTERP_KERNEL::Exception); MEDCOUPLING_EXPORT void getReverseNodalConnectivity(DataArrayInt *revNodal, DataArrayInt *revNodalIndx) const throw(INTERP_KERNEL::Exception); MEDCOUPLING_EXPORT void checkFullyDefined() const throw(INTERP_KERNEL::Exception); MEDCOUPLING_EXPORT bool isEmptyMesh(const std::vector& tinyInfo) const; @@ -185,6 +186,7 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const; MEDCOUPLING_EXPORT MEDCouplingPointSet *buildPartOfMySelfKeepCoords(const int *begin, const int *end) const; MEDCOUPLING_EXPORT MEDCouplingPointSet *buildPartOfMySelfKeepCoords2(int start, int end, int step) const; + MEDCOUPLING_EXPORT void computeNodeIdsAlg(std::vector& nodeIdsInUse) const throw(INTERP_KERNEL::Exception); MEDCOUPLING_EXPORT void getReverseNodalConnectivity(DataArrayInt *revNodal, DataArrayInt *revNodalIndx) const throw(INTERP_KERNEL::Exception); MEDCOUPLING_EXPORT void checkFullyDefined() const throw(INTERP_KERNEL::Exception); MEDCOUPLING_EXPORT bool isEmptyMesh(const std::vector& tinyInfo) const; diff --git a/src/MEDCoupling/MEDCouplingPointSet.hxx b/src/MEDCoupling/MEDCouplingPointSet.hxx index 26471e539..b6f5ada50 100644 --- a/src/MEDCoupling/MEDCouplingPointSet.hxx +++ b/src/MEDCoupling/MEDCouplingPointSet.hxx @@ -75,6 +75,7 @@ namespace ParaMEDMEM virtual DataArrayInt *mergeNodes(double precision, bool& areNodesMerged, int& newNbOfNodes); virtual DataArrayInt *mergeNodes2(double precision, bool& areNodesMerged, int& newNbOfNodes); virtual MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const = 0; + virtual void computeNodeIdsAlg(std::vector& nodeIdsInUse) const throw(INTERP_KERNEL::Exception) = 0; void getCoordinatesOfNode(int nodeId, std::vector& coo) const throw(INTERP_KERNEL::Exception); DataArrayInt *buildPermArrayForMergeNode(double precision, int limitNodeId, bool& areNodesMerged, int& newNbOfNodes) const; DataArrayInt *getNodeIdsNearPoint(const double *pos, double eps) const throw(INTERP_KERNEL::Exception); diff --git a/src/MEDCoupling/MEDCouplingUMeshDesc.cxx b/src/MEDCoupling/MEDCouplingUMeshDesc.cxx index cce7da8d8..6f5a9ec2a 100644 --- a/src/MEDCoupling/MEDCouplingUMeshDesc.cxx +++ b/src/MEDCoupling/MEDCouplingUMeshDesc.cxx @@ -423,6 +423,11 @@ MEDCouplingPointSet *MEDCouplingUMeshDesc::buildPartOfMySelfKeepCoords2(int star throw INTERP_KERNEL::Exception("Not implemented yet !"); } +void MEDCouplingUMeshDesc::computeNodeIdsAlg(std::vector& nodeIdsInUse) const throw(INTERP_KERNEL::Exception) +{ + throw INTERP_KERNEL::Exception("Not implemented yet !"); +} + DataArrayInt *MEDCouplingUMeshDesc::simplexize(int policy) throw(INTERP_KERNEL::Exception) { throw INTERP_KERNEL::Exception("MEDCouplingUMeshDesc::simplexize : Not implemented yet !"); diff --git a/src/MEDCoupling/MEDCouplingUMeshDesc.hxx b/src/MEDCoupling/MEDCouplingUMeshDesc.hxx index bed0e3ae1..e26b63d44 100644 --- a/src/MEDCoupling/MEDCouplingUMeshDesc.hxx +++ b/src/MEDCoupling/MEDCouplingUMeshDesc.hxx @@ -77,6 +77,7 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT void fillCellIdsToKeepFromNodeIds(const int *begin, const int *end, bool fullyIn, DataArrayInt *&cellIdsKeptArr) const; MEDCOUPLING_EXPORT MEDCouplingPointSet *buildPartOfMySelfKeepCoords(const int *begin, const int *end) const; MEDCOUPLING_EXPORT MEDCouplingPointSet *buildPartOfMySelfKeepCoords2(int start, int end, int step) const; + MEDCOUPLING_EXPORT void computeNodeIdsAlg(std::vector& nodeIdsInUse) const throw(INTERP_KERNEL::Exception); MEDCOUPLING_EXPORT MEDCouplingPointSet *buildPartOfMySelfNode(const int *start, const int *end, bool fullyIn) const; MEDCOUPLING_EXPORT MEDCouplingPointSet *buildFacePartOfMySelfNode(const int *start, const int *end, bool fullyIn) const; MEDCOUPLING_EXPORT DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception); diff --git a/src/MEDLoader/MEDFileMesh.cxx b/src/MEDLoader/MEDFileMesh.cxx index 222b914c3..918bd4baa 100644 --- a/src/MEDLoader/MEDFileMesh.cxx +++ b/src/MEDLoader/MEDFileMesh.cxx @@ -2631,29 +2631,14 @@ void MEDFileUMesh::whichAreNodesFetched(const MEDFileField1TSStructItem& st, con for(std::size_t i=0;i um(getMeshAtLevel(relDim)); - std::vector d(um->getDistributionOfTypes()); - std::size_t nbOfTypes(d.size()/3); - int offset=0,nbOfEltWT=-1; - for(std::size_t j=0;j(um->buildPartOfMySelf2(offset,offset+nbOfEltWT,1,true)); + const MEDCoupling1GTUMesh *m(getDirectUndergroundSingleGeoTypeMesh(curGt)); if(st[i].getPflName().empty()) - um->computeNodeIdsAlg(nodesFetched); + m->computeNodeIdsAlg(nodesFetched); else { const DataArrayInt *arr(globs->getProfile(st[i].getPflName().c_str())); - um=dynamic_cast(um->buildPartOfMySelf(arr->begin(),arr->end(),true)); - um->computeNodeIdsAlg(nodesFetched); + MEDCouplingAutoRefCountObjectPtr m2(dynamic_cast(m->buildPartOfMySelf(arr->begin(),arr->end(),true))); + m2->computeNodeIdsAlg(nodesFetched); } } } -- 2.39.2