From d48833c440686b64212920d5a4816364319664df Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Mon, 31 May 2021 14:25:54 +0200 Subject: [PATCH] Fix of reference connectivity of faces of PENTA15 cell from Roberto Da Via --- src/INTERP_KERNEL/CellModel.cxx | 2 +- .../MEDCouplingBasicsTest7.py | 27 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/INTERP_KERNEL/CellModel.cxx b/src/INTERP_KERNEL/CellModel.cxx index 273a1a420..96b97b2f5 100644 --- a/src/INTERP_KERNEL/CellModel.cxx +++ b/src/INTERP_KERNEL/CellModel.cxx @@ -351,7 +351,7 @@ namespace INTERP_KERNEL _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; diff --git a/src/MEDCoupling_Swig/MEDCouplingBasicsTest7.py b/src/MEDCoupling_Swig/MEDCouplingBasicsTest7.py index 70dfa7bf1..7af9a27e0 100644 --- a/src/MEDCoupling_Swig/MEDCouplingBasicsTest7.py +++ b/src/MEDCoupling_Swig/MEDCouplingBasicsTest7.py @@ -965,6 +965,33 @@ class MEDCouplingBasicsTest7(unittest.TestCase): 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 -- 2.39.2