Unverified Commit 149910ce authored by Kyle Vaughn's avatar Kyle Vaughn Committed by GitHub
Browse files

XDMF (#319)

* Foundations of the XDMF mesh and file types.

* Setup of tests

* Working on reading XDMF

* Geometry processing complete

* Fixed crazy pointer issue with function by changing to subroutine

* Working up through vertices.

* Working up through vertices.

* Material import working

* Everything but mixed topo working for two pins test

* Prior to recursive assignment mods

* Working for multilevel grid after change to assignment

* Added mixed topology, just need to comment everything.

* Commented all import code and tests

* Whitespace

* Working on export. Also fixed CMake for HDF5 dependance

* XDMF export working up through leaves

* Working on writing leaves

* Working on geometry. Allocatable issue resolved

* Export working for single topology. Changed xdmf to UTF8 encoding.

* Mixed topology working

* Material ID export working

* All import export working. Need to implement tests.

* Added newline handling to xdmf

* Testing finished.

* Added distanceToLeaf function

* Added bounding box to XDMFMeshType

* Addressed thfolk suggestions, changed DBC to error handling

* Clear cell sets name with mesh%clear

* Clear boundingBox

* Addressed yl5 changes other than xml privacy

* Addressed yl5's comments

* Made children private

* Rewrote unit tests, renamed module, and removed file type

* Removed whitespace and a few blank lines.
parent 2f441653
......@@ -105,6 +105,7 @@ TRIBITS_ADD_LIBRARY(Utils
FutilityComputingEnvironment.f90
SchemaParser.f90
SpeciesElements.f90
XDMFMesh.f90
DEPLIBS
CUtils
TrilinosUtils
......
......@@ -89,6 +89,9 @@ TYPE :: XMLElementType
!> @copybrief FileType_XML::getParent_XMLElementType
!> @copydoc FileType_XML::getParent_XMLElementType
PROCEDURE,PASS :: getParent => getParent_XMLElementType
!> @copybrief FileType_XML::setParent_XMLElementType
!> @copydoc FileType_XML::setParent_XMLElementType
PROCEDURE,PASS :: setParent => setParent_XMLElementType
!> @copybrief FileType_XML::hasChildren_XMLElementType
!> @copydoc FileType_XML::hasChildren_XMLElementType
PROCEDURE,PASS :: hasChildren => hasChildren_XMLElementType
......@@ -437,6 +440,18 @@ PURE SUBROUTINE getParent_XMLElementType(thisXMLE,parent)
ENDSUBROUTINE getParent_XMLElementType
!
!-------------------------------------------------------------------------------
!> @brief Sets the XML element objects parent
!> @param thisXMLE the XML element object
!> @param parent the parent XML element object
!>
PURE SUBROUTINE setParent_XMLElementType(thisXMLE,parent)
CLASS(XMLElementType),INTENT(INOUT) :: thisXMLE
CLASS(XMLElementType),INTENT(INOUT),TARGET :: parent
NULLIFY(thisXMLE%parent)
thisXMLE%parent => parent
ENDSUBROUTINE setParent_XMLElementType
!
!-------------------------------------------------------------------------------
!> @brief Returns a logical of whether or not the XML element has child
!> elements.
!> @param thisXMLE the XML element object
......
This diff is collapsed.
......@@ -113,6 +113,7 @@ IF(${PACKAGE_NAME}_ENABLE_HDF5)
${UNIT_TEST_NAMES}
testHDF5FileType
testTPLHDF5
testXDMFMesh
)
ENDIF()
......
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
#   Futility Development Group    !
#              All rights reserved.           !
#                         !
# Futility is a jointly-maintained, open-source project between the University !
# of Michigan and Oak Ridge National Laboratory.  The copyright and license !
# can be found in LICENSE.txt in the head directory of this repository.   !
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
INCLUDE(Futility_CreateUnitTest)
# List any files from the main source directory that the test depends on
SET(ADDITIONAL_FILES
gridmesh_two_pins.xdmf
gridmesh_two_pins.h5
gridmesh_three_level_grid.xdmf
gridmesh_three_level_grid.h5
three_level_grid.xdmf
three_level_grid.h5
)
Futility_CreateUnitTest(testXDMFMesh)
Futility_CopyFiles(ADDITIONAL_FILES)
UNSET(ADDITIONAL_FILES)
<?xml version='1.0' encoding='UTF-8'?>
<Xdmf Version="3.0">
<Domain>
<Grid Name="three_lvl_grid" GridType="Tree">
<Grid Name="GRID_L1_1_1" GridType="Tree">
<Grid Name="GRID_L2_1_1" GridType="Tree">
<Grid Name="GRID_L3_1_1" GridType="Uniform">
<Geometry GeometryType="XYZ">
<DataItem DataType="Float" Dimensions="9 3" Format="HDF" Precision="8">
gridmesh_three_level_grid.h5:/GRID_L3_1_1/vertices
</DataItem>
</Geometry>
<Topology TopologyType="Quadrilateral" NumberOfElements="4" NodesPerElement="4">
<DataItem DataType="Int" Dimensions="4 4" Format="HDF" Precision="8">
gridmesh_three_level_grid.h5:/GRID_L3_1_1/cells
</DataItem>
</Topology>
</Grid>
<Grid Name="GRID_L3_2_1" GridType="Uniform">
<Geometry GeometryType="XYZ">
<DataItem DataType="Float" Dimensions="9 3" Format="HDF" Precision="8">
gridmesh_three_level_grid.h5:/GRID_L3_2_1/vertices
</DataItem>
</Geometry>
<Topology TopologyType="Quadrilateral" NumberOfElements="4" NodesPerElement="4">
<DataItem DataType="Int" Dimensions="4 4" Format="HDF" Precision="8">
gridmesh_three_level_grid.h5:/GRID_L3_2_1/cells
</DataItem>
</Topology>
</Grid>
<Grid Name="GRID_L3_1_2" GridType="Uniform">
<Geometry GeometryType="XYZ">
<DataItem DataType="Float" Dimensions="9 3" Format="HDF" Precision="8">
gridmesh_three_level_grid.h5:/GRID_L3_1_2/vertices
</DataItem>
</Geometry>
<Topology TopologyType="Quadrilateral" NumberOfElements="4" NodesPerElement="4">
<DataItem DataType="Int" Dimensions="4 4" Format="HDF" Precision="8">
gridmesh_three_level_grid.h5:/GRID_L3_1_2/cells
</DataItem>
</Topology>
</Grid>
<Grid Name="GRID_L3_2_2" GridType="Uniform">
<Geometry GeometryType="XYZ">
<DataItem DataType="Float" Dimensions="9 3" Format="HDF" Precision="8">
gridmesh_three_level_grid.h5:/GRID_L3_2_2/vertices
</DataItem>
</Geometry>
<Topology TopologyType="Quadrilateral" NumberOfElements="4" NodesPerElement="4">
<DataItem DataType="Int" Dimensions="4 4" Format="HDF" Precision="8">
gridmesh_three_level_grid.h5:/GRID_L3_2_2/cells
</DataItem>
</Topology>
</Grid>
</Grid>
<Grid Name="GRID_L2_2_1" GridType="Tree">
<Grid Name="GRID_L3_3_1" GridType="Uniform">
<Geometry GeometryType="XYZ">
<DataItem DataType="Float" Dimensions="6 3" Format="HDF" Precision="8">
gridmesh_three_level_grid.h5:/GRID_L3_3_1/vertices
</DataItem>
</Geometry>
<Topology TopologyType="Triangle" NumberOfElements="5" NodesPerElement="3">
<DataItem DataType="Int" Dimensions="5 3" Format="HDF" Precision="8">
gridmesh_three_level_grid.h5:/GRID_L3_3_1/cells
</DataItem>
</Topology>
</Grid>
<Grid Name="GRID_L3_4_1" GridType="Uniform">
<Geometry GeometryType="XYZ">
<DataItem DataType="Float" Dimensions="4 3" Format="HDF" Precision="8">
gridmesh_three_level_grid.h5:/GRID_L3_4_1/vertices
</DataItem>
</Geometry>
<Topology TopologyType="Triangle" NumberOfElements="2" NodesPerElement="3">
<DataItem DataType="Int" Dimensions="2 3" Format="HDF" Precision="8">
gridmesh_three_level_grid.h5:/GRID_L3_4_1/cells
</DataItem>
</Topology>
</Grid>
<Grid Name="GRID_L3_3_2" GridType="Uniform">
<Geometry GeometryType="XYZ">
<DataItem DataType="Float" Dimensions="5 3" Format="HDF" Precision="8">
gridmesh_three_level_grid.h5:/GRID_L3_3_2/vertices
</DataItem>
</Geometry>
<Topology TopologyType="Triangle" NumberOfElements="3" NodesPerElement="3">
<DataItem DataType="Int" Dimensions="3 3" Format="HDF" Precision="8">
gridmesh_three_level_grid.h5:/GRID_L3_3_2/cells
</DataItem>
</Topology>
</Grid>
<Grid Name="GRID_L3_4_2" GridType="Uniform">
<Geometry GeometryType="XYZ">
<DataItem DataType="Float" Dimensions="4 3" Format="HDF" Precision="8">
gridmesh_three_level_grid.h5:/GRID_L3_4_2/vertices
</DataItem>
</Geometry>
<Topology TopologyType="Triangle" NumberOfElements="2" NodesPerElement="3">
<DataItem DataType="Int" Dimensions="2 3" Format="HDF" Precision="8">
gridmesh_three_level_grid.h5:/GRID_L3_4_2/cells
</DataItem>
</Topology>
</Grid>
</Grid>
<Grid Name="GRID_L2_1_2" GridType="Tree">
<Grid Name="GRID_L3_1_3" GridType="Uniform">
<Geometry GeometryType="XYZ">
<DataItem DataType="Float" Dimensions="5 3" Format="HDF" Precision="8">
gridmesh_three_level_grid.h5:/GRID_L3_1_3/vertices
</DataItem>
</Geometry>
<Topology TopologyType="Triangle" NumberOfElements="3" NodesPerElement="3">
<DataItem DataType="Int" Dimensions="3 3" Format="HDF" Precision="8">
gridmesh_three_level_grid.h5:/GRID_L3_1_3/cells
</DataItem>
</Topology>
</Grid>
<Grid Name="GRID_L3_2_3" GridType="Uniform">
<Geometry GeometryType="XYZ">
<DataItem DataType="Float" Dimensions="5 3" Format="HDF" Precision="8">
gridmesh_three_level_grid.h5:/GRID_L3_2_3/vertices
</DataItem>
</Geometry>
<Topology TopologyType="Triangle" NumberOfElements="3" NodesPerElement="3">
<DataItem DataType="Int" Dimensions="3 3" Format="HDF" Precision="8">
gridmesh_three_level_grid.h5:/GRID_L3_2_3/cells
</DataItem>
</Topology>
</Grid>
<Grid Name="GRID_L3_1_4" GridType="Uniform">
<Geometry GeometryType="XYZ">
<DataItem DataType="Float" Dimensions="4 3" Format="HDF" Precision="8">
gridmesh_three_level_grid.h5:/GRID_L3_1_4/vertices
</DataItem>
</Geometry>
<Topology TopologyType="Triangle" NumberOfElements="2" NodesPerElement="3">
<DataItem DataType="Int" Dimensions="2 3" Format="HDF" Precision="8">
gridmesh_three_level_grid.h5:/GRID_L3_1_4/cells
</DataItem>
</Topology>
</Grid>
<Grid Name="GRID_L3_2_4" GridType="Uniform">
<Geometry GeometryType="XYZ">
<DataItem DataType="Float" Dimensions="4 3" Format="HDF" Precision="8">
gridmesh_three_level_grid.h5:/GRID_L3_2_4/vertices
</DataItem>
</Geometry>
<Topology TopologyType="Triangle" NumberOfElements="2" NodesPerElement="3">
<DataItem DataType="Int" Dimensions="2 3" Format="HDF" Precision="8">
gridmesh_three_level_grid.h5:/GRID_L3_2_4/cells
</DataItem>
</Topology>
</Grid>
</Grid>
<Grid Name="GRID_L2_2_2" GridType="Tree">
<Grid Name="GRID_L3_3_3" GridType="Uniform">
<Geometry GeometryType="XYZ">
<DataItem DataType="Float" Dimensions="4 3" Format="HDF" Precision="8">
gridmesh_three_level_grid.h5:/GRID_L3_3_3/vertices
</DataItem>
</Geometry>
<Topology TopologyType="Triangle" NumberOfElements="2" NodesPerElement="3">
<DataItem DataType="Int" Dimensions="2 3" Format="HDF" Precision="8">
gridmesh_three_level_grid.h5:/GRID_L3_3_3/cells
</DataItem>
</Topology>
</Grid>
<Grid Name="GRID_L3_4_3" GridType="Uniform">
<Geometry GeometryType="XYZ">
<DataItem DataType="Float" Dimensions="4 3" Format="HDF" Precision="8">
gridmesh_three_level_grid.h5:/GRID_L3_4_3/vertices
</DataItem>
</Geometry>
<Topology TopologyType="Triangle" NumberOfElements="2" NodesPerElement="3">
<DataItem DataType="Int" Dimensions="2 3" Format="HDF" Precision="8">
gridmesh_three_level_grid.h5:/GRID_L3_4_3/cells
</DataItem>
</Topology>
</Grid>
<Grid Name="GRID_L3_3_4" GridType="Uniform">
<Geometry GeometryType="XYZ">
<DataItem DataType="Float" Dimensions="4 3" Format="HDF" Precision="8">
gridmesh_three_level_grid.h5:/GRID_L3_3_4/vertices
</DataItem>
</Geometry>
<Topology TopologyType="Triangle" NumberOfElements="2" NodesPerElement="3">
<DataItem DataType="Int" Dimensions="2 3" Format="HDF" Precision="8">
gridmesh_three_level_grid.h5:/GRID_L3_3_4/cells
</DataItem>
</Topology>
</Grid>
<Grid Name="GRID_L3_4_4" GridType="Uniform">
<Geometry GeometryType="XYZ">
<DataItem DataType="Float" Dimensions="4 3" Format="HDF" Precision="8">
gridmesh_three_level_grid.h5:/GRID_L3_4_4/vertices
</DataItem>
</Geometry>
<Topology TopologyType="Triangle" NumberOfElements="2" NodesPerElement="3">
<DataItem DataType="Int" Dimensions="2 3" Format="HDF" Precision="8">
gridmesh_three_level_grid.h5:/GRID_L3_4_4/cells
</DataItem>
</Topology>
</Grid>
</Grid>
</Grid>
</Grid>
</Domain>
</Xdmf>
<?xml version='1.0' encoding='UTF-8'?>
<Xdmf Version="3.0">
<Domain>
<Information Name="MaterialNames">
MATERIAL_UO2 MATERIAL_WATER MATERIAL_MOX
</Information>
<Grid Name="mesh_domain" GridType="Tree">
<Grid Name="GRID_L1_1_1" GridType="Uniform">
<Geometry GeometryType="XYZ">
<DataItem DataType="Float" Dimensions="109 3" Format="HDF" Precision="8">
gridmesh_two_pins.h5:/GRID_L1_1_1/vertices
</DataItem>
</Geometry>
<Topology TopologyType="Triangle_6" NumberOfElements="46" NodesPerElement="6">
<DataItem DataType="Int" Dimensions="46 6" Format="HDF" Precision="8">
gridmesh_two_pins.h5:/GRID_L1_1_1/cells
</DataItem>
</Topology>
<Set Name="Pin_1" SetType="Cell">
<DataItem DataType="Int" Dimensions="46" Format="HDF" Precision="8">
gridmesh_two_pins.h5:/GRID_L1_1_1/Pin_1
</DataItem>
</Set>
<Attribute Center="Cell" Name="MaterialID">
<DataItem DataType="Int" Dimensions="46" Format="HDF" Precision="8">
gridmesh_two_pins.h5:/GRID_L1_1_1/material_id
</DataItem>
</Attribute>
</Grid>
<Grid Name="GRID_L1_2_1" GridType="Uniform">
<Geometry GeometryType="XYZ">
<DataItem DataType="Float" Dimensions="109 3" Format="HDF" Precision="8">
gridmesh_two_pins.h5:/GRID_L1_2_1/vertices
</DataItem>
</Geometry>
<Topology TopologyType="Triangle_6" NumberOfElements="46" NodesPerElement="6">
<DataItem DataType="Int" Dimensions="46 6" Format="HDF" Precision="8">
gridmesh_two_pins.h5:/GRID_L1_2_1/cells
</DataItem>
</Topology>
<Set Name="Pin_2" SetType="Cell">
<DataItem DataType="Int" Dimensions="46" Format="HDF" Precision="8">
gridmesh_two_pins.h5:/GRID_L1_2_1/Pin_2
</DataItem>
</Set>
<Attribute Center="Cell" Name="MaterialID">
<DataItem DataType="Int" Dimensions="46" Format="HDF" Precision="8">
gridmesh_two_pins.h5:/GRID_L1_2_1/material_id
</DataItem>
</Attribute>
</Grid>
</Grid>
</Domain>
</Xdmf>
This diff is collapsed.
<?xml version='1.0' encoding='UTF-8'?>
<Xdmf Version="3.0">
<Domain>
<Grid Name="three_lvl_grid" GridType="Uniform">
<Geometry GeometryType="XYZ">
<DataItem DataType="Float" Dimensions="42 3" Format="HDF" Precision="8">
three_level_grid.h5:/three_lvl_grid/vertices
</DataItem>
</Geometry>
<Topology TopologyType="Mixed" NumberOfElements="46">
<DataItem DataType="Int" Dimensions="200" Format="HDF" Precision="8">
three_level_grid.h5:/three_lvl_grid/cells
</DataItem>
</Topology>
<Set Name="GRID_L1_1_1" SetType="Cell">
<DataItem DataType="Int" Dimensions="46" Format="HDF" Precision="8">
three_level_grid.h5:/three_lvl_grid/GRID_L1_1_1
</DataItem>
</Set>
<Set Name="GRID_L2_1_1" SetType="Cell">
<DataItem DataType="Int" Dimensions="16" Format="HDF" Precision="8">
three_level_grid.h5:/three_lvl_grid/GRID_L2_1_1
</DataItem>
</Set>
<Set Name="GRID_L2_2_1" SetType="Cell">
<DataItem DataType="Int" Dimensions="12" Format="HDF" Precision="8">
three_level_grid.h5:/three_lvl_grid/GRID_L2_2_1
</DataItem>
</Set>
<Set Name="GRID_L2_1_2" SetType="Cell">
<DataItem DataType="Int" Dimensions="10" Format="HDF" Precision="8">
three_level_grid.h5:/three_lvl_grid/GRID_L2_1_2
</DataItem>
</Set>
<Set Name="GRID_L2_2_2" SetType="Cell">
<DataItem DataType="Int" Dimensions="8" Format="HDF" Precision="8">
three_level_grid.h5:/three_lvl_grid/GRID_L2_2_2
</DataItem>
</Set>
<Set Name="GRID_L3_1_1" SetType="Cell">
<DataItem DataType="Int" Dimensions="4" Format="HDF" Precision="8">
three_level_grid.h5:/three_lvl_grid/GRID_L3_1_1
</DataItem>
</Set>
<Set Name="GRID_L3_2_1" SetType="Cell">
<DataItem DataType="Int" Dimensions="4" Format="HDF" Precision="8">
three_level_grid.h5:/three_lvl_grid/GRID_L3_2_1
</DataItem>
</Set>
<Set Name="GRID_L3_3_1" SetType="Cell">
<DataItem DataType="Int" Dimensions="5" Format="HDF" Precision="8">
three_level_grid.h5:/three_lvl_grid/GRID_L3_3_1
</DataItem>
</Set>
<Set Name="GRID_L3_4_1" SetType="Cell">
<DataItem DataType="Int" Dimensions="2" Format="HDF" Precision="8">
three_level_grid.h5:/three_lvl_grid/GRID_L3_4_1
</DataItem>
</Set>
<Set Name="GRID_L3_1_2" SetType="Cell">
<DataItem DataType="Int" Dimensions="4" Format="HDF" Precision="8">
three_level_grid.h5:/three_lvl_grid/GRID_L3_1_2
</DataItem>
</Set>
<Set Name="GRID_L3_2_2" SetType="Cell">
<DataItem DataType="Int" Dimensions="4" Format="HDF" Precision="8">
three_level_grid.h5:/three_lvl_grid/GRID_L3_2_2
</DataItem>
</Set>
<Set Name="GRID_L3_3_2" SetType="Cell">
<DataItem DataType="Int" Dimensions="3" Format="HDF" Precision="8">
three_level_grid.h5:/three_lvl_grid/GRID_L3_3_2
</DataItem>
</Set>
<Set Name="GRID_L3_4_2" SetType="Cell">
<DataItem DataType="Int" Dimensions="2" Format="HDF" Precision="8">
three_level_grid.h5:/three_lvl_grid/GRID_L3_4_2
</DataItem>
</Set>
<Set Name="GRID_L3_1_3" SetType="Cell">
<DataItem DataType="Int" Dimensions="3" Format="HDF" Precision="8">
three_level_grid.h5:/three_lvl_grid/GRID_L3_1_3
</DataItem>
</Set>
<Set Name="GRID_L3_2_3" SetType="Cell">
<DataItem DataType="Int" Dimensions="3" Format="HDF" Precision="8">
three_level_grid.h5:/three_lvl_grid/GRID_L3_2_3
</DataItem>
</Set>
<Set Name="GRID_L3_3_3" SetType="Cell">
<DataItem DataType="Int" Dimensions="2" Format="HDF" Precision="8">
three_level_grid.h5:/three_lvl_grid/GRID_L3_3_3
</DataItem>
</Set>
<Set Name="GRID_L3_4_3" SetType="Cell">
<DataItem DataType="Int" Dimensions="2" Format="HDF" Precision="8">
three_level_grid.h5:/three_lvl_grid/GRID_L3_4_3
</DataItem>
</Set>
<Set Name="GRID_L3_1_4" SetType="Cell">
<DataItem DataType="Int" Dimensions="2" Format="HDF" Precision="8">
three_level_grid.h5:/three_lvl_grid/GRID_L3_1_4
</DataItem>
</Set>
<Set Name="GRID_L3_2_4" SetType="Cell">
<DataItem DataType="Int" Dimensions="2" Format="HDF" Precision="8">
three_level_grid.h5:/three_lvl_grid/GRID_L3_2_4
</DataItem>
</Set>
<Set Name="GRID_L3_3_4" SetType="Cell">
<DataItem DataType="Int" Dimensions="2" Format="HDF" Precision="8">
three_level_grid.h5:/three_lvl_grid/GRID_L3_3_4
</DataItem>
</Set>
<Set Name="GRID_L3_4_4" SetType="Cell">
<DataItem DataType="Int" Dimensions="2" Format="HDF" Precision="8">
three_level_grid.h5:/three_lvl_grid/GRID_L3_4_4
</DataItem>
</Set>
</Grid>
</Domain>
</Xdmf>
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