Commit 8e3ec804 authored by Kenneth Leiter's avatar Kenneth Leiter Committed by David Partyka
Browse files

ENH: Apply Antonio's patch to implement quad9 support into Xdmf.

parent 92b3bb22
......@@ -26,7 +26,7 @@
<!--Describes the general organization of the data-->
<!ELEMENT Topology (Information*, DataItem*)>
<!ATTLIST Topology
TopologyType (Polyvertex | Polyline | Polygon | Triangle | Quadrilateral | Tetrahedron | Pyramid| Wedge | Hexahedron | Edge_3 | Triagle_6 | Quadrilateral_8 | Tetrahedron_10 | Pyramid_13 | Wedge_15 | Hexahedron_20 | Mixed | 2DSMesh | 2DRectMesh | 2DCoRectMesh | 3DSMesh | 3DRectMesh | 3DCoRectMesh) #REQUIRED
TopologyType (Polyvertex | Polyline | Polygon | Triangle | Quadrilateral | Tetrahedron | Pyramid| Wedge | Hexahedron | Edge_3 | Triagle_6 | Quadrilateral_8 | Quadrilateral_9 | Tetrahedron_10 | Pyramid_13 | Wedge_15 | Hexahedron_20 | Mixed | 2DSMesh | 2DRectMesh | 2DCoRectMesh | 3DSMesh | 3DRectMesh | 3DCoRectMesh) #REQUIRED
Dimensions CDATA #IMPLIED
Order CDATA #IMPLIED
BaseOffset CDATA "0"
......
......@@ -947,6 +947,7 @@ XDMF_HEX = _Xdmf.XDMF_HEX
XDMF_EDGE_3 = _Xdmf.XDMF_EDGE_3
XDMF_TRI_6 = _Xdmf.XDMF_TRI_6
XDMF_QUAD_8 = _Xdmf.XDMF_QUAD_8
XDMF_QUAD_9 = _Xdmf.XDMF_QUAD_9
XDMF_TET_10 = _Xdmf.XDMF_TET_10
XDMF_PYRAMID_13 = _Xdmf.XDMF_PYRAMID_13
XDMF_WEDGE_15 = _Xdmf.XDMF_WEDGE_15
......
......@@ -932,6 +932,7 @@ XDMF_HEX = _Xdmf.XDMF_HEX
XDMF_EDGE_3 = _Xdmf.XDMF_EDGE_3
XDMF_TRI_6 = _Xdmf.XDMF_TRI_6
XDMF_QUAD_8 = _Xdmf.XDMF_QUAD_8
XDMF_QUAD_9 = _Xdmf.XDMF_QUAD_9
XDMF_TET_10 = _Xdmf.XDMF_TET_10
XDMF_PYRAMID_13 = _Xdmf.XDMF_PYRAMID_13
XDMF_WEDGE_15 = _Xdmf.XDMF_WEDGE_15
......
......@@ -34723,6 +34723,7 @@ SWIG_init(void) {
SWIG_Python_SetConstant(d, "XDMF_EDGE_3",SWIG_From_int(static_cast< int >(0x0022)));
SWIG_Python_SetConstant(d, "XDMF_TRI_6",SWIG_From_int(static_cast< int >(0x0024)));
SWIG_Python_SetConstant(d, "XDMF_QUAD_8",SWIG_From_int(static_cast< int >(0x0025)));
SWIG_Python_SetConstant(d, "XDMF_QUAD_9",SWIG_From_int(static_cast< int >(0x0023)));
SWIG_Python_SetConstant(d, "XDMF_TET_10",SWIG_From_int(static_cast< int >(0x0026)));
SWIG_Python_SetConstant(d, "XDMF_PYRAMID_13",SWIG_From_int(static_cast< int >(0x0027)));
SWIG_Python_SetConstant(d, "XDMF_WEDGE_15",SWIG_From_int(static_cast< int >(0x0028)));
......@@ -33679,6 +33679,7 @@ SWIG_init(void) {
SWIG_Python_SetConstant(d, "XDMF_EDGE_3",SWIG_From_int(static_cast< int >(0x0022)));
SWIG_Python_SetConstant(d, "XDMF_TRI_6",SWIG_From_int(static_cast< int >(0x0024)));
SWIG_Python_SetConstant(d, "XDMF_QUAD_8",SWIG_From_int(static_cast< int >(0x0025)));
SWIG_Python_SetConstant(d, "XDMF_QUAD_9",SWIG_From_int(static_cast< int >(0x0023)));
SWIG_Python_SetConstant(d, "XDMF_TET_10",SWIG_From_int(static_cast< int >(0x0026)));
SWIG_Python_SetConstant(d, "XDMF_PYRAMID_13",SWIG_From_int(static_cast< int >(0x0027)));
SWIG_Python_SetConstant(d, "XDMF_WEDGE_15",SWIG_From_int(static_cast< int >(0x0028)));
......@@ -178,8 +178,12 @@ if ( XDMF_WORD_CMP( topologyType, "NOTOPOLOGY") ){
newTopologyType = XDMF_TRI_6;
} else if( XDMF_WORD_CMP( topologyType, "QUAD_8") ){
newTopologyType = XDMF_QUAD_8;
} else if( XDMF_WORD_CMP( topologyType, "QUAD_9") ){
newTopologyType = XDMF_QUAD_9;
} else if( XDMF_WORD_CMP( topologyType, "QUADRILATERAL_8") ){
newTopologyType = XDMF_QUAD_8;
} else if( XDMF_WORD_CMP( topologyType, "QUADRILATERAL_9") ){
newTopologyType = XDMF_QUAD_9;
} else if( XDMF_WORD_CMP( topologyType, "TET_10") ){
newTopologyType = XDMF_TET_10;
} else if( XDMF_WORD_CMP( topologyType, "TETRAHEDRON_10") ){
......@@ -251,6 +255,8 @@ XdmfTopology::GetTopologyTypeAsString( void ) {
return("Triangle_6");
case XDMF_QUAD_8 :
return("Quadrilateral_8");
case XDMF_QUAD_9 :
return("Quadrilateral_9");
case XDMF_TET_10 :
return("Tetrahedron_10");
case XDMF_PYRAMID_13 :
......@@ -329,6 +335,9 @@ XdmfInt32 nodesPerElement = 0;
case XDMF_QUAD_8 :
nodesPerElement = 8;
break;
case XDMF_QUAD_9 :
nodesPerElement = 9;
break;
case XDMF_TET_10 :
nodesPerElement = 10;
break;
......@@ -508,6 +517,9 @@ if(this->TopologyType == XDMF_MIXED){
case XDMF_QUAD_8 :
npe = 8;
break;
case XDMF_QUAD_9 :
npe = 9;
break;
case XDMF_TET_10 :
npe = 10;
break;
......@@ -733,6 +745,8 @@ XdmfTopology::GetEdgesPerElement() {
return 3;
case XDMF_QUAD_8 :
return 4;
case XDMF_QUAD_9 :
return 4;
case XDMF_TET_10 :
return 6;
case XDMF_PYRAMID_13 :
......@@ -786,6 +800,8 @@ XdmfTopology::GetFacesPerElement() {
return 1;
case XDMF_QUAD_8 :
return 1;
case XDMF_QUAD_9 :
return 1;
case XDMF_TET_10 :
return 4;
case XDMF_PYRAMID_13 :
......
......@@ -47,6 +47,7 @@
#define XDMF_EDGE_3 0x0022
#define XDMF_TRI_6 0x0024
#define XDMF_QUAD_8 0x0025
#define XDMF_QUAD_9 0x0023
#define XDMF_TET_10 0x0026
#define XDMF_PYRAMID_13 0x0027
#define XDMF_WEDGE_15 0x0028
......
......@@ -65,7 +65,7 @@ XdmfInt32 XdmfExodusReader::DetermineXdmfCellType(char * exoElemType, int numPoi
{
// VTK_QUADRATIC_QUAD with 9 points
// Currently unsupported in Xdmf
return XDMF_QUAD_8;
return XDMF_QUAD_9;
}
else if (elemType.substr(0,3) == "TET" && numPointsPerCell == 10)
{
......@@ -103,7 +103,7 @@ XdmfInt32 XdmfExodusReader::DetermineXdmfCellType(char * exoElemType, int numPoi
{
// VTK_BIQUADRATIC_QUAD;
// Currently unsupported in Xdmf
return XDMF_NOTOPOLOGY;
return XDMF_QUAD_9;
}
else if (elemType.substr(0,3) == "TRU" && numPointsPerCell == 3)
{
......
......@@ -126,6 +126,10 @@ std::string XdmfExodusWriter::DetermineExodusCellType(XdmfInt32 xdmfElementType)
{
return "QUAD";
}
case(XDMF_QUAD_9):
{
return "QUAD";
}
case(XDMF_TET_10):
{
return "TETRA";
......
......@@ -58,6 +58,7 @@ XdmfGrid * XdmfPartitioner::Partition(XdmfGrid * grid, int numPartitions, XdmfEl
break;
case(XDMF_QUAD):
case(XDMF_QUAD_8):
case(XDMF_QUAD_9):
metisElementType = 4;
numElementsPerNode = 4;
break;
......
......@@ -337,6 +337,8 @@ int vtkXdmfHeavyData::GetNumberOfPointsPerCell(int vtk_cell_type)
return 6;
case VTK_QUADRATIC_QUAD:
return 8;
case VTK_BIQUADRATIC_QUAD:
return 9;
case VTK_QUADRATIC_TETRA:
return 10;
case VTK_QUADRATIC_PYRAMID:
......@@ -383,6 +385,8 @@ int vtkXdmfHeavyData::GetVTKCellType(XdmfInt32 topologyType)
return VTK_QUADRATIC_TRIANGLE ;
case XDMF_QUAD_8 :
return VTK_QUADRATIC_QUAD ;
case XDMF_QUAD_9 :
return VTK_BIQUADRATIC_QUAD ;
case XDMF_TET_10 :
return VTK_QUADRATIC_TETRA ;
case XDMF_PYRAMID_13 :
......
......@@ -480,6 +480,7 @@ int vtkXdmfDomain::GetDataDimensionality(XdmfGrid* xmfGrid)
case XDMF_EDGE_3 :
case XDMF_TRI_6 :
case XDMF_QUAD_8 :
case XDMF_QUAD_9 :
case XDMF_TET_10 :
case XDMF_PYRAMID_13 :
case XDMF_WEDGE_15 :
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment