Salome HOME
Intersection: renaming some variables and refactor to make the algo easier to read.
[tools/medcoupling.git] / doc / tutorial / medcoupling_3Dcube.rst
index befe73a4de4fc435073843e0da3096ccef0d99a0..de10a56b9f5ed5edd3c2452a9a806ff38c632255 100644 (file)
@@ -39,13 +39,13 @@ You must define 3 variables for space dimension, number of nodes on each dimensi
 Classical method
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-First instanciate a meshing object. Therefore, we need to define :
+First instantiate a meshing object. Therefore, we need to define :
 
  * its name
  * its dimension
  * its number of cells
 
-.. note:: All this initialisation are necessary. If one lacks, you will have a segmentation fault!.
+.. note:: All this initialisation is necessary. If one is missing, you'll have a segmentation fault!.
 
 ::
 
@@ -94,9 +94,8 @@ 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()
-       mesh.checkCoherency()
+       # Check mesh consistency:
+       mesh.checkConsistencyLight()
        
 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)
@@ -251,7 +248,7 @@ First you need to create a CouplingField and initialize some data:
  * its values
 
  
-The field will be a sin function dependant of distance of the barycenter of each cell from origin. So we need to create a barycenter field on the 3D mesh::
+The field will be a sin function dependent of distance of the barycenter of each cell from origin. So we need to create a barycenter field on the 3D mesh::
 
        # Creation of field : with following definition
        # => Definition of the mesh support
@@ -260,12 +257,12 @@ The field will be a sin function dependant of distance of the barycenter of each
        field = MEDCouplingFieldDouble.New(ON_CELLS)
        field.setMesh(mesh)
        field.setName("field")
-       field.setNature(Integral)
+       field.setNature(ExtensiveMaximum)
 
        # Computing and setting field values
        myCoords=DataArrayDouble.New()
        sampleTab=[]
-       bar = mesh.getBarycenterAndOwner()
+       bar = mesh.computeCellCenterOfMass()
        print bar.getNbOfElems()
        for i in range(nbOfCells):
                x = bar.getIJ(...)
@@ -293,7 +290,7 @@ General Case
 Multi mesh Case
 ````````````````
 
-In spite of a MEDCoupling mesh has only one dimension, it's possible to genrate a file with multi dimension.
+In spite of a MEDCoupling mesh has only one dimension, it's possible to generate a file with multi dimension.
 Therefore, you need to create as meshes as necessary dimensions.
 
 You have to give the connectivity of the faces on the bottom face of the 3D cube: the list of the nodes which belong to the face.
@@ -310,7 +307,7 @@ The connectivity must respect following figure:
        mesh2D = mesh.buildFacePartOfMySelfNode(nodes,True)
        #print mesh2D
        mesh2D.setName("3Dcube")
-       mesh2D.checkCoherency()
+       mesh2D.checkConsistencyLight()
        
        medFileName = "MEDCoupling_cube3D.med"
        meshes=[mesh2D,mesh]