Salome HOME
First draft of int64.
[tools/medcoupling.git] / doc / tutorial / atestMEDCouplingLoaderEx2.rst
index 3ea615ab97fd6b564c93efe5ca878e9c476c2b57..6e08df496e7ccf0a24a749cb4734681708fb440c 100644 (file)
@@ -9,7 +9,7 @@ Intersection géométrique de maillages
        import MEDLoader as ml
        
        def displayVTK(m,fname):
-               tmp = m.deepCpy()
+               tmp = m.deepCopy()
                tmp.tessellate2D(0.1)
                tmp.writeVTK(fname)
                return
@@ -25,10 +25,10 @@ Intersection géométrique de maillages
        mobm = mobile.getMeshAtLevel(0)
        mobm.mergeNodes(1e-10)
        # Visualize fixm and mobm with PARAVIEW
-       fixm2 = fixm.deepCpy()        # tessellate2D() modifies the current mesh
+       fixm2 = fixm.deepCopy()        # tessellate2D() modifies the current mesh
        fixm2.tessellate2D(0.1)
        fixm2.writeVTK("fixm2.vtu")
-       mobm2 = mobm.deepCpy()
+       mobm2 = mobm.deepCopy()
        mobm2.tessellate2D(0.1)
        mobm2.writeVTK("mobm2.vtu")
        # mobm2 is in several pieces, take the first one
@@ -46,7 +46,7 @@ Intersection géométrique de maillages
        partFixMob, iPart, iMob = ml.MEDCouplingUMesh.Intersect2DMeshes(partFixm,zone1Mobm,1e-10)
        partFixMob.mergeNodes(1e-10)
        # Get the part of partFixm not included in zone1Mobm using partFixMob
-       ids3 = iMob.getIdsEqual(-1)
+       ids3 = iMob.findIdsEqual(-1)
        partFixmWithoutZone1Mobm = partFixMob[ids3]
        displayVTK(partFixmWithoutZone1Mobm,"partFixmWithoutZone1Mobm.vtu")
        # Check that intersection worked properly 
@@ -62,14 +62,14 @@ Intersection géométrique de maillages
        areaZone1Mobm = zone1Mobm.getMeasureField(ml.ON_CELLS).getArray()
        areaZone1Mobm.abs()
        val3 = areaZone1Mobm.accumulate()[0]
-       ids4 = iMob.getIdsNotEqual(-1)
+       ids4 = iMob.findIdsNotEqual(-1)
        areaPartFixMob2 = areaPartFixMob[ids4]
        val4 = areaPartFixMob2.accumulate()[0]
        print "Check #1 %lf == %lf with precision 1e-8 ? %s" % (val3,val4,str(abs(val3-val4)<1e-8))
        # Check #2
        isCheck2OK = True
        for icell in xrange(partFixm.getNumberOfCells()):
-           ids5 = iPart.getIdsEqual(icell)
+           ids5 = iPart.findIdsEqual(icell)
            areaOfCells = areaPartFixMob[ids5]
            areaOfCells.abs()
            if abs(areaOfCells.accumulate()[0] - areaPartFixm[icell]) > 1e-9:
@@ -79,14 +79,14 @@ Intersection géométrique de maillages
        print "Check #2? %s" % (str(isCheck2OK))
        # Indicator field creation
        f = ml.MEDCouplingFieldDouble(ml.ON_CELLS,ml.ONE_TIME)
-       m = partFixMob.deepCpy()
+       m = partFixMob.deepCopy()
        m.tessellate2D(0.1)
        f.setMesh(m)
        arr = ml.DataArrayDouble(partFixMob.getNumberOfCells(),1)
-       arr[iMob.getIdsEqual(-1)] = 0.
-       arr[iMob.getIdsNotEqual(-1)] = 1.
+       arr[iMob.findIdsEqual(-1)] = 0.
+       arr[iMob.findIdsNotEqual(-1)] = 1.
        f.setArray(arr)
-       f.checkCoherency()
+       f.checkConsistencyLight()
        f.setName("Zone")
        ml.MEDCouplingFieldDouble.WriteVTK("Zone.vtu",[f])
        # Other zones
@@ -95,21 +95,21 @@ Intersection géométrique de maillages
        partFixMob2,iPart2,iMob2 = ml.MEDCouplingUMesh.Intersect2DMeshes(partFixm,zonesMobm,1e-10)
        partFixMob2.mergeNodes(1e-10)
        f2 = ml.MEDCouplingFieldDouble(ml.ON_CELLS, ml.ONE_TIME)
-       m2 = partFixMob2.deepCpy()
+       m2 = partFixMob2.deepCopy()
        m2.tessellate2D(0.1)
        f2.setMesh(m2)
        arr = ml.DataArrayDouble(partFixMob2.getNumberOfCells(),1)
-       arr[iMob2.getIdsEqual(-1)]=0.
+       arr[iMob2.findIdsEqual(-1)]=0.
        st = 0
        end = st + len(zonesInMobm[0])
-       arr[iMob2.getIdsInRange(st,end)] = 1.
+       arr[iMob2.findIdsInRange(st,end)] = 1.
        st += len(zonesInMobm[0]) ; 
        end = st + len(zonesInMobm[1])
-       arr[iMob2.getIdsInRange(st,end)] = 2.
+       arr[iMob2.findIdsInRange(st,end)] = 2.
        st += len(zonesInMobm[1])
        end = st + len(zonesInMobm[2])
-       arr[iMob2.getIdsInRange(st,end)] = 3.
+       arr[iMob2.findIdsInRange(st,end)] = 3.
        f2.setArray(arr)
-       f2.checkCoherency()
+       f2.checkConsistencyLight()
        f2.setName("Zone2")
        ml.MEDCouplingFieldDouble.WriteVTK("Zone2.vtu",[f2])