const double *val=fieldOnNodes->getArray()->getConstPointer();
for(int i=0;i<64;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[i],val[i],1e-12);
- double res;
- fieldOnNodes->getValueOnPos(1,3,2,&res);
- CPPUNIT_ASSERT_DOUBLES_EQUAL(7.,res,1e-12);
+ double res[1]; //size fieldOnNodes->getNumberOfComponents()
+ fieldOnNodes->getValueOnPos(1,3,2,&res[0]);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(7.,res[0],1e-12);
fieldOnNodes->decrRef();
//
MEDCouplingFieldDouble *fieldOnCells=mesh->fillFromAnalytic(ON_CELLS,1,"x+y/2.+z/3.");
6, 4.5, 6, 7.5, 3, 4.5, 6, 4.5, 6, 7.5, 6, 7.5, 9};
for(int i=0;i<27;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected2[i],val[i],1e-12);
- fieldOnCells->getValueOnPos(1,2,1,&res);
- CPPUNIT_ASSERT_DOUBLES_EQUAL(6.,res,1e-12);
+ fieldOnCells->getValueOnPos(1,2,1,&res[0]);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(6.,res[0],1e-12);
fieldOnCells->decrRef();
//
MEDCouplingMesh* meshDeepCopy=mesh->deepCpy();
mesh2d.setCoords(coordsX1, coordsY1);
f1=mesh2d.buildOrthogonalField();
- """Serialization tested with corba
- tinyInfoD, tinyInfo, littleStrings=mesh2d.getTinySerializationInformation();
- self.assertEqual(5,len(tinyInfo));
- self.assertEqual(4,tinyInfo[0]); #x
- self.assertEqual(4,tinyInfo[1]); #y
- self.assertEqual(-1,tinyInfo[2]); #z
- self.assertEqual(-1,tinyInfo[3]); #it
- self.assertEqual(-1,tinyInfo[4]); #order
- self.assertAlmostEqual(0.,tinyInfoD[0],14); #time
- d1=DataArrayInt.New();
- d2=DataArrayDouble.New();
- mesh2d.resizeForUnserialization(tinyInfo, d1, d2, littleStrings);
- self.assertEqual(0,d1.getNumberOfTuples());
- self.assertEqual(8,d2.getNumberOfTuples());
- """
pass
def testScale(self):