* This method returns in the same format as code (see MEDCouplingUMesh::checkTypeConsistencyAndContig or MEDCouplingUMesh::splitProfilePerType) how
* \a this is composed in cell types.
* The returned array is of size 3*n where n is the number of different types present in \a this.
- * For every k in [0,n] ret[3*k+2]==0 because it has no sense here.
+ * For every k in [0,n] ret[3*k+2]==-1 because it has no sense here.
* This parameter is kept only for compatibility with other methode listed above.
*/
std::vector<int> MEDCoupling1GTUMesh::getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
{
std::vector<int> ret(3);
- ret[0]=(int)getCellModelEnum(); ret[1]=getNumberOfCells(); ret[2]=0;
+ ret[0]=(int)getCellModelEnum(); ret[1]=getNumberOfCells(); ret[2]=-1;
return ret;
}
std::vector<int> ret(3);
ret[0]=getTypeOfCell(0);
ret[1]=getNumberOfCells();
- ret[2]=0; //ret[3*k+2]==0 because it has no sense here
+ ret[2]=-1; //ret[3*k+2]==-1 because it has no sense here
return ret;
}
* This method returns in the same format as code (see MEDCouplingUMesh::checkTypeConsistencyAndContig or MEDCouplingUMesh::splitProfilePerType) how
* \a this is composed in cell types.
* The returned array is of size 3*n where n is the number of different types present in \a this.
- * For every k in [0,n] ret[3*k+2]==0 because it has no sense here.
+ * For every k in [0,n] ret[3*k+2]==-1 because it has no sense here.
* This parameter is kept only for compatibility with other methode listed above.
*/
std::vector<int> MEDCouplingUMesh::getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
const int *work=connI;
int nbOfCells=getNumberOfCells();
std::size_t n=getAllTypes().size();
- std::vector<int> ret(3*n,0); //ret[3*k+2]==0 because it has no sense here
+ std::vector<int> ret(3*n,-1); //ret[3*k+2]==-1 because it has no sense here
std::set<INTERP_KERNEL::NormalizedCellType> types;
for(std::size_t i=0;work!=connI+nbOfCells;i++)
{
CPPUNIT_ASSERT_EQUAL(3,(int) dis.size());
CPPUNIT_ASSERT_EQUAL((int) INTERP_KERNEL::NORM_HEXA8,dis[0]);
CPPUNIT_ASSERT_EQUAL(27,dis[1]);
- CPPUNIT_ASSERT_EQUAL(0,dis[2]);
+ CPPUNIT_ASSERT_EQUAL(-1,dis[2]);
std::vector<const DataArrayInt *> idsPerType;
- CPPUNIT_ASSERT_THROW(mesh1->checkTypeConsistencyAndContig(dis, idsPerType),INTERP_KERNEL::Exception);
- dis[2]=-1;
CPPUNIT_ASSERT(!(mesh1->checkTypeConsistencyAndContig(dis, idsPerType)));
dis[0]=(int) INTERP_KERNEL::NORM_QUAD4;
CPPUNIT_ASSERT_THROW(mesh1->checkTypeConsistencyAndContig(dis, idsPerType),INTERP_KERNEL::Exception);
CPPUNIT_ASSERT_EQUAL(6,(int)code.size());
CPPUNIT_ASSERT_EQUAL(3,code[0]);
CPPUNIT_ASSERT_EQUAL(2,code[1]);
- CPPUNIT_ASSERT_EQUAL(0,code[2]);
+ CPPUNIT_ASSERT_EQUAL(-1,code[2]);
CPPUNIT_ASSERT_EQUAL(4,code[3]);
CPPUNIT_ASSERT_EQUAL(3,code[4]);
- CPPUNIT_ASSERT_EQUAL(0,code[5]);
+ CPPUNIT_ASSERT_EQUAL(-1,code[5]);
m->decrRef();
}
self.assertEqual(1, len(dis));
self.assertEqual(NORM_HEXA8, dis[0][0]);
self.assertEqual(27, dis[0][1]);
- self.assertEqual(0, dis[0][2]);
+ self.assertEqual(-1, dis[0][2]);
- idsPerType=[]
- self.assertRaises(InterpKernelException, mesh1.checkTypeConsistencyAndContig, dis, idsPerType);
- dis[0][2]=-1;
idsPerType=[]
self.assertTrue(not mesh1.checkTypeConsistencyAndContig(dis, idsPerType));
dis[0][0]=NORM_QUAD4;
self.assertEqual(2,len(code));
self.assertEqual(3,code[0][0]);
self.assertEqual(2,code[0][1]);
- self.assertEqual(0,code[0][2]);
+ self.assertEqual(-1,code[0][2]);
self.assertEqual(4,code[1][0]);
self.assertEqual(3,code[1][1]);
- self.assertEqual(0,code[1][2]);
+ self.assertEqual(-1,code[1][2]);
pass
def testNorm2_1(self):
self.assertEqual(m.getTypeOfCell(3),NORM_QUAD4)
self.assertRaises(InterpKernelException,m.getTypeOfCell,5)
self.assertEqual(m.getAllGeoTypes(),[NORM_QUAD4])
- self.assertEqual(m.getDistributionOfTypes(),[[NORM_QUAD4,5,0]])
+ self.assertEqual(m.getDistributionOfTypes(),[[NORM_QUAD4,5,-1]])
##
pfl1=DataArrayInt([1,3,4])
a,b,c=m.splitProfilePerType(pfl1)