coords=[0.33312787792955395, -0.35155740179580952, -0.03567564825034563, 1.307146326477638, -0.57234557776250305, -0.08608044208272235, 0.5551834466499993, 0.62324964668794192, -0.014638951108536295, 0.37761817224442129, -0.38324019806913578, 0.96283164472856886, 0.79494856035658679, -0.40628057809270046, 0.0021004190225864614, 1.023740446371799, 0.07665912970471335, -0.072889657161871096, 0.54564584619517376, 0.11132872093429744, 0.039647326652013051, 0.27164784387819052, -0.42018012100866675, 0.46563376500745146, 0.89501965094896418, -0.56148455362735061, 0.43337469695473035, 0.49118025152924394, 0.093884938060727313, 0.47216346905220891]
conn=[0,1,2,3,4,5,6,7,8,9]
coo=DataArrayDouble.New();
- coo.setValues(coords,10,3);
+ coo.setValues(coords,10,3);
m.setCoords(coo);
m.allocateCells(1);
m.insertNextCell(NORM_TETRA10,10,conn[0:10])
m.finishInsertingCells();
#
- f=MEDCouplingFieldDouble(ON_NODES,ONE_TIME);
+ f=MEDCouplingFieldDouble.New(ON_NODES,ONE_TIME);
f.setMesh(m);
- da=DataArrayDouble([1.1,2.1,3.1,4.1, 0,0,0,0,0]);
+ da=DataArrayDouble.New();
+ vals1=[1.1,2.1,3.1,4.1,5.2,6.2,7.2,8.2,9.2,10.2]
+ da.setValues(vals1,10,1);
f.setArray(da);
+ f.checkConsistencyLight()
#
loc=[0.64637931739890486, -0.16185896817550552, 0.22678966365273748]
- # Localisation on quadratic cells not supported:
- self.assertRaises(InterpKernelException, f.getValueOnMulti,loc);
-
- # Localisation on linear 3D cell:
- m.setConnectivity(DataArrayInt([NORM_TETRA4, 0,1,2,3]), DataArrayInt([0,5]))
- f2=MEDCouplingFieldDouble(ON_NODES,ONE_TIME);
- f2.setMesh(m);
- da=DataArrayDouble([1.1,2.1,3.1,4.1])
- f2.setArray(da);
- locs2 = f2.getValueOnMulti(loc)
-
- self.assertAlmostEqual(2.68,locs2.getIJ(0,0),12);
+ locs=f.getValueOnMulti(loc);
+ expected1=[10.0844021968047]
+ for i in range(1):
+ self.assertAlmostEqual(expected1[i],locs.getIJ(0,i),12);
+ pass
pass
def testGetValueOn2(self):