From: Anthony Geay Date: Tue, 14 Feb 2017 13:06:51 +0000 (+0100) Subject: Yeah ! It works ! X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fagy%2FStructEltNoLimit;p=tools%2Fmedcoupling.git Yeah ! It works ! --- diff --git a/src/MEDLoader/MEDFileBlowStrEltUp.cxx b/src/MEDLoader/MEDFileBlowStrEltUp.cxx index bc5ecae84..973f2b8ed 100644 --- a/src/MEDLoader/MEDFileBlowStrEltUp.cxx +++ b/src/MEDLoader/MEDFileBlowStrEltUp.cxx @@ -374,13 +374,15 @@ MCAuto LocInfo::BuildMeshFromAngleVrille(INTERP_KERNEL::Normali geoMesh=umesh->buildUnstructured(); } // - MCAuto angleVrille(angleDeVrille->deepCopy()); + MCConstAuto angleVrille; if(!pfl.empty()) { const DataArrayInt *pflArr(globs->getProfile(pfl)); geoMesh=geoMesh->buildPartOfMySelf(pflArr->begin(),pflArr->end(),true); - angleVrille=angleVrille->selectByTupleIdSafe(pflArr->begin(),pflArr->end()); + angleVrille=angleDeVrille->selectByTupleIdSafe(pflArr->begin(),pflArr->end()); } + else + angleVrille.takeRef(angleDeVrille); // MCAuto fakeF(MEDCouplingFieldDouble::New(ON_GAUSS_PT)); fakeF->setMesh(geoMesh); @@ -388,11 +390,8 @@ MCAuto LocInfo::BuildMeshFromAngleVrille(INTERP_KERNEL::Normali fakeF->setGaussLocalizationOnType(gt,loc.getRefCoords(),loc.getGaussCoords(),loc.getGaussWeights()); MCAuto ptsForLoc(fakeF->getLocalizationOfDiscr()); // - MCAuto rot; - { - MCAuto dir(geoMesh->buildDirectionVectorField()); - rot=dir->getArray()->fromCartToSpher(); - } + MCAuto dir(geoMesh->buildDirectionVectorField()); + MCAuto rot(dir->getArray()->fromCartToSpher()); int nbCells(geoMesh->getNumberOfCells()),nbCompo(ptsForLoc->getNumberOfComponents()); MCAuto secPts(section->getCoords()->changeNbOfComponents(nbCompo,0.)); int nbSecPts(secPts->getNumberOfTuples()); @@ -411,7 +410,8 @@ MCAuto LocInfo::BuildMeshFromAngleVrille(INTERP_KERNEL::Normali DataArrayDouble::Rotate3DAlg(CENTER,AX0,ang0,nbSecPts,p->begin(),p->getPointer()); AX1[0]=-sin(ang0); AX1[1]=cos(ang0);// rot Oy around OZ double ang1(M_PI/2.-rot->getIJ(j,1)); - DataArrayDouble::Rotate3DAlg(CENTER,AX1,ang1,nbSecPts,p->begin(),p->getPointer()); + DataArrayDouble::Rotate3DAlg(CENTER,AX1,-ang1,nbSecPts,p->begin(),p->getPointer()); + DataArrayDouble::Rotate3DAlg(CENTER,dir->getArray()->begin()+j*3,angleVrille->getIJ(j,0),nbSecPts,p->begin(),p->getPointer()); for(int l=0;l p2(p->deepCopy()); diff --git a/src/MEDLoader/MEDFileMeshSupport.cxx b/src/MEDLoader/MEDFileMeshSupport.cxx index 9f8daa813..d70600c85 100644 --- a/src/MEDLoader/MEDFileMeshSupport.cxx +++ b/src/MEDLoader/MEDFileMeshSupport.cxx @@ -90,6 +90,15 @@ void MEDFileMeshSupports::writeLL(med_idt fid) const (*it)->writeLL(fid); } +std::vector MEDFileMeshSupports::getSupMeshNames() const +{ + std::vector ret; + for(std::vector< MCAuto >::const_iterator it=_supports.begin();it!=_supports.end();it++) + if((*it).isNotNull()) + ret.push_back((*it)->getName()); + return ret; +} + const MEDFileUMesh *MEDFileMeshSupports::getSupMeshWithName(const std::string& name) const { std::vector mns; diff --git a/src/MEDLoader/MEDFileMeshSupport.hxx b/src/MEDLoader/MEDFileMeshSupport.hxx index b47d69b8c..8e8e38e48 100644 --- a/src/MEDLoader/MEDFileMeshSupport.hxx +++ b/src/MEDLoader/MEDFileMeshSupport.hxx @@ -39,6 +39,7 @@ namespace MEDCoupling std::vector getDirectChildrenWithNull() const; std::size_t getHeapMemorySizeWithoutChildren() const; void writeLL(med_idt fid) const; + std::vector getSupMeshNames() const; const MEDFileUMesh *getSupMeshWithName(const std::string& name) const; int getNumberOfNodesInConnOf(TypeOfField entity, const std::string& name) const; private: diff --git a/src/MEDLoader/Swig/MEDLoaderCommon.i b/src/MEDLoader/Swig/MEDLoaderCommon.i index 0ce4682b2..de7f087a4 100644 --- a/src/MEDLoader/Swig/MEDLoaderCommon.i +++ b/src/MEDLoader/Swig/MEDLoaderCommon.i @@ -141,6 +141,7 @@ using namespace MEDCoupling; %newobject MEDCoupling::MEDFileMeshes::__iter__; %newobject MEDCoupling::MEDFileMeshSupports::New; +%newobject MEDCoupling::MEDFileMeshSupports::getSupMeshWithName; %newobject MEDCoupling::MEDFileStructureElements::New; @@ -3009,6 +3010,18 @@ namespace MEDCoupling { public: static MEDFileMeshSupports *New(const std::string& fileName) throw(INTERP_KERNEL::Exception); + std::vector getSupMeshNames() const throw(INTERP_KERNEL::Exception); + %extend + { + MEDFileUMesh *getSupMeshWithName(const std::string& name) const throw(INTERP_KERNEL::Exception) + { + const MEDFileUMesh *ret(self->getSupMeshWithName(name)); + MEDFileUMesh *ret2(const_cast(ret)); + if(ret2) + ret2->incrRef(); + return ret2; + } + } }; class MEDFileStructureElements : public RefCountObject, public MEDFileWritableStandAlone