_sons_con[1][0]=3; _sons_con[1][1]=5; _sons_con[1][2]=4; _sons_con[1][3]=11; _sons_con[1][4]=10; _sons_con[1][5]=9; _nb_of_sons_con[1]=6;
_sons_con[2][0]=0; _sons_con[2][1]=3; _sons_con[2][2]=4; _sons_con[2][3]=1; _sons_con[2][4]=12; _sons_con[2][5]=9; _sons_con[2][6]=13; _sons_con[2][7]=6; _nb_of_sons_con[2]=8;
_sons_con[3][0]=1; _sons_con[3][1]=4; _sons_con[3][2]=5; _sons_con[3][3]=2; _sons_con[3][4]=13; _sons_con[3][5]=10; _sons_con[3][6]=14; _sons_con[3][7]=7; _nb_of_sons_con[3]=8;
- _sons_con[4][0]=2; _sons_con[4][1]=4; _sons_con[4][2]=5; _sons_con[4][3]=0; _sons_con[4][4]=14; _sons_con[4][5]=11; _sons_con[4][6]=12; _sons_con[4][7]=8; _nb_of_sons_con[4]=8; _quadratic=true;
+ _sons_con[4][0]=2; _sons_con[4][1]=5; _sons_con[4][2]=3; _sons_con[4][3]=0; _sons_con[4][4]=14; _sons_con[4][5]=11; _sons_con[4][6]=12; _sons_con[4][7]=8; _nb_of_sons_con[4]=8; _quadratic=true;
_little_sons_con[0][0]=0; _little_sons_con[0][1]=1; _little_sons_con[0][2]=6; _nb_of_little_sons=9;
_little_sons_con[1][0]=1; _little_sons_con[1][1]=2; _little_sons_con[1][2]=7;
_little_sons_con[2][0]=2; _little_sons_con[2][1]=0; _little_sons_con[2][2]=8;
m = MEDCouplingCMesh() ; m.setCoords(arr,arr,arr) ; m=m.buildUnstructured()
self.assertTrue( m.computeMeshCenterOfMass().isEqual(DataArrayDouble([2,2,2],1,3),1e-12) )
+ def testBugPenta15_0(self):
+ """
+ Non regression test from Roberto Da Via pointing error in connectivity of 5th sub face of penta15 cell.
+ """
+ coo=DataArrayDouble([
+ (0,1,1),(0,0,1),(1,0,1),
+ (0,1,0),(0,0,0),(1,0,0),
+ (0,0.5,1),(0.5,0,1),(0.5,0.5,1),
+ (0,0.5,0),(0.5,0,0),(0.5,0.5,0),
+ (0,1,0.5),(0,0,0.5),(1,0,0.5)
+ ])
+
+ m = MEDCouplingUMesh("penta15",3)
+ m.setCoords(coo)
+ m.allocateCells()
+ m.insertNextCell(NORM_PENTA15,list(range(15)))
+ bm = m.buildBoundaryMesh(True)
+ bm.writeVTK("boundary.vtu")
+ conn_expected = [
+ [6, 0, 1, 2, 6, 7, 8],
+ [6, 3, 5, 4, 11, 10, 9],
+ [8, 0, 3, 4, 1, 12, 9, 13, 6],
+ [8, 1, 4, 5, 2, 13, 10, 14, 7],
+ [8, 2, 5, 3, 0, 14, 11, 12, 8] # old = [8, 2, 4, 5, 0, 14, 11, 12, 8]
+ ]
+ self.assertTrue( bm.getNodalConnectivity().isEqual(DataArrayInt(sum(conn_expected,[]))) )
+
pass