{ stream << std::endl << "No coordinates set !"; return ; }
if(!coo->isAllocated())
{ stream << std::endl << "Coordinates set but not allocated !"; return ; }
- int nbOfCompo=coo->getNumberOfComponents();
- if(nbOfCompo!=(int)_structure.size())
+ int nbOfCompo(coo->getNumberOfComponents());
+ int nbOfCompoExp(-1);
+ try
+ {
+ nbOfCompoExp=getSpaceDimension();
+ }
+ catch(INTERP_KERNEL::Exception& e)
+ {
+ }
+ if(nbOfCompo!=nbOfCompoExp)
{ stream << std::endl << "Coordinates set and allocated but mismatch number of components !"; return ; }
stream << std::endl << "Coordinates ( number of tuples = " << coo->getNumberOfTuples() << " ) : ";
coo->reprQuickOverviewData(stream,200);
self.assertEqual(indRef,list(graph.getIndexArray().getValues()));
pass
+ def testSwig2MEDCouplingCurveLinearReprQuick1(self):
+ """Non regression test. Error in m.__str__ when m is a MEDCouplingCurveLinear with spaceDim != meshDim."""
+ arr=DataArrayDouble(12) ; arr.iota() ; arr.rearrange(2)
+ m=MEDCouplingCurveLinearMesh()
+ m.setCoords(arr)
+ m.setNodeGridStructure([3,2])
+ m.checkCoherency()
+ self.assertEqual(m.getMeshDimension(),2)
+ self.assertEqual(m.getSpaceDimension(),2)
+ self.assertTrue(not "mismatch" in m.__str__())
+ self.assertTrue(not "mismatch" in m.__repr__())
+ #
+ arr=DataArrayDouble(18) ; arr.iota() ; arr.rearrange(3)
+ m.setCoords(arr)
+ self.assertEqual(m.getMeshDimension(),2)
+ self.assertEqual(m.getSpaceDimension(),3)
+ self.assertTrue(not "mismatch" in m.__str__())
+ self.assertTrue(not "mismatch" in m.__repr__())# bug was here !
+ pass
+
pass
if __name__ == '__main__':