NORM_HEXGP12 = 22,
NORM_PYRA13 = 23,
NORM_PENTA15 = 25,
+ NORM_PENTA18 = 28,
NORM_HEXA20 = 30,
NORM_HEXA27 = 27,
NORM_POLYHED = 31,
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// Author : Anthony Geay (CEA/DEN)
+// Author : Anthony Geay (EDF R&D)
#include "CellModel.hxx"
"NORM_SEG4", "", "", "", "NORM_TETRA4",//10->14
"NORM_PYRA5", "NORM_PENTA6", "", "NORM_HEXA8", "",//15->19
"NORM_TETRA10", "", "NORM_HEXGP12", "NORM_PYRA13", "",//20->24
- "NORM_PENTA15", "", "NORM_HEXA27", "", "",//25->29
+ "NORM_PENTA15", "", "NORM_HEXA27", "", "NORM_PENTA18",//25->29
"NORM_HEXA20", "NORM_POLYHED", "NORM_QPOLYG", "NORM_POLYL", "",//30->34
"", "", "", "", "",//35->39
"NORM_ERROR"};
_map_of_unique_instance.insert(std::make_pair(NORM_HEXGP12,CellModel(NORM_HEXGP12)));
_map_of_unique_instance.insert(std::make_pair(NORM_PYRA13,CellModel(NORM_PYRA13)));
_map_of_unique_instance.insert(std::make_pair(NORM_PENTA15,CellModel(NORM_PENTA15)));
+ _map_of_unique_instance.insert(std::make_pair(NORM_PENTA18,CellModel(NORM_PENTA18)));
_map_of_unique_instance.insert(std::make_pair(NORM_HEXA20,CellModel(NORM_HEXA20)));
_map_of_unique_instance.insert(std::make_pair(NORM_HEXA27,CellModel(NORM_HEXA27)));
_map_of_unique_instance.insert(std::make_pair(NORM_POLYGON,CellModel(NORM_POLYGON)));
_little_sons_con[8][0]=2; _little_sons_con[8][1]=5; _little_sons_con[8][2]=14;
}
break;
+ case NORM_PENTA18:
+ {
+ _nb_of_pts=18; _nb_of_sons=5; _dim=3; _linear_type=NORM_PENTA6; _is_simplex=false;
+ _sons_type[0]=NORM_TRI6; _sons_type[1]=NORM_TRI6; _sons_type[2]=NORM_QUAD9; _sons_type[3]=NORM_QUAD9; _sons_type[4]=NORM_QUAD9;
+ _sons_con[0][0]=0; _sons_con[0][1]=1; _sons_con[0][2]=2; _sons_con[0][3]=6; _sons_con[0][4]=7; _sons_con[0][5]=8; _nb_of_sons_con[0]=6;
+ _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; _sons_con[2][8]=15; _nb_of_sons_con[2]=9;
+ _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; _sons_con[3][8]=16; _nb_of_sons_con[3]=9;
+ _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; _sons_con[4][8]=17; _nb_of_sons_con[4]=9; _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;
+ _little_sons_con[3][0]=3; _little_sons_con[3][1]=4; _little_sons_con[3][2]=9;
+ _little_sons_con[4][0]=4; _little_sons_con[4][1]=5; _little_sons_con[4][2]=10;
+ _little_sons_con[5][0]=5; _little_sons_con[5][1]=3; _little_sons_con[5][2]=11;
+ _little_sons_con[6][0]=0; _little_sons_con[6][1]=3; _little_sons_con[6][2]=12;
+ _little_sons_con[7][0]=1; _little_sons_con[7][1]=4; _little_sons_con[7][2]=13;
+ _little_sons_con[8][0]=2; _little_sons_con[8][1]=5; _little_sons_con[8][2]=14;
+ }
+ break;
case NORM_HEXA20:
{
_nb_of_pts=20; _nb_of_sons=6; _dim=3; _linear_type=NORM_HEXA8; _is_simplex=false;
case INTERP_KERNEL::NORM_PENTA6 :
case INTERP_KERNEL::NORM_PENTA15 :
+ case INTERP_KERNEL::NORM_PENTA18 :
{
int N1 = OTT<ConnType,numPol>::coo2C(connec[0]);
int N2 = OTT<ConnType,numPol>::coo2C(connec[1]);
/// @cond INTERNAL
const INTERP_KERNEL::NormalizedCellType MEDCouplingUMesh::MEDMEM_ORDER[N_MEDMEM_ORDER] = { INTERP_KERNEL::NORM_POINT1, INTERP_KERNEL::NORM_SEG2, INTERP_KERNEL::NORM_SEG3, INTERP_KERNEL::NORM_SEG4, INTERP_KERNEL::NORM_POLYL, INTERP_KERNEL::NORM_TRI3, INTERP_KERNEL::NORM_QUAD4, INTERP_KERNEL::NORM_TRI6, INTERP_KERNEL::NORM_TRI7, INTERP_KERNEL::NORM_QUAD8, INTERP_KERNEL::NORM_QUAD9, INTERP_KERNEL::NORM_POLYGON, INTERP_KERNEL::NORM_QPOLYG, INTERP_KERNEL::NORM_TETRA4, INTERP_KERNEL::NORM_PYRA5, INTERP_KERNEL::NORM_PENTA6, INTERP_KERNEL::NORM_HEXA8, INTERP_KERNEL::NORM_HEXGP12, INTERP_KERNEL::NORM_TETRA10, INTERP_KERNEL::NORM_PYRA13, INTERP_KERNEL::NORM_PENTA15, INTERP_KERNEL::NORM_HEXA20, INTERP_KERNEL::NORM_HEXA27, INTERP_KERNEL::NORM_POLYHED };
-const int MEDCouplingUMesh::MEDCOUPLING2VTKTYPETRADUCER[INTERP_KERNEL::NORM_MAXTYPE+1]={1,3,21,5,9,7,22,34,23,28,-1,-1,-1,-1,10,14,13,-1,12,-1,24,-1,16,27,-1,26,-1,29,-1,-1,25,42,36,4};
+const int MEDCouplingUMesh::MEDCOUPLING2VTKTYPETRADUCER[INTERP_KERNEL::NORM_MAXTYPE+1]={1,3,21,5,9,7,22,34,23,28,-1,-1,-1,-1,10,14,13,-1,12,-1,24,-1,16,27,-1,26,-1,29,32,-1,25,42,36,4};
/// @endcond
MEDCouplingUMesh *MEDCouplingUMesh::New()
level3(self)
gtumesh(self)
pass
+
+ def testPenta18_1(self):
+ arr=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),
+ (0.,0.5,0.5),(0.5,0.,0.5),(0.5,0.5,0.5)])
+ m=MEDCouplingUMesh("mesh",3)
+ m.setCoords(arr)
+ m.allocateCells(1)
+ m.insertNextCell(NORM_PENTA18,list(range(18)))
+ m.checkConsistencyLight()
+ self.assertTrue(m.getMeasureField(True).getArray().isEqual(DataArrayDouble([0.5]),1e-12))
+ #
+ f=MEDCouplingFieldDouble(ON_NODES)
+ f.setMesh(m)
+ f.setName("FieldOnPenta18")
+ f.setArray(DataArrayDouble(list(range(18))))
+ f.checkConsistencyLight()
+ #
+ m2,d,di,rd,rdi=m.buildDescendingConnectivity()
+ self.assertTrue(m2.getNodalConnectivity().isEqual(DataArrayInt([6,0,1,2,6,7,8,6,3,5,4,11,10,9,9,0,3,4,1,12,9,13,6,15,9,1,4,5,2,13,10,14,7,16,9,2,4,5,0,14,11,12,8,17])))
+ self.assertTrue(m2.getNodalConnectivityIndex().isEqual(DataArrayInt([0,7,14,24,34,44])))
+ self.assertTrue(d.isEqual(DataArrayInt([0,1,2,3,4])))
+ self.assertTrue(di.isEqual(DataArrayInt([0,5])))
+ self.assertTrue(rd.isEqual(DataArrayInt([0,0,0,0,0])))
+ self.assertTrue(rdi.isEqual(DataArrayInt([0,1,2,3,4,5])))
+ #
+ f2=MEDCouplingFieldDouble(ON_NODES)
+ f2.setMesh(m)
+ f2.setName("FieldOnPenta18Sub")
+ f2.setArray(DataArrayDouble(list(range(18))))
+ f2.checkConsistencyLight()
+ pass
+
pass
if __name__ == '__main__':
using namespace MEDCoupling;
const unsigned char MEDMeshMultiLev::PARAMEDMEM_2_VTKTYPE[MEDMeshMultiLev::PARAMEDMEM_2_VTKTYPE_LGTH]=
-{1,3,21,5,9,7,22,34,23,28,35,255,255,255,10,14,13,255,12,255,24,255,16,27,255,26,255,29,255,255,25,42,36,4};
+{1,3,21,5,9,7,22,34,23,28,35,255,255,255,10,14,13,255,12,255,24,255,16,27,255,26,255,29,32,255,25,42,36,4};
const unsigned char MEDMeshMultiLev::HEXA27_PERM_ARRAY[27]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,24,22,21,23,20,25,26};
MED_TETRA10,
MED_PYRA13,
MED_PENTA15,
+ // MED_PENTA18,
MED_HEXA20,
MED_HEXA27,
MED_POLYGON,
INTERP_KERNEL::NORM_TETRA10,
INTERP_KERNEL::NORM_PYRA13,
INTERP_KERNEL::NORM_PENTA15,
+ // INTERP_KERNEL::NORM_PENTA18,
INTERP_KERNEL::NORM_HEXA20,
INTERP_KERNEL::NORM_HEXA27,
INTERP_KERNEL::NORM_POLYGON,
MED_PENTA15,//25
MED_NONE,//26
MED_HEXA27,//27
- MED_NONE,//28
+ MED_NONE,//28 MED_PENTA18
MED_NONE,//29
MED_HEXA20,//30
MED_POLYHEDRON,//31