]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Yeah ! It works ! agy/StructEltNoLimit
authorAnthony Geay <anthony.geay@edf.fr>
Tue, 14 Feb 2017 13:06:51 +0000 (14:06 +0100)
committerAnthony Geay <anthony.geay@edf.fr>
Tue, 14 Feb 2017 13:06:51 +0000 (14:06 +0100)
src/MEDLoader/MEDFileBlowStrEltUp.cxx
src/MEDLoader/MEDFileMeshSupport.cxx
src/MEDLoader/MEDFileMeshSupport.hxx
src/MEDLoader/Swig/MEDLoaderCommon.i

index bc5ecae84c905816fc5c27f1933f9bbe350f05c6..973f2b8ed447ba67aa250f4cf8c9f9ead8c0c1c9 100644 (file)
@@ -374,13 +374,15 @@ MCAuto<DataArrayDouble> LocInfo::BuildMeshFromAngleVrille(INTERP_KERNEL::Normali
     geoMesh=umesh->buildUnstructured();
   }
   //
-  MCAuto<DataArrayDouble> angleVrille(angleDeVrille->deepCopy());
+  MCConstAuto<DataArrayDouble> 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<MEDCouplingFieldDouble> fakeF(MEDCouplingFieldDouble::New(ON_GAUSS_PT));
   fakeF->setMesh(geoMesh);
@@ -388,11 +390,8 @@ MCAuto<DataArrayDouble> LocInfo::BuildMeshFromAngleVrille(INTERP_KERNEL::Normali
   fakeF->setGaussLocalizationOnType(gt,loc.getRefCoords(),loc.getGaussCoords(),loc.getGaussWeights());
   MCAuto<DataArrayDouble> ptsForLoc(fakeF->getLocalizationOfDiscr());
   //
-  MCAuto<DataArrayDouble> rot;
-  {
-    MCAuto<MEDCouplingFieldDouble> dir(geoMesh->buildDirectionVectorField());
-    rot=dir->getArray()->fromCartToSpher();
-  }
+  MCAuto<MEDCouplingFieldDouble> dir(geoMesh->buildDirectionVectorField());
+  MCAuto<DataArrayDouble> rot(dir->getArray()->fromCartToSpher());
   int nbCells(geoMesh->getNumberOfCells()),nbCompo(ptsForLoc->getNumberOfComponents());
   MCAuto<DataArrayDouble> secPts(section->getCoords()->changeNbOfComponents(nbCompo,0.));
   int nbSecPts(secPts->getNumberOfTuples());
@@ -411,7 +410,8 @@ MCAuto<DataArrayDouble> 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<nbg;l++)
         {
           MCAuto<DataArrayDouble> p2(p->deepCopy());
index 9f8daa813b3370f9ea4f2e4554473c4124308b6f..d70600c85015766bddcd72256772aa71203f2db9 100644 (file)
@@ -90,6 +90,15 @@ void MEDFileMeshSupports::writeLL(med_idt fid) const
       (*it)->writeLL(fid);
 }
 
+std::vector<std::string> MEDFileMeshSupports::getSupMeshNames() const
+{
+  std::vector<std::string> ret;
+  for(std::vector< MCAuto<MEDFileUMesh> >::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<std::string> mns;
index b47d69b8c1590efe7eaac7750f6cd557d4778e09..8e8e38e48203bc7b012eccdf2a40459e1f38d347 100644 (file)
@@ -39,6 +39,7 @@ namespace MEDCoupling
     std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     std::size_t getHeapMemorySizeWithoutChildren() const;
     void writeLL(med_idt fid) const;
+    std::vector<std::string> getSupMeshNames() const;
     const MEDFileUMesh *getSupMeshWithName(const std::string& name) const;
     int getNumberOfNodesInConnOf(TypeOfField entity, const std::string& name) const;
   private:
index 0ce4682b2f144397b7a09fbdc5ae100dec1ec794..de7f087a4a5cd1d98bd3c7395c06bfe24fb741dd 100644 (file)
@@ -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<std::string> 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<MEDFileUMesh *>(ret));
+           if(ret2)
+             ret2->incrRef();
+           return ret2;
+         }
+       }
   };
  
   class MEDFileStructureElements : public RefCountObject, public MEDFileWritableStandAlone