MEDLoaderBase::safeStrCpy(_name.c_str(),MED_NAME_SIZE,maa,_too_long_str);
MEDLoaderBase::safeStrCpy(_desc_name.c_str(),MED_COMMENT_SIZE,desc,_too_long_str);
int spaceDim=coo?coo->getNumberOfComponents():0;
- int mdim=getMeshDimension();
+ int mdim(0);
+ if(!_ms.empty())
+ mdim=getMeshDimension();
INTERP_KERNEL::AutoPtr<char> comp=MEDLoaderBase::buildEmptyString(spaceDim*MED_SNAME_SIZE);
INTERP_KERNEL::AutoPtr<char> unit=MEDLoaderBase::buildEmptyString(spaceDim*MED_SNAME_SIZE);
for(int i=0;i<spaceDim;i++)
self.assertTrue(fs[1][0].getUndergroundDataArray().isEqual(arr,1e-12))
pass
+ def testMEDFileWithoutCells1(self):
+ fileName="Pyfile83.med"
+ coo=DataArrayDouble([(0,0,0),(1,0,0),(2,0,0)])
+ coo.setInfoOnComponents(["aa [m]","bbb [s]","cccc [m/s]"])
+ mm=MEDFileUMesh()
+ mm.setCoords(coo)
+ mm.setName("mesh")
+ mm.write(fileName,2)
+ #
+ mm=MEDFileMesh.New(fileName)
+ self.assertEqual(mm.getName(),"mesh")
+ self.assertTrue(mm.getCoords().isEqual(coo,1e-12))
+ pass
+
pass
unittest.main()