Salome HOME
Following training's feedback: removing finishInsertingCells(),
authorabn <adrien.bruneton@cea.fr>
Mon, 19 Oct 2015 09:08:17 +0000 (11:08 +0200)
committerabn <adrien.bruneton@cea.fr>
Mon, 19 Oct 2015 09:08:17 +0000 (11:08 +0200)
clarifying some points in the tutorial.

19 files changed:
doc/tutorial/atestMEDCouplingCube.rst
doc/tutorial/atestMEDCouplingDataArray1.rst
doc/tutorial/atestMEDCouplingPoly.rst
doc/tutorial/atestMEDCouplingUMesh1.rst
doc/tutorial/atestMEDLoaderAdvancedAPI1.rst
doc/tutorial/atestMEDLoaderBasicAPI1.rst
doc/tutorial/medcoupling_2Dpolygon.rst
doc/tutorial/medcoupling_3Dcube.rst
doc/tutorial/medcoupling_dataarray1_en.rst
doc/tutorial/medcoupling_dataarray1_fr.rst
doc/tutorial/medcoupling_umesh1_en.rst
doc/tutorial/medcoupling_umesh1_fr.rst
doc/tutorial/medcouplingcorba_en.rst
doc/tutorial/medloader_SplitAndMerge1_en.rst
doc/tutorial/medloader_SplitAndMerge1_fr.rst
doc/tutorial/medloader_advancedAPI1_en.rst
doc/tutorial/medloader_advancedAPI1_fr.rst
doc/tutorial/medloader_basicAPI1_en.rst
doc/tutorial/medloader_basicAPI1_fr.rst

index a15c0d2fbda5b5bda7ffe194dc541caa7f804d44..61e4bd404a4cfbd34593c525fb2a8019e0ebea68 100644 (file)
@@ -65,7 +65,6 @@
        for i in range(nbOfCells):
                mesh.insertNextCell(NORM_HEXA8,8,connectivity[8*i:8*(i+1)])
                pass
-       mesh.finishInsertingCells()
 
        print "5 ********************"
        # Settings of coordinates and verify if it's OK
 
        for i in range(NbCell2D):
                m1.insertNextCell(NORM_QUAD4,4,Connectivities[4*i:4*(i+1)])
-       m1.finishInsertingCells()
        m1.changeSpaceDimension(3)
 
        # Creation of 1D meshing
        m2.insertNextCell(NORM_SEG2,2,conn[0:2])
        m2.insertNextCell(NORM_SEG2,2,conn[2:4])
        m2.insertNextCell(NORM_SEG2,2,conn[4:6])
-       m2.finishInsertingCells()
        myCoords1D=DataArrayDouble.New()
        myCoords1D.setValues(coords,4,1)
        m2.setCoords(myCoords1D)
index f35e47858ab46f78e53500d0c9f4e2da509d32d2..e168e44bc36544368205f370cd21b0b323c7b74c 100644 (file)
@@ -56,7 +56,6 @@ Playing with regular hexagons using DataArrayDouble
                cell_connec = o2n[6*i:6*(i+1)]
                m.insertNextCell(mc.NORM_POLYGON, cell_connec.getValues())
                pass
-       m.finishInsertingCells()
        # Check that everything is coherent (will throw if not)
        m.checkCoherency()
        # Write the result into a VTU file that can be read with ParaView
index cfbee5d62eafbeea6f004fb79546a9f1ec29ae4d..949fe30911ddd1357124aaf30d45c49eea817cc1 100644 (file)
@@ -89,7 +89,6 @@
        for i in range(6):
                mesh.insertNextCell(NORM_POLYGON,6,connectivity[6*i:6*(i+1)])
                pass
-       mesh.finishInsertingCells()
 
        print "5 ********************"
        mesh.checkCoherency()
index 8c57d4fe7d2d5a1aa2be44e9a28e16544d220f05..6734be770f0ded240885ee66ec1d19c84222ccd0 100644 (file)
@@ -29,7 +29,6 @@ Playing with unstructured mesh
        mesh3D.insertNextCell(mc.NORM_HEXA8,conn[0:8]); mesh3D.insertNextCell(mc.NORM_POLYHED,conn[8:51]); mesh3D.insertNextCell(mc.NORM_HEXA8,conn[51:59]); mesh3D.insertNextCell(mc.NORM_HEXA8,conn[59:67]); mesh3D.insertNextCell(mc.NORM_POLYHED,conn[67:110]); mesh3D.insertNextCell(mc.NORM_HEXA8,conn[110:118]);
        mesh3D.insertNextCell(mc.NORM_HEXA8,conn[118:126]); mesh3D.insertNextCell(mc.NORM_POLYHED,conn[126:169]); mesh3D.insertNextCell(mc.NORM_HEXA8,conn[169:177]); mesh3D.insertNextCell(mc.NORM_HEXA8,conn[177:185]); mesh3D.insertNextCell(mc.NORM_POLYHED,conn[185:228]); mesh3D.insertNextCell(mc.NORM_HEXA8,conn[228:236]);
        mesh3D.insertNextCell(mc.NORM_HEXA8,conn[236:244]); mesh3D.insertNextCell(mc.NORM_POLYHED,conn[244:287]); mesh3D.insertNextCell(mc.NORM_HEXA8,conn[287:295]); mesh3D.insertNextCell(mc.NORM_HEXA8,conn[295:303]); mesh3D.insertNextCell(mc.NORM_POLYHED,conn[303:346]); mesh3D.insertNextCell(mc.NORM_HEXA8,conn[346:354]);
-       mesh3D.finishInsertingCells();
        myCoords = mc.DataArrayDouble(coords,60,3);
        myCoords.setInfoOnComponents(["X [m]","Y [m]","Z [m]"])
        mesh3D.setCoords(myCoords);
index bf16bea1a7514633e31eb506f9733ec0e76ffb95..788093ccc015803e0e8d364a1c42e75cf68d2aad 100644 (file)
@@ -18,7 +18,6 @@ Reading, Writing a MED file using MEDLoader advanced API
        targetMesh.insertNextCell(ml.NORM_QUAD4,4,targetConn[0:4])
        targetMesh.insertNextCell(ml.NORM_QUAD4,4,targetConn[10:14])
        targetMesh.insertNextCell(ml.NORM_QUAD4,4,targetConn[14:18])
-       targetMesh.finishInsertingCells()
        myCoords = ml.DataArrayDouble(targetCoords,9,2)
        myCoords.setInfoOnComponents(["X [km]","YY [mm]"])
        targetMesh.setCoords(myCoords)
index 97cdfaf14f343b1edb00d8e0808675090364bc88..c610ae6162b871585b32851115a747690c769b07 100644 (file)
@@ -18,7 +18,6 @@ Reading, Writing a MED file using MEDLoader basic API
        targetMesh.insertNextCell(ml.NORM_QUAD4,4,targetConn[0:4])
        targetMesh.insertNextCell(ml.NORM_QUAD4,4,targetConn[10:14])
        targetMesh.insertNextCell(ml.NORM_QUAD4,4,targetConn[14:18])
-       targetMesh.finishInsertingCells()
        myCoords = ml.DataArrayDouble(targetCoords,9,2)
        myCoords.setInfoOnComponents(["X [km]","YY [mm]"])
        targetMesh.setCoords(myCoords)
index 1cabbb61d5873d4b280fdb3bd05400248f5b2cbb..3f0764385d495c5e1b638665b2b4159fda5b0b90 100644 (file)
@@ -96,7 +96,6 @@ For each hexagon of the mesh, you have to give its connectivity: the list of the
        for i in range(6):
                mesh.insertNextCell(NORM_POLYGON,6,connectivity[6*i:6*(i+1)])
                pass
-       mesh.finishInsertingCells()
        mesh.checkCoherency()
 
 Saving the mesh in a med file
index befe73a4de4fc435073843e0da3096ccef0d99a0..2564f78639e047905665d00194b834399246dc5c 100644 (file)
@@ -94,8 +94,7 @@ For each hexahedron of the mesh, you have to give its connectivity: the list of
                mesh.insertNextCell(NORM_HEXA8,8,connectivity[8*i:8*(i+1)])
                pass
                
-       # Finishing insertion
-       mesh.finishInsertingCells()
+       # Check mesh consistency:
        mesh.checkCoherency()
        
 Method by extrusion
@@ -124,7 +123,6 @@ Definition of 2D mesh
 
        for i in range(NbCell2D):
                m1.insertNextCell(NORM_QUAD4,4,Connectivities[4*i:4*(i+1)])
-       m1.finishInsertingCells()
        m1.changeSpaceDimension(3)
 
 Definition of 1D mesh
@@ -139,7 +137,6 @@ Definition of 1D mesh
        m2.insertNextCell(NORM_SEG2,2,conn[0:2])
        m2.insertNextCell(NORM_SEG2,2,conn[2:4])
        m2.insertNextCell(NORM_SEG2,2,conn[4:6])
-       m2.finishInsertingCells()
        myCoords1D=DataArrayDouble.New()
        myCoords1D.setValues(coords,4,1)
        m2.setCoords(myCoords1D)
index 841627062e52461abfde524b231cd80857d7a28d..eeb8d6d6980d2e520095f232c2f2e7c79f2c841b 100644 (file)
@@ -237,12 +237,9 @@ Now allocate the number of cells with an upper bound of the actual number of cel
 
 Finally thanks to o2n we know the connectivity of all 7 hexagons using the coordinates stored in d3.
 
-Do not forget to invoke MEDCouplingUMesh.finishInsertingCells() (this last bit should disappear after the release 6.6) ::
-
        for i in xrange(7):
          m.insertNextCell(NORM_POLYGON,o2n[6*i:6*(i+1)].getValues())
          pass
-       m.finishInsertingCells()
 
 Check that m is coherent. ::
 
index ccd3cec3465510d2c2f5909ea9adba82c47c9b40..5dae2410eb942cae20064c632f09f71ec3259f42 100644 (file)
@@ -159,7 +159,8 @@ l'agrégation de maillages et de champs respecte exactement le même principe po
 faciliter l'accès et le repérage des données. C'est par exemple une différence essentielle avec le
 modèle MED fichier comme on le verra plus tard.
 
-.. note:: La méthode similaire permettant d'agréger par composante (plutôt que par tuples) s'appelle ``Meld()``.
+.. note:: La méthode permettant d'agréger par composante (c'est-à-dire de concaténer des tableaux
+    colonne par colonne, plutôt que par tuples) s'appelle ``Meld()``.
 
 Trouver les tuples égaux
 ~~~~~~~~~~~~~~~~~~~~~~~~
@@ -311,9 +312,6 @@ des 7 hexagones utilisant les coordonnées ``d3``. ::
                cell_connec = o2n[6*i:6*(i+1)]
                m.insertNextCell(mc.NORM_POLYGON, cell_connec.getValues())
                pass
-       m.finishInsertingCells()
-
-.. note:: Après SALOME 6.6, l'appel à ``MEDCouplingUMesh.finishInsertingCells()`` n'est plus nécessaire.
 
 Vérifier que ``m`` est correct et ne contient pas d'anomalie. ::
 
index ba42a57106ca6921593ebf41af5db3af0b17ab2a..62d39c88dea32124fc35bfc3cc5854a916143f7c 100644 (file)
@@ -46,15 +46,14 @@ Copy paste the following lines. ::
               22,27,29,28,37,42,44,43, 30,41,31,33,45,56,46,48,  31,32,34,37,43,36,-1,31,46,51,36,-1,36,51,58,43,-1,43,37,52,58,-1,37,34,49,52,-1,34,32,47,49,-1,32,31,46,47,-1,46,51,58,52,49,47,
               31,36,35,33,46,51,50,48,  43,40,39,36,58,55,54,51, 41,38,37,34,32,31,-1,41,56,46,31,-1,31,46,47,32,-1,32,47,49,34,-1,34,49,52,37,-1,37,38,53,52,-1,38,41,56,53,-1,56,46,47,49,52,53,
               37,42,44,43,52,57,59,58]
-       mesh3D=MEDCouplingUMesh.New("mesh3D",3);
-       mesh3D.allocateCells(18);
+       mesh3D=MEDCouplingUMesh.New("mesh3D",3)
+       mesh3D.allocateCells(18)
        mesh3D.insertNextCell(NORM_HEXA8,conn[0:8]); mesh3D.insertNextCell(NORM_POLYHED,conn[8:51]); mesh3D.insertNextCell(NORM_HEXA8,conn[51:59]); mesh3D.insertNextCell(NORM_HEXA8,conn[59:67]); mesh3D.insertNextCell(NORM_POLYHED,conn[67:110]); mesh3D.insertNextCell(NORM_HEXA8,conn[110:118]);
        mesh3D.insertNextCell(NORM_HEXA8,conn[118:126]); mesh3D.insertNextCell(NORM_POLYHED,conn[126:169]); mesh3D.insertNextCell(NORM_HEXA8,conn[169:177]); mesh3D.insertNextCell(NORM_HEXA8,conn[177:185]); mesh3D.insertNextCell(NORM_POLYHED,conn[185:228]); mesh3D.insertNextCell(NORM_HEXA8,conn[228:236]);
        mesh3D.insertNextCell(NORM_HEXA8,conn[236:244]); mesh3D.insertNextCell(NORM_POLYHED,conn[244:287]); mesh3D.insertNextCell(NORM_HEXA8,conn[287:295]); mesh3D.insertNextCell(NORM_HEXA8,conn[295:303]); mesh3D.insertNextCell(NORM_POLYHED,conn[303:346]); mesh3D.insertNextCell(NORM_HEXA8,conn[346:354]);
-       mesh3D.finishInsertingCells();
-       myCoords=DataArrayDouble.New(coords,60,3);
+       myCoords=DataArrayDouble.New(coords,60,3)
        myCoords.setInfoOnComponents(["X [m]","Y [m]","Z [m]"])
-       mesh3D.setCoords(myCoords);
+       mesh3D.setCoords(myCoords)
        mesh3D.orientCorrectlyPolyhedrons()
        mesh3D.sortCellsInMEDFileFrmt()
        mesh3D.checkCoherency()
index 2e5fe1aead6d07953950cefd57c0ead385976bfd..74993cdc615155a0c919f6fb7cb8d34209542ea8 100644 (file)
@@ -49,15 +49,14 @@ Faire un bon gros copier-coller des lignes suivantes pour construire la mesh (l'
               22,27,29,28,37,42,44,43, 30,41,31,33,45,56,46,48,  31,32,34,37,43,36,-1,31,46,51,36,-1,36,51,58,43,-1,43,37,52,58,-1,37,34,49,52,-1,34,32,47,49,-1,32,31,46,47,-1,46,51,58,52,49,47,
               31,36,35,33,46,51,50,48,  43,40,39,36,58,55,54,51, 41,38,37,34,32,31,-1,41,56,46,31,-1,31,46,47,32,-1,32,47,49,34,-1,34,49,52,37,-1,37,38,53,52,-1,38,41,56,53,-1,56,46,47,49,52,53,
               37,42,44,43,52,57,59,58]
-       mesh3D = mc.MEDCouplingUMesh("mesh3D",3);
-       mesh3D.allocateCells(18);
+       mesh3D = mc.MEDCouplingUMesh("mesh3D",3)
+       mesh3D.allocateCells(18)
        mesh3D.insertNextCell(mc.NORM_HEXA8,conn[0:8]); mesh3D.insertNextCell(mc.NORM_POLYHED,conn[8:51]); mesh3D.insertNextCell(mc.NORM_HEXA8,conn[51:59]); mesh3D.insertNextCell(mc.NORM_HEXA8,conn[59:67]); mesh3D.insertNextCell(mc.NORM_POLYHED,conn[67:110]); mesh3D.insertNextCell(mc.NORM_HEXA8,conn[110:118]);
        mesh3D.insertNextCell(mc.NORM_HEXA8,conn[118:126]); mesh3D.insertNextCell(mc.NORM_POLYHED,conn[126:169]); mesh3D.insertNextCell(mc.NORM_HEXA8,conn[169:177]); mesh3D.insertNextCell(mc.NORM_HEXA8,conn[177:185]); mesh3D.insertNextCell(mc.NORM_POLYHED,conn[185:228]); mesh3D.insertNextCell(mc.NORM_HEXA8,conn[228:236]);
        mesh3D.insertNextCell(mc.NORM_HEXA8,conn[236:244]); mesh3D.insertNextCell(mc.NORM_POLYHED,conn[244:287]); mesh3D.insertNextCell(mc.NORM_HEXA8,conn[287:295]); mesh3D.insertNextCell(mc.NORM_HEXA8,conn[295:303]); mesh3D.insertNextCell(mc.NORM_POLYHED,conn[303:346]); mesh3D.insertNextCell(mc.NORM_HEXA8,conn[346:354]);
-       mesh3D.finishInsertingCells();
-       myCoords = mc.DataArrayDouble(coords,60,3);
+       myCoords = mc.DataArrayDouble(coords,60,3)
        myCoords.setInfoOnComponents(["X [m]","Y [m]","Z [m]"])
-       mesh3D.setCoords(myCoords);
+       mesh3D.setCoords(myCoords)
        mesh3D.orientCorrectlyPolyhedrons()
        mesh3D.sortCellsInMEDFileFrmt()
        mesh3D.checkCoherency()
@@ -251,6 +250,8 @@ Puis aggréger ``mesh3DSlice2`` avec sa copie translatée ``mesh3DSlice2bis``, e
 .. note:: Pour information pour merger deux (ou plus) maillages non structurés, il faut invoquer ``MEDCouplingUMesh.MergeUMeshes()``
        puis ``MEDCouplingUMesh.mergeNodes()`` sur le résultat, et enfin ``MEDCouplingUMesh.zipConnectivity()``.
 
+.. _exo-umesh-desc-connec:
+
 Connectivité descendante
 ~~~~~~~~~~~~~~~~~~~~~~~~
 
index 35742e5dacbce068d20c6098a08df1af7824fd6b..4e3e7472d61f041c3879ba2f63fb847f74e5f49b 100644 (file)
@@ -9,7 +9,7 @@ The following use cases can also be mentioned:
 
 * YACS, to create visualization nodes
 * create a Python mock-up script and use the standard Python interpreter whilst benefiting
-from the ParaViS graphical interface
+  from the ParaViS graphical interface
 
 Implementation start
 ~~~~~~~~~~~~~~~~~~~~
index 9f814e29703d42e32348bb80fe7a7f508a904e57..8a2f4d0b3a168a18c268c0603f756593a82256d8 100644 (file)
@@ -22,9 +22,11 @@ Each of the even cell of "m0" is "simplexized" (cut in triangles - method MEDCou
        arr=DataArrayDouble(31,1) ; arr.iota(0.)
        m0.setCoords(arr,arr)
        m0=m0.buildUnstructured()
-       m00=m0[::2] ; m00.simplexize(0) ; m01=m0[1::2]
+       m00=m0[::2]                # Extract even cells 
+       m00.simplexize(0)
+       m01=m0[1::2]
        m0=MEDCouplingUMesh.MergeUMeshes([m00,m01])
-       m0.getCoords()[:]*=1/15.
+       m0.getCoords()[:]*=1/15.   # Illustrate how to quickly rescale a mesh
        m0.setName("mesh")
 
 .. note:: The call to setName() on "m0" is mandatory. Don't forget that the correct naming of the meshes is paramount in the MED file context.
index 10e39f5dba287d11ad763bfafae1d0dd9eda12b7..18150505102a4d768c9eade332d24e5baf5f870d 100644 (file)
@@ -27,11 +27,11 @@ Chacune des cellules paires du maillage sera *simplexisée* (i.e. coupée en tri
        arr = ml.DataArrayDouble(31,1) ; arr.iota(0.)
        m0.setCoords(arr,arr)
        m0 = m0.buildUnstructured()
-       m00 = m0[::2]      # Extract even cells
+       m00 = m0[::2]                # Extract even cells
        m00.simplexize(0) 
        m01 = m0[1::2]
        m0 = ml.MEDCouplingUMesh.MergeUMeshes([m00,m01])
-       m0.getCoords()[:] *= 1/15.
+       m0.getCoords()[:] *= 1/15.   # Illustrate how to quickly rescale a mesh
        m0.setName("mesh")
 
 .. note:: Le ``setName()`` sur "m0" est obligatoire. Ne pas oublier que dans le contexte MED fichier 
index d311f870e561785215b5bb07bf98108f411853eb..5be2a6e8c39ac2755c2aaf342f346dc9edc5f7eb 100644 (file)
@@ -33,18 +33,17 @@ Writing and Reading meshes using MEDLoader's advanced API
 
 First of all, creation of a mesh "targetMesh". ::
 
-       targetCoords=[-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 ];
-        targetConn=[0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4];
-        targetMesh=MEDCouplingUMesh.New("MyMesh",2);
-        targetMesh.allocateCells(5);
-        targetMesh.insertNextCell(NORM_TRI3,3,targetConn[4:7]);
-        targetMesh.insertNextCell(NORM_TRI3,3,targetConn[7:10]);
-       targetMesh.insertNextCell(NORM_QUAD4,4,targetConn[0:4]);
-        targetMesh.insertNextCell(NORM_QUAD4,4,targetConn[10:14]);
-        targetMesh.insertNextCell(NORM_QUAD4,4,targetConn[14:18]);
-        targetMesh.finishInsertingCells();
-        myCoords=DataArrayDouble.New(targetCoords,9,2);
-        targetMesh.setCoords(myCoords);
+       targetCoords=[-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 ]
+        targetConn=[0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4]
+        targetMesh=MEDCouplingUMesh.New("MyMesh",2)
+        targetMesh.allocateCells(5)
+        targetMesh.insertNextCell(NORM_TRI3,3,targetConn[4:7])
+        targetMesh.insertNextCell(NORM_TRI3,3,targetConn[7:10])
+       targetMesh.insertNextCell(NORM_QUAD4,4,targetConn[0:4])
+        targetMesh.insertNextCell(NORM_QUAD4,4,targetConn[10:14])
+        targetMesh.insertNextCell(NORM_QUAD4,4,targetConn[14:18])
+        myCoords=DataArrayDouble.New(targetCoords,9,2)
+        targetMesh.setCoords(myCoords)
         
 
 .. note:: targetMesh is grouped by geometric type.
index 98caa012d1d857e63d03370aaadc154502ce4485..cad6678a529385ba5261bc16c7d6ce7600c90762 100644 (file)
@@ -47,7 +47,6 @@ Nous créons tout d'abord le même maillage ``targetMesh`` que pour l'API simple
        targetMesh.insertNextCell(ml.NORM_QUAD4,4,targetConn[0:4])
        targetMesh.insertNextCell(ml.NORM_QUAD4,4,targetConn[10:14])
        targetMesh.insertNextCell(ml.NORM_QUAD4,4,targetConn[14:18])
-       targetMesh.finishInsertingCells()
        myCoords = ml.DataArrayDouble(targetCoords,9,2)
        myCoords.setInfoOnComponents(["X [km]","YY [mm]"])
        targetMesh.setCoords(myCoords)        
@@ -55,7 +54,10 @@ Nous créons tout d'abord le même maillage ``targetMesh`` que pour l'API simple
 .. note:: Le maillage ``targetMesh`` est ordonné par type géométrique.
 
 Nous construisons ensuite ``targetMesh1`` représentant les sous-constituants (*faces*) du maillage
-``targetMesh`` reduits aux cellules [3,4,7,8]. Cela peut par exemple représenter un ensemble d'intérêt pour un calcul : ::
+``targetMesh``, et nous en extrayons seulement les cellules (donc ici des surfaces) [3,4,7,8]. 
+Pour plus de détails sur la connectivité descendante, 
+consulter la section :ref:`exo-umesh-desc-connec` du deuxième exercise.
+Cet ensemble peut par exemple représenter un ensemble d'intérêt pour un calcul : ::
 
        targetMeshConsti, _, _, _, _ = targetMesh.buildDescendingConnectivity()
        targetMesh1 = targetMeshConsti[[3,4,7,8]]
index 3b36f5b939edb3486e23c8ad8fb0287c1bd629c2..e202418812b639f7b09e445ba6aa14ae03d06b53 100644 (file)
@@ -28,19 +28,18 @@ Writing/Reading a mesh
 
 First of all, creation of a mesh "targetMesh". ::
 
-       targetCoords=[-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 ];
-        targetConn=[0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4];
-        targetMesh=MEDCouplingUMesh.New("MyMesh",2);
-        targetMesh.allocateCells(5);
-        targetMesh.insertNextCell(NORM_TRI3,3,targetConn[4:7]);
-        targetMesh.insertNextCell(NORM_TRI3,3,targetConn[7:10]);
-       targetMesh.insertNextCell(NORM_QUAD4,4,targetConn[0:4]);
-        targetMesh.insertNextCell(NORM_QUAD4,4,targetConn[10:14]);
-        targetMesh.insertNextCell(NORM_QUAD4,4,targetConn[14:18]);
-        targetMesh.finishInsertingCells();
-        myCoords=DataArrayDouble.New(targetCoords,9,2);
+       targetCoords=[-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 ]
+        targetConn=[0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4]
+        targetMesh=MEDCouplingUMesh.New("MyMesh",2)
+        targetMesh.allocateCells(5)
+        targetMesh.insertNextCell(NORM_TRI3,3,targetConn[4:7])
+        targetMesh.insertNextCell(NORM_TRI3,3,targetConn[7:10])
+       targetMesh.insertNextCell(NORM_QUAD4,4,targetConn[0:4])
+        targetMesh.insertNextCell(NORM_QUAD4,4,targetConn[10:14])
+        targetMesh.insertNextCell(NORM_QUAD4,4,targetConn[14:18])
+        myCoords=DataArrayDouble.New(targetCoords,9,2)
        myCoords.setInfoOnComponents(["X [km]","YY [mm]"])
-        targetMesh.setCoords(myCoords);
+        targetMesh.setCoords(myCoords)
         
 .. note:: targetMesh is ordered by geometric type.
 
index 0b4fec8d653605678a9e2072915dbc5290689f44..d542c0dc34aeccc98c23dea6cdf987c359822336 100644 (file)
@@ -44,7 +44,6 @@ Tout d'abord créons un maillage ``targetMesh`` composé de plusieurs types géo
        targetMesh.insertNextCell(ml.NORM_QUAD4,4,targetConn[0:4])
        targetMesh.insertNextCell(ml.NORM_QUAD4,4,targetConn[10:14])
        targetMesh.insertNextCell(ml.NORM_QUAD4,4,targetConn[14:18])
-       targetMesh.finishInsertingCells()
        myCoords = ml.DataArrayDouble(targetCoords,9,2)
        myCoords.setInfoOnComponents(["X [km]","YY [mm]"])
        targetMesh.setCoords(myCoords)