]> SALOME platform Git repositories - modules/med.git/commitdiff
Salome HOME
Addition of the 2 new unstructured mesh types.
authorageay <ageay>
Wed, 7 Aug 2013 12:21:39 +0000 (12:21 +0000)
committerageay <ageay>
Wed, 7 Aug 2013 12:21:39 +0000 (12:21 +0000)
idl/MEDCouplingCorbaServantTest.idl
src/MEDCouplingCorba/Test/MEDCouplingMeshFieldFactoryComponent.cxx
src/MEDCouplingCorba/Test/MEDCouplingMeshFieldFactoryComponent.hxx
src/MEDCouplingCorba/Test/MEDCouplingMeshFieldFactoryComponentServ.cxx
src/MEDCouplingCorba/Test/MEDCouplingMeshFieldFactoryComponentServ.hxx
src/MEDCouplingCorba_Swig/MEDCouplingCorbaSwigTest.py
src/MEDCouplingCorba_Swig/MEDCouplingCorbaSwigTestServ.py

index 8671498bfb20db3d7395cce64ca68cc6fdd0f515..811086f39fb7f85ced27393593e6b96602a060b9 100644 (file)
@@ -38,6 +38,8 @@ module SALOME_TEST
     SALOME_MED::MEDCouplingExtrudedMeshCorbaInterface getExtrudedMesh();
     SALOME_MED::MEDCouplingCMeshCorbaInterface getCMesh();
     SALOME_MED::MEDCouplingCurveLinearMeshCorbaInterface getCLMesh();
+    SALOME_MED::MEDCoupling1SGTUMeshCorbaInterface get1SGTUMesh();
+    SALOME_MED::MEDCoupling1DGTUMeshCorbaInterface get1DGTUMesh();
     SALOME_MED::MEDCouplingFieldDoubleCorbaInterface getFieldScalarOn2DNT();
     SALOME_MED::MEDCouplingFieldDoubleCorbaInterface getFieldNodeScalarOn2DNT();
     SALOME_MED::MEDCouplingFieldDoubleCorbaInterface getFieldScalarOn3DNT();
index b0f4246939a90f25239c9c4856370627d751206e..2bcae61af5a1bd18f92b0c58efd15c47ff011d1f 100644 (file)
@@ -25,6 +25,7 @@
 #include "MEDCouplingMultiFields.hxx"
 #include "MEDCouplingFieldOverTime.hxx"
 #include "MEDCouplingMemArray.hxx"
+#include "MEDCoupling1GTUMesh.hxx"
 #include "MEDCouplingUMesh.hxx"
 #include "MEDCouplingCMesh.hxx"
 #include "MEDCouplingCurveLinearMesh.hxx"
@@ -239,6 +240,47 @@ namespace SALOME_TEST
     return targetMesh;
   }
 
+  ParaMEDMEM::MEDCoupling1SGTUMesh *MEDCouplingCorbaServBasicsTest::build1SGTUMesh()
+  {
+    ParaMEDMEM::MEDCoupling1SGTUMesh *targetMesh=ParaMEDMEM::MEDCoupling1SGTUMesh::New("Mesh1SGT",INTERP_KERNEL::NORM_QUAD4);
+    targetMesh->setTime(2.3,4,5);
+    targetMesh->setTimeUnit("us");
+    targetMesh->setDescription("My Description of 1SGTU");
+    ParaMEDMEM::DataArrayDouble *a1=ParaMEDMEM::DataArrayDouble::New(); a1->alloc(10,3); a1->setInfoOnComponent(0,"X1 [m]");  a1->setInfoOnComponent(1,"YY2 [km]"); a1->setInfoOnComponent(2,"ZZZ3 [km]");
+    const double coords[30]={1.,1.,0.,2.,1.,0.,3.,1.,0.,1.,0.,0.,2.,0.,0.,0.,0.,0.,0.,1.,0.,3.,0.,0.,4.,0.,0.,4.,1.,0.};
+    const int conn[16]={6,0,3,5,3,0,1,4,1,2,7,4,8,7,2,9};
+    std::copy(coords,coords+30,a1->getPointer()); targetMesh->setCoords(a1); a1->decrRef();
+    ParaMEDMEM::DataArrayInt *a2(ParaMEDMEM::DataArrayInt::New()); a2->alloc(4*4,1);
+    std::copy(conn,conn+16,a2->getPointer());
+    targetMesh->setNodalConnectivity(a2); a2->decrRef();
+    //
+    targetMesh->checkCoherency();
+    //
+    return targetMesh;
+  }
+  
+  ParaMEDMEM::MEDCoupling1DGTUMesh *MEDCouplingCorbaServBasicsTest::build1DGTUMesh()
+  {
+    ParaMEDMEM::MEDCoupling1DGTUMesh *targetMesh=ParaMEDMEM::MEDCoupling1DGTUMesh::New("Mesh1DGT",INTERP_KERNEL::NORM_POLYGON);
+    targetMesh->setTime(2.3,4,5);
+    targetMesh->setTimeUnit("us");
+    targetMesh->setDescription("My Description of 1DGTU");
+    ParaMEDMEM::DataArrayDouble *a1=ParaMEDMEM::DataArrayDouble::New(); a1->alloc(10,3); a1->setInfoOnComponent(0,"X1 [m]");  a1->setInfoOnComponent(1,"YY2 [km]"); a1->setInfoOnComponent(2,"ZZZ3 [km]");
+    const double coords[30]={1.,1.,0.,2.,1.,0.,3.,1.,0.,1.,0.,0.,2.,0.,0.,0.,0.,0.,0.,1.,0.,3.,0.,0.,4.,0.,0.,4.,1.,0.};
+    const int conn[15]={6,0,3,5,3,0,1,4,1,2,7,4,8,7,2};
+    const int conni[5]={0,4,8,12,15};
+    std::copy(coords,coords+30,a1->getPointer()); targetMesh->setCoords(a1); a1->decrRef();
+    ParaMEDMEM::DataArrayInt *a2(ParaMEDMEM::DataArrayInt::New()); a2->alloc(15,1);
+    std::copy(conn,conn+15,a2->getPointer());
+    ParaMEDMEM::DataArrayInt *a3(ParaMEDMEM::DataArrayInt::New()); a3->alloc(5,1);
+    std::copy(conni,conni+5,a3->getPointer());
+    targetMesh->setNodalConnectivity(a2,a3); a2->decrRef(); a3->decrRef();
+    //
+    targetMesh->checkCoherency();
+    //
+    return targetMesh;
+  }
+
   ParaMEDMEM::MEDCouplingFieldDouble *MEDCouplingCorbaServBasicsTest::buildFieldScalarOn2DNT()
   {
     ParaMEDMEM::MEDCouplingUMesh *mesh=build2DMesh();
index b0cecbbac3781dffcbdc258e275b9ffc7d7f66dc..655b011eace3f361257bdac2d0e67191b5f8955d 100644 (file)
@@ -29,6 +29,8 @@ namespace ParaMEDMEM
   class MEDCouplingFieldDouble;
   class MEDCouplingFieldTemplate;
   class MEDCouplingExtrudedMesh;
+  class MEDCoupling1DGTUMesh;
+  class MEDCoupling1SGTUMesh;
   class MEDCouplingCMesh;
   class MEDCouplingCurveLinearMesh;
   class DataArrayDouble;
@@ -51,6 +53,8 @@ namespace SALOME_TEST
     static ParaMEDMEM::MEDCouplingExtrudedMesh *buildExtrudedMesh(ParaMEDMEM::MEDCouplingUMesh *&m2D);
     static ParaMEDMEM::MEDCouplingCMesh *buildCMesh();
     static ParaMEDMEM::MEDCouplingCurveLinearMesh *buildCLMesh();
+    static ParaMEDMEM::MEDCoupling1SGTUMesh *build1SGTUMesh();
+    static ParaMEDMEM::MEDCoupling1DGTUMesh *build1DGTUMesh();
     static ParaMEDMEM::MEDCouplingFieldDouble *buildFieldScalarOn2DNT();
     static ParaMEDMEM::MEDCouplingFieldDouble *buildFieldNodeScalarOn2DNT();
     static ParaMEDMEM::MEDCouplingFieldDouble *buildFieldScalarOn3DNT();
index 8bcaf19e75b5a0c44292aeca36d8a72366461307..2417ac2a5f9c1d55e215ba5a8c26d7cfed84eb17 100644 (file)
@@ -26,6 +26,8 @@
 #include "MEDCouplingFieldOverTimeServant.hxx"
 #include "MEDCouplingExtrudedMeshServant.hxx"
 #include "MEDCouplingCurveLinearMeshServant.hxx"
+#include "MEDCoupling1SGTUMeshServant.hxx"
+#include "MEDCoupling1DGTUMeshServant.hxx"
 #include "MEDCouplingCMeshServant.hxx"
 #include "MEDCouplingUMeshServant.hxx"
 #include "DataArrayDoubleServant.hxx"
@@ -36,6 +38,7 @@
 #include "MEDCouplingFieldOverTime.hxx"
 #include "MEDCouplingExtrudedMesh.hxx"
 #include "MEDCouplingCurveLinearMesh.hxx"
+#include "MEDCoupling1GTUMesh.hxx"
 #include "MEDCouplingUMesh.hxx"
 #include "MEDCouplingCMesh.hxx"
 
@@ -140,6 +143,24 @@ namespace SALOME_TEST
     return ret;
   }
 
+  SALOME_MED::MEDCoupling1SGTUMeshCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::get1SGTUMesh()
+  {
+    ParaMEDMEM::MEDCoupling1SGTUMesh *m1=MEDCouplingCorbaServBasicsTest::build1SGTUMesh();
+    ParaMEDMEM::MEDCoupling1SGTUMeshServant *m=new ParaMEDMEM::MEDCoupling1SGTUMeshServant(m1);
+    m1->decrRef();
+    SALOME_MED::MEDCoupling1SGTUMeshCorbaInterface_ptr ret=m->_this();
+    return ret;
+  }
+
+  SALOME_MED::MEDCoupling1DGTUMeshCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::get1DGTUMesh()
+  {
+    ParaMEDMEM::MEDCoupling1DGTUMesh *m1=MEDCouplingCorbaServBasicsTest::build1DGTUMesh();
+    ParaMEDMEM::MEDCoupling1DGTUMeshServant *m=new ParaMEDMEM::MEDCoupling1DGTUMeshServant(m1);
+    m1->decrRef();
+    SALOME_MED::MEDCoupling1DGTUMeshCorbaInterface_ptr ret=m->_this();
+    return ret;
+  }
+
   SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr MEDCouplingMeshFieldFactoryComponent::getFieldScalarOn2DNT()
   {
     ParaMEDMEM::MEDCouplingFieldDouble *field=MEDCouplingCorbaServBasicsTest::buildFieldScalarOn2DNT();
index d9218e5f1873ceff07f0b344f3e683d06254ed71..487d5e4677c07dd52e248e8bc8f0da1fcbec75dd 100644 (file)
@@ -50,6 +50,8 @@ namespace SALOME_TEST
     SALOME_MED::MEDCouplingExtrudedMeshCorbaInterface_ptr getExtrudedMesh();
     SALOME_MED::MEDCouplingCMeshCorbaInterface_ptr getCMesh();
     SALOME_MED::MEDCouplingCurveLinearMeshCorbaInterface_ptr getCLMesh();
+    SALOME_MED::MEDCoupling1SGTUMeshCorbaInterface_ptr get1SGTUMesh();
+    SALOME_MED::MEDCoupling1DGTUMeshCorbaInterface_ptr get1DGTUMesh();
     SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr getFieldScalarOn2DNT();
     SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr getFieldNodeScalarOn2DNT();
     SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr getFieldScalarOn3DNT();
index 68f4f15f6140e026585abb7947095e3f616c5d47..d42e5f46c8e6a5473d42c0f9065b115978564c6f 100644 (file)
@@ -190,6 +190,37 @@ class MEDCouplingCorbaServBasicsTest:
         #
         return targetMesh;
 
+    def build1SGTUMesh(self):
+        targetMesh=MEDCoupling1SGTUMesh("Mesh1SGT",NORM_QUAD4)
+        targetMesh.setTime(2.3,4,5)
+        targetMesh.setTimeUnit("us")
+        targetMesh.setDescription("My Description of 1SGTU");
+        a1=DataArrayDouble([1.,1.,0.,2.,1.,0.,3.,1.,0.,1.,0.,0.,2.,0.,0.,0.,0.,0.,0.,1.,0.,3.,0.,0.,4.,0.,0.,4.,1.,0.],10,3)
+        a1.setInfoOnComponents(["X1 [m]","YY2 [km]","ZZZ3 [km]"])
+        targetMesh.setCoords(a1)
+        a2=DataArrayInt([6,0,3,5,3,0,1,4,1,2,7,4,8,7,2,9],4*4,1)
+        targetMesh.setNodalConnectivity(a2)
+        #
+        targetMesh.checkCoherency();
+        #
+        return targetMesh;
+
+    def build1DGTUMesh(self):
+        targetMesh=MEDCoupling1DGTUMesh("Mesh1DGT",NORM_POLYGON);
+        targetMesh.setTime(2.3,4,5)
+        targetMesh.setTimeUnit("us")
+        targetMesh.setDescription("My Description of 1DGTU");
+        a1=DataArrayDouble([1.,1.,0.,2.,1.,0.,3.,1.,0.,1.,0.,0.,2.,0.,0.,0.,0.,0.,0.,1.,0.,3.,0.,0.,4.,0.,0.,4.,1.,0.],10,3)
+        a1.setInfoOnComponents(["X1 [m]","YY2 [km]","ZZZ3 [km]"])
+        targetMesh.setCoords(a1)
+        a2=DataArrayInt([6,0,3,5,3,0,1,4,1,2,7,4,8,7,2],15,1)
+        a3=DataArrayInt([0,4,8,12,15],5,1)
+        targetMesh.setNodalConnectivity(a2,a3)
+        #
+        targetMesh.checkCoherency();
+        #
+        return targetMesh;
+        
     def buildFieldScalarOn2DNT(self):
         mesh=self.build2DMesh();
         fieldOnCells=MEDCouplingFieldDouble.New(ON_CELLS,NO_TIME);
index 62517130c0fe154790795cd9b4a67a7cefc1799a..81904317fa6bf2fc67b2c2496704049ddf7b8aac 100644 (file)
@@ -72,6 +72,14 @@ class MEDCouplingMeshFieldFactoryComponentPy(MEDCouplingCorbaServantTest_idl._0_
     def getCLMesh(self):
         mesh=self._test.buildCLMesh()
         return MEDCouplingCurveLinearMeshServant._this(mesh)
+
+    def get1SGTUMesh(self):
+        mesh=self._test.build1SGTUMesh()
+        return MEDCoupling1SGTUMeshServant._this(mesh)
+
+    def get1DGTUMesh(self):
+        mesh=self._test.build1DGTUMesh()
+        return MEDCoupling1DGTUMeshServant._this(mesh)
     
     def getFieldScalarOn2DNT(self):
         field=self._test.buildFieldScalarOn2DNT()