from math import *
- # Definition of environnement variables
+ # Definition of environment variables
spaceDimension = 3
N = 4
nbOfNodes = N*N*N
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
myCoords = DataArrayDouble.New()
myCoords.setValues(coordinates,nbOfNodes,3)
mesh.setCoords(myCoords)
- mesh.checkCoherency()
+ mesh.checkConsistencyLight()
print "6 ********************"
# Extraction of surfacic meshing
mesh2D = mesh.buildFacePartOfMySelfNode(nodes,True)
#print mesh2D
mesh2D.setName("3Dcube")
- mesh2D.checkCoherency()
+ mesh2D.checkConsistencyLight()
print "7 ********************"
# Creation of field : with following definition
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(i+1,1)
fBF = MEDCouplingFieldDouble.New(ON_CELLS)
fBF.setMesh(mesh2D)
fBF.setName("fieldBottomFace")
- fBF.setNature(Integral)
+ fBF.setNature(ExtensiveMaximum)
Cval = 10.
myCoords2D=DataArrayDouble.New()
sampleTab=[]
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)