Back to index

salome-med  6.5.0
Classes | Functions
MEDCouplingCorbaSwigTest Namespace Reference

Classes

class  MEDCouplingCorbaServBasicsTest

Functions

def testMesh
def testField

Function Documentation

Definition at line 588 of file MEDCouplingCorbaSwigTest.py.

00588 
00589 def testField():
00590     #
00591     mesh=testMesh()
00592     nbOfCells=mesh.getNumberOfCells()
00593     field=MEDCouplingFieldDouble.New(ON_CELLS)
00594     field.setMesh(mesh)
00595     field.setNature(Integral)
00596     myCoords=DataArrayDouble.New()
00597     sampleTab=[]
00598     for i in range(nbOfCells*9):
00599         sampleTab.append(float(i))
00600         myCoords.setValues(sampleTab,nbOfCells,9);
00601         pass
00602     field.setArray(myCoords)
00603     return field
00604 

Here is the call graph for this function:

Definition at line 560 of file MEDCouplingCorbaSwigTest.py.

00560 
00561 def testMesh():
00562     tab4=[1, 2, 8, 7, 2, 3, 9, 8, 3,
00563           4, 10, 9, 4, 5, 11, 10, 5,
00564           0, 6, 11, 0, 1, 7, 6 ]
00565     nbOfNodes=12
00566     nbOfCells=6
00567     coords=[ 0.024155, 0.04183768725682622, -0.305, 0.04831000000000001, -1.015761910347357e-17,
00568              -0.305, 0.09662000000000001, -1.832979297858306e-18, -0.305, 0.120775, 0.04183768725682623,
00569              -0.305, 0.09662000000000001, 0.08367537451365245, -0.305, 0.04831000000000001, 0.08367537451365246,
00570              -0.305, 0.024155, 0.04183768725682622, -0.2863, 0.04831000000000001, -1.015761910347357e-17, -0.2863, 
00571              0.09662000000000001, -1.832979297858306e-18, -0.2863, 0.120775, 0.04183768725682623, -0.2863, 0.09662000000000001,
00572              0.08367537451365245, -0.2863, 0.04831000000000001, 0.08367537451365246, -0.2863 ]
00573     mesh=MEDCouplingUMesh.New()
00574     mesh.setMeshDimension(2)
00575     mesh.allocateCells(8);
00576     mesh.setName("mesh1")
00577     for i in range(nbOfCells):
00578         mesh.insertNextCell(NORM_QUAD4,4,tab4[4*i:4*(i+1)]);
00579         pass
00580     mesh.finishInsertingCells()
00581     myCoords=DataArrayDouble.New()
00582     myCoords.setValues(coords,nbOfNodes,3);
00583     mesh.setCoords(myCoords);
00584     mesh.checkCoherency();
00585     myFalseConn=DataArrayInt.New()
00586     myFalseConn.setValues(tab4,6,4)
00587     return mesh

Here is the caller graph for this function: