Commit bef0a664 authored by Andrew J. Burns (Cont's avatar Andrew J. Burns (Cont
Browse files

cleaning up files

parent 804c9d85
<?xml version="1.0" encoding="utf-8"?>
<Xdmf xmlns:xi="http://www.w3.org/2001/XInclude" Version="2.0">
<Domain>
<Information Name="Edited" Value="This file is the edited version">
<Information Name="Information" Value="Information can have information"/>
</Information>
<Grid CollectionType="Spatial" GridType="Collection" Name="GridCollection Example">
<Information Name="Grid Collection 1" Value="This is the main grid collection"/>
<Geometry Type="None"/>
<Topology Dimensions="0" Type="NoTopology"/>
<Map Name="">
<DataItem DataType="Int" Dimensions="13" Format="XML" Precision="4">1 1 1 1 1 1 2 2 3 3 3 3 3</DataItem>
<DataItem DataType="Int" Dimensions="13" Format="XML" Precision="4">0 1 2 3 4 5 3 5 0 1 2 4 5</DataItem>
<DataItem DataType="Int" Dimensions="13" Format="XML" Precision="4">0 1 2 3 4 5 1 5 2 3 5 0 1</DataItem>
</Map>
<Map Name="">
<DataItem DataType="Int" Dimensions="13" Format="XML" Precision="4">0 0 0 0 0 0 2 2 3 3 3 3 3</DataItem>
<DataItem DataType="Int" Dimensions="13" Format="XML" Precision="4">0 1 2 3 4 5 3 5 0 1 2 4 5</DataItem>
<DataItem DataType="Int" Dimensions="13" Format="XML" Precision="4">0 1 2 3 4 5 1 5 2 3 5 0 1</DataItem>
</Map>
<Map Name="">
<DataItem DataType="Int" Dimensions="7" Format="XML" Precision="4">0 0 1 1 3 3 3</DataItem>
<DataItem DataType="Int" Dimensions="7" Format="XML" Precision="4">1 5 1 5 0 2 5</DataItem>
<DataItem DataType="Int" Dimensions="7" Format="XML" Precision="4">3 5 3 5 4 6 1</DataItem>
</Map>
<Map Name="">
<DataItem DataType="Int" Dimensions="13" Format="XML" Precision="4">0 0 0 0 0 1 1 1 1 1 2 2 2</DataItem>
<DataItem DataType="Int" Dimensions="13" Format="XML" Precision="4">0 1 2 3 5 0 1 2 3 5 1 4 6</DataItem>
<DataItem DataType="Int" Dimensions="13" Format="XML" Precision="4">4 5 0 1 2 4 5 0 1 2 5 0 2</DataItem>
</Map>
<Grid CollectionType="None" GridType="Collection" Name="Secondary grid collection">
<Geometry Type="None"/>
<Topology Dimensions="0" Type="NoTopology"/>
</Grid>
<Grid Name="Curvilinear Grid Example">
<Information Name="Curvilinear Grid" Value="This is an example curvilinear grid"/>
<Time Value="5">
<Information Name="Time" Value="The Time of the Curvilinear Grid"/>
</Time>
<Geometry Type="XYZ">
<Information Name="Geometry" Value="The geometry of the curvilinear grid"/>
<DataItem DataType="Float" Dimensions="39" Format="XML" Precision="8">2.1 2.1 3.1 3.1 2.1 3.1 5.1 2.1 4.1 2.1 3.1 3.1 3.1 3.1 3.1 5.1 4.1 4.1 2.1 2.1 1.1 3.1 2.1 1.1 5.1 2.1 -0.1 2.1 3.1 1.1 2.1 3.1 0.9 5.1 4.1 -0.1 36 37 38</DataItem>
</Geometry>
<Topology Dimensions="13 13 13" Type="3DSMesh"/>
<Attribute Center="Node" Name="Global Node Equivalencies" Type="GlobalId">
<Information Name="Global Node Equivalencies" Value="These are the global nodes that accociate with the local nodes"/>
<DataItem DataType="Int" Dimensions="7" Format="XML" Precision="4">3 6 2 8 1 7 5</DataItem>
</Attribute>
<xi:include xpointer="element(/1/1/2/5)"/>
</Grid>
<Grid Name="Rectilinear Grid Example">
<Time Value="5">
<Information Name="Time" Value="The time of the rectiliniear grid"/>
</Time>
<Geometry Type="VXVYVZ">
<DataItem DataType="Float" Dimensions="13" Format="XML" Precision="8">13 1 2 2 1 2 4 1 3 1 2 2 12</DataItem>
<DataItem DataType="Float" Dimensions="13" Format="XML" Precision="8">2 14 2 4 3 3 1 1 0 2 1 0 12</DataItem>
<DataItem DataType="Float" Dimensions="13" Format="XML" Precision="8">4 1 11 1 2 0 1 2 0 4 3 -1 12</DataItem>
</Geometry>
<Topology Dimensions="13 13 13" Type="3DRectMesh"/>
<Attribute Center="Node" Name="Global Node Equivalencies" Type="GlobalId">
<Information Name="Global Node Equivalencies" Value="These are the global nodes that associate with the local nodes"/>
<DataItem DataType="Int" Dimensions="6" Format="XML" Precision="4">6 4 3 7 9 8</DataItem>
</Attribute>
<xi:include xpointer="element(/1/1/2/6)"/>
</Grid>
<Grid Name="Regular Grid Example">
<Time Value="5">
<Information Name="Time" Value="This is the time for the regular grid"/>
</Time>
<Geometry Type="ORIGIN_DXDYDZ">
<DataItem DataType="Float" Dimensions="3" Format="XML" Precision="8">1 1 1</DataItem>
<DataItem DataType="Float" Dimensions="3" Format="XML" Precision="8">11 11 11</DataItem>
</Geometry>
<Topology Dimensions="6 6 6" Type="3DCoRectMesh"/>
<Attribute Center="Node" Name="Global Node Equivalencies" Type="GlobalId">
<Information Name="Global Node Equivalencies" Value="These are the global nodes that associate with the local nodes"/>
<DataItem DataType="Int" Dimensions="7" Format="XML" Precision="4">3 5 1 2 4 8 0</DataItem>
</Attribute>
<xi:include xpointer="element(/1/1/2/7)"/>
</Grid>
<Grid Name="Unstructured Grid Example">
<Time Value="5">
<Information Name="Time" Value="This is the time for the Unstructured Grid"/>
</Time>
<Geometry Type="XYZ">
<Information Name="Geometry" Value="This is the geometry associated with the unstructured grid"/>
<DataItem DataType="Float" Dimensions="36" Format="XML" Precision="8">1.1 1.1 2.1 2.1 1.1 2.1 4.1 1.1 3.1 1.1 2.1 2.1 2.1 2.1 2.1 4.1 3.1 3.1 1.1 1.1 -0.1 2.1 1.1 -0.1 4.1 1.1 -1.1 1.1 2.1 -0.1 2.1 2.1 -0.1 4.1 3.1 -1.1</DataItem>
</Geometry>
<Topology Dimensions="2" Type="Hexahedron">
<DataItem DataType="Int" Dimensions="16" Format="XML" Precision="4">1 2 8 7 4 5 11 10 2 3 9 8 5 6 12 11</DataItem>
</Topology>
<Attribute Center="Node" Name="Global Node Equivalencies" Type="GlobalId">
<DataItem DataType="Int" Dimensions="6" Format="XML" Precision="4">5 2 8 7 9 1</DataItem>
</Attribute>
<xi:include xpointer="element(/1/1/2/4)"/>
<Set Name="Unstructured Grid's Set" Type="Node">
<Information Name="Data Set" Value="This is a set of arbitrary data"/>
<Attribute Center="Node" Name="The Set's attribute" Type="Scalar">
<DataItem DataType="Float" Dimensions="9" Format="XML" Precision="8">1.9 2.8 3.7 4.6 5.5 6.4 7.3 8.2 9.1</DataItem>
</Attribute>
<DataItem DataType="Float" Dimensions="10" Format="XML" Precision="8">1.1 2.2 3.3 4.4 5.5 6.6 7.7 8.8 9.9 0.23</DataItem>
</Set>
</Grid>
</Grid>
<xi:include xpointer="element(/1/1/2/9)"/>
<xi:include xpointer="element(/1/1/2/10)"/>
<xi:include xpointer="element(/1/1/2/11)"/>
<xi:include xpointer="element(/1/1/2/12)"/>
</Domain>
</Xdmf>
<?xml version="1.0" encoding="utf-8"?>
<Xdmf xmlns:xi="http://www.w3.org/2001/XInclude" Version="2.0">
<Domain>
<Information Name="Domain" Value="This is the primary data structure in Xdmf">
<Information Name="Information" Value="Information can have information"/>
</Information>
<Grid CollectionType="Spatial" GridType="Collection" Name="GridCollection Example">
<Information Name="Grid Collection 1" Value="This is the main grid collection"/>
<Geometry Type="None"/>
<Topology Dimensions="0" Type="NoTopology"/>
<Map Name="">
<DataItem DataType="Int" Dimensions="13" Format="XML" Precision="4">1 1 1 1 1 1 2 2 3 3 3 3 3</DataItem>
<DataItem DataType="Int" Dimensions="13" Format="XML" Precision="4">0 1 2 3 4 5 3 5 0 1 2 4 5</DataItem>
<DataItem DataType="Int" Dimensions="13" Format="XML" Precision="4">0 1 2 3 4 5 1 5 2 3 5 0 1</DataItem>
</Map>
<Map Name="">
<DataItem DataType="Int" Dimensions="13" Format="XML" Precision="4">0 0 0 0 0 0 2 2 3 3 3 3 3</DataItem>
<DataItem DataType="Int" Dimensions="13" Format="XML" Precision="4">0 1 2 3 4 5 3 5 0 1 2 4 5</DataItem>
<DataItem DataType="Int" Dimensions="13" Format="XML" Precision="4">0 1 2 3 4 5 1 5 2 3 5 0 1</DataItem>
</Map>
<Map Name="">
<DataItem DataType="Int" Dimensions="7" Format="XML" Precision="4">0 0 1 1 3 3 3</DataItem>
<DataItem DataType="Int" Dimensions="7" Format="XML" Precision="4">1 5 1 5 0 2 5</DataItem>
<DataItem DataType="Int" Dimensions="7" Format="XML" Precision="4">3 5 3 5 4 6 1</DataItem>
</Map>
<Map Name="">
<DataItem DataType="Int" Dimensions="13" Format="XML" Precision="4">0 0 0 0 0 1 1 1 1 1 2 2 2</DataItem>
<DataItem DataType="Int" Dimensions="13" Format="XML" Precision="4">0 1 2 3 5 0 1 2 3 5 1 4 6</DataItem>
<DataItem DataType="Int" Dimensions="13" Format="XML" Precision="4">4 5 0 1 2 4 5 0 1 2 5 0 2</DataItem>
</Map>
<Grid CollectionType="None" GridType="Collection" Name="Secondary grid collection">
<Geometry Type="None"/>
<Topology Dimensions="0" Type="NoTopology"/>
</Grid>
<Grid Name="Curvilinear Grid Example">
<Information Name="Curvilinear Grid" Value="This is an example curvilinear grid"/>
<Time Value="5">
<Information Name="Time" Value="The Time of the Curvilinear Grid"/>
</Time>
<Geometry Type="XYZ">
<Information Name="Geometry" Value="The geometry of the curvilinear grid"/>
<DataItem DataType="Float" Dimensions="36" Format="XML" Precision="8">1.1 1.1 2.1 2.1 1.1 2.1 4.1 1.1 3.1 1.1 2.1 2.1 2.1 2.1 2.1 4.1 3.1 3.1 1.1 1.1 0.1 2.1 1.1 0.1 4.1 1.1 -1.1 1.1 2.1 0.1 1.1 2.1 -0.1 4.1 3.1 -1.1</DataItem>
</Geometry>
<Topology Dimensions="12 12 12" Type="3DSMesh"/>
<Attribute Center="Node" Name="Global Node Equivalencies" Type="GlobalId">
<Information Name="Global Node Equivalencies" Value="These are the global nodes that accociate with the local nodes"/>
<DataItem DataType="Int" Dimensions="6" Format="XML" Precision="4">1 4 5 7 3 6</DataItem>
</Attribute>
<xi:include xpointer="element(/1/1/2/5)"/>
</Grid>
<Grid Name="Rectilinear Grid Example">
<Time Value="5">
<Information Name="Time" Value="The time of the rectiliniear grid"/>
</Time>
<Geometry Type="VXVYVZ">
<DataItem DataType="Float" Dimensions="12" Format="XML" Precision="8">1.1 1.1 2.1 2.1 1.1 2.1 4.1 1.1 3.1 1.1 2.1 2.1</DataItem>
<DataItem DataType="Float" Dimensions="12" Format="XML" Precision="8">2.1 2.1 2.1 4.1 3.1 3.1 1.1 1.1 0.1 2.1 1.1 0.1</DataItem>
<DataItem DataType="Float" Dimensions="12" Format="XML" Precision="8">4.1 1.1 -1.1 1.1 2.1 0.1 1.1 2.1 -0.1 4.1 3.1 -1.1</DataItem>
</Geometry>
<Topology Dimensions="12 12 12" Type="3DRectMesh"/>
<Attribute Center="Node" Name="Global Node Equivalencies" Type="GlobalId">
<Information Name="Global Node Equivalencies" Value="These are the global nodes that associate with the local nodes"/>
<DataItem DataType="Int" Dimensions="6" Format="XML" Precision="4">2 7 9 0 8 6</DataItem>
</Attribute>
<xi:include xpointer="element(/1/1/2/6)"/>
</Grid>
<Grid Name="Regular Grid Example">
<Time Value="5">
<Information Name="Time" Value="This is the time for the regular grid"/>
</Time>
<Geometry Type="ORIGIN_DXDYDZ">
<DataItem DataType="Float" Dimensions="3" Format="XML" Precision="8">0 0 0</DataItem>
<DataItem DataType="Float" Dimensions="3" Format="XML" Precision="8">10 10 10</DataItem>
</Geometry>
<Topology Dimensions="5 5 5" Type="3DCoRectMesh"/>
<Attribute Center="Node" Name="Global Node Equivalencies" Type="GlobalId">
<Information Name="Global Node Equivalencies" Value="These are the global nodes that associate with the local nodes"/>
<DataItem DataType="Int" Dimensions="7" Format="XML" Precision="4">3 6 1 4 2 5 9</DataItem>
</Attribute>
<xi:include xpointer="element(/1/1/2/7)"/>
</Grid>
<Grid Name="Unstructured Grid Example">
<Time Value="5">
<Information Name="Time" Value="This is the time for the Unstructured Grid"/>
</Time>
<Geometry Type="XYZ">
<Information Name="Geometry" Value="This is the geometry associated with the unstructured grid"/>
<DataItem DataType="Float" Dimensions="36" Format="XML" Precision="8">0.1 0.1 1.1 1.1 0.1 1.1 3.1 0.1 2.1 0.1 1.1 1.1 1.1 1.1 1.1 3.1 2.1 2.1 0.1 0.1 -1.1 1.1 0.1 -1.1 3.1 0.1 -2.1 0.1 1.1 -1.1 1.1 1.1 -1.1 3.1 2.1 -2.1</DataItem>
</Geometry>
<Topology Dimensions="2" Type="Hexahedron">
<DataItem DataType="Int" Dimensions="16" Format="XML" Precision="4">0 1 7 6 3 4 10 9 1 2 8 7 4 5 11 10</DataItem>
</Topology>
<Attribute Center="Node" Name="Global Node Equivalencies" Type="GlobalId">
<DataItem DataType="Int" Dimensions="6" Format="XML" Precision="4">1 4 5 7 3 6</DataItem>
</Attribute>
<xi:include xpointer="element(/1/1/2/4)"/>
<Set Name="Unstructured Grid's Set" Type="Node">
<Information Name="Data Set" Value="This is a set of arbitrary data"/>
<Attribute Center="Node" Name="The Set's attribute" Type="Scalar">
<DataItem DataType="Float" Dimensions="9" Format="XML" Precision="8">1.9 2.8 3.7 4.6 5.5 6.4 7.3 8.2 9.1</DataItem>
</Attribute>
<DataItem DataType="Float" Dimensions="5" Format="XML" Precision="8">5.1 4.2 3.3 2.4 1.5</DataItem>
</Set>
</Grid>
</Grid>
<xi:include xpointer="element(/1/1/2/9)"/>
<xi:include xpointer="element(/1/1/2/10)"/>
<xi:include xpointer="element(/1/1/2/11)"/>
<xi:include xpointer="element(/1/1/2/12)"/>
</Domain>
</Xdmf>
from Xdmf import *
if __name__ == "__main__":
exampleReader = XdmfReader.New()
'''
This is assuming that the read item is an XdmfDomain object
'''
primaryDomain = exampleReader.read("testoutput.xmf")
outputInformation = primaryDomain.getInformation(0)
print "Key: " + outputInformation.getKey() + "\nValue: " + outputInformation.getValue()
print "The Domain's tag is: " + primaryDomain.getItemTag()
gridHolder = primaryDomain.getGridCollection(0)
print "The Grid Collection's tag is: " + gridHolder.getItemTag()
print "The Grid Collection's name is: " + gridHolder.getName()
outputInformation = gridHolder.getInformation(0)
print "Key: " + outputInformation.getKey() + "\nValue: " + outputInformation.getValue()
for property in gridHolder.getItemProperties():
print property + ": " + gridHolder.getItemProperties()[property]
if gridHolder.getType() == XdmfGridCollectionType.Spatial():
print "This is a spatial grid collection"
else:
print "This is not a spatial grid collection"
i=0
outstring = ""
while i < gridHolder.getNumberMaps():
readMap = gridHolder.getMap(i)
outstring = outstring + "Map # " + str(i) + "\n"
taskIDMap = readMap.getMap()
j = 0
for task in taskIDMap:
nodeIDmap = taskIDMap[task]
k = 0
for node in nodeIDmap:
remoteIDmap = nodeIDmap[node]
for remote in remoteIDmap:
outstring = outstring + "taskID: " + str(task) + "\tlocalnodeID: " + str(node) +"\tremotenodeID: " + str(remote) + "\n"
k = k + 1
if k == nodeIDmap.size():
break
j = j + 1
if j == taskIDMap.size():
break
i = i + 1
print outstring
print "Unstructured Grid"
ungrid = gridHolder.getUnstructuredGrid(0)
print "The Unstructured Grid's tag is: " + ungrid.getItemTag()
print "The Unstructured Grid's name is: " + ungrid.getName()
for property in ungrid.getItemProperties():
print property + ": " + ungrid.getItemProperties()[property]
print "The Unstructured Grid's time is: " + str(ungrid.getTime().getValue())
i=0
outstring = ""
while i < ungrid.getNumberMaps():
readMap = ungrid.getMap(i)
print "Map # " + str(i)
taskIDMap = readMap.getMap()
j = 0
for task in taskIDMap:
nodeIDmap = taskIDMap[task]
k = 0
for node in nodeIDmap:
remoteIDmap = nodeIDmap[node]
for remote in remoteIDmap:
outstring = outstring + "taskID: " + str(task) + "\tlocalnodeID: " + str(node) +"\tremotenodeID: " + str(remote) + "\n"
k = k + 1
if k == nodeIDmap.size():
break
j = j + 1
if j == taskIDMap.size():
break
i = i + 1
i = 0
print outstring
while i < ungrid.getNumberSets():
readSet = ungrid.getSet(i)
print "Set # " + str(i)
print readSet.getName()
if readSet.getType() == XdmfSetType.Node():
print "This set is a node"
else:
print "This set is not a node"
outputInformation = readSet.getInformation(0)
print "Key: " + outputInformation.getKey() + "\nValue: " + outputInformation.getValue()
print readSet.getValuesString()
j=0
while j < readSet.getNumberAttributes():
readAttribute = readSet.getAttribute(j)
print "Set Attribute # " + str(j)
print readAttribute.getName()
if readAttribute.getType() == XdmfAttributeType.Scalar():
print "This attribute is a scalar"
else:
print "This attribute is not a scalar"
if readAttribute.getCenter() == XdmfAttributeCenter.Node():
print "This attribute is a node"
else:
print "This attribute is not a node"
print readAttribute.getValuesString()
j = j + 1
i=i+1
i=0
while i < ungrid.getNumberAttributes():
readAttribute = ungrid.getAttribute(i)
print "Attribute # " + str(i)
print readAttribute.getName()
if readAttribute.getType() == XdmfAttributeType.Scalar():
print "This attribute is a scalar"
else:
print "This attribute is not a scalar"
if readAttribute.getCenter() == XdmfAttributeCenter.Node():
print "This attribute is a node"
else:
print "This attribute is not a node"
print readAttribute.getValuesString()
i = i + 1
print "Unstructured Topology"
untopology = ungrid.getTopology()
print "The topology's tag: " + untopology.getItemTag()
if untopology.getType() == XdmfTopologyType.Hexahedron():
print "This topology is a hexahedron"
else:
print "This topology is not a hexahedron"
print "Contains " + str(untopology.getNumberElements()) + " elements"
print "Contains the values: " + untopology.getValuesString()
print "Unstructured Geometry"
ungeometry = ungrid.getGeometry()
print "The geometry's tag: " +ungeometry.getItemTag()
if ungeometry.getType() == XdmfGeometryType.XYZ():
print "This geometry is XYZ"
else:
print "This geometry is not XYZ"
outputInformation = ungeometry.getInformation(0)
print "Key: " + outputInformation.getKey() + "\nValue: " + outputInformation.getValue()
print "Contains " + str(ungeometry.getNumberPoints()) + " points"
print "Contains the values: " + ungeometry.getValuesString()
print "Curvilinear Grid"
curvgrid = gridHolder.getCurvilinearGrid(0)
print "The Curvilinear Grid's tag is: " + curvgrid.getItemTag()
print "The Curvilinear Grid's name is: " + curvgrid.getName()
for property in curvgrid.getItemProperties():
print property + ": " + curvgrid.getItemProperties()[property]
outputInformation = curvgrid.getInformation(0)
print "Key: " + outputInformation.getKey() + "\nValue: " + outputInformation.getValue()
print "The Curvilinear Grid's time is: " + str(curvgrid.getTime().getValue())
i=0
outstring = ""
while i < curvgrid.getNumberMaps():
readMap = curvgrid.getMap(i)
print "Map # " + str(i)
taskIDMap = readMap.getMap()
j = 0
for task in taskIDMap:
nodeIDmap = taskIDMap[task]
k = 0
for node in nodeIDmap:
remoteIDmap = nodeIDmap[node]
for remote in remoteIDmap:
outstring = outstring + "taskID: " + str(task) + "\tlocalnodeID: " + str(node) +"\tremotenodeID: " + str(remote) + "\n"
k = k + 1
if k == nodeIDmap.size():
break
j = j + 1
if j == taskIDMap.size():
break
i = i + 1
i = 0
print outstring
while i < curvgrid.getNumberSets():
readSet = curvgrid.getSet(i)
print "Set # " + str(i)
print readSet.getName()
if readSet.getType() == XdmfSetType.Node():
print "This set is a node"
else:
print "This set is not a node"
print readSet.getValuesString()
j=0
while j < readSet.getNumberAttributes():
readAttribute = readSet.getAttribute(j)
print "Set Attribute # " + str(j)
print readAttribute.getName()
if readAttribute.getType() == XdmfAttributeType.Scalar():
print "This attribute is a scalar"
else:
print "This attribute is not a scalar"
if readAttribute.getCenter() == XdmfAttributeCenter.Node():
print "This attribute is a node"
else:
print "This attribute is not a node"
print readAttribute.getValuesString()
j = j + 1
i=i+1
i=0
while i < curvgrid.getNumberAttributes():
readAttribute = curvgrid.getAttribute(i)
print "Attribute # " + str(i)
print readAttribute.getName()
if readAttribute.getType() == XdmfAttributeType.Scalar():
print "This attribute is a scalar"
else:
print "This attribute is not a scalar"
if readAttribute.getCenter() == XdmfAttributeCenter.Node():
print "This attribute is a node"
else:
print "This attribute is not a node"
outputInformation = readAttribute.getInformation(0)
print "Key: " + outputInformation.getKey() + "\nValue: " + outputInformation.getValue()
print readAttribute.getValuesString()
i = i + 1
print "Curvilinear Dimensions"
curvdimensions = curvgrid.getDimensions()
print "The dimensions' tag: " + curvdimensions.getItemTag()
print "Contains the values: " + curvdimensions.getValuesString()
print "Curvilinear Geometry"
curvgeometry = curvgrid.getGeometry()
print "The geometry's tag: " + curvgeometry.getItemTag()
if curvgeometry.getType() == XdmfGeometryType.XYZ():
print "This geometry is XYZ"
else:
print "This geometry is not XYZ"
outputInformation = curvgeometry.getInformation(0)
print "Key: " + outputInformation.getKey() + "\nValue: " + outputInformation.getValue()
print "Contains " + str(curvgeometry.getNumberPoints()) + " points"
print "Contains the values: " + curvgeometry.getValuesString()
print "Rectilinear Grid"
rectgrid = gridHolder.getRectilinearGrid(0)
print "The Rectilinear Grid's tag is: " + rectgrid.getItemTag()
print "The Rectilinear Grid's name is: " + rectgrid.getName()
for property in rectgrid.getItemProperties():
print property + ": " + rectgrid.getItemProperties()[property]
print "The Rectilinear Grid's time is: " + str(rectgrid.getTime().getValue())
i=0
outstring = ""
while i < rectgrid.getNumberMaps():
readMap = rectgrid.getMap(i)
print "Map # " + str(i)
taskIDMap = readMap.getMap()
j = 0
for task in taskIDMap:
nodeIDmap = taskIDMap[task]
k = 0
for node in nodeIDmap:
remoteIDmap = nodeIDmap[node]
for remote in remoteIDmap:
outstring = outstring + "taskID: " + str(task) + "\tlocalnodeID: " + str(node) +"\tremotenodeID: " + str(remote) + "\n"
k = k + 1
if k == nodeIDmap.size():
break
j = j + 1
if j == taskIDMap.size():
break
i = i + 1
i = 0
print outstring
while i < rectgrid.getNumberSets():
readSet = rectgrid.getSet(i)
print "Set # " + str(i)
print readSet.getName()
if readSet.getType() == XdmfSetType.Node():
print "This set is a node"
else:
print "This set is not a node"
print readSet.getValuesString()
j=0
while j < readSet.getNumberAttributes():
readAttribute = readSet.getAttribute(j)
print "Set Attribute # " + str(j)
print readAttribute.getName()
if readAttribute.getType() == XdmfAttributeType.Scalar():
print "This attribute is a scalar"
else:
print "This attribute is not a scalar"
if readAttribute.getCenter() == XdmfAttributeCenter.Node():
print "This attribute is a node"
else:
print "This attribute is not a node"
print readAttribute.getValuesString()
j = j + 1
i=i+1
i=0
while i < rectgrid.getNumberAttributes():
readAttribute = rectgrid.getAttribute(i)
print "Attribute # " + str(i)
print readAttribute.getName()
if readAttribute.getType() == XdmfAttributeType.Scalar():
print "This attribute is a scalar"
else:
print "This attribute is not a scalar"
if readAttribute.getCenter() == XdmfAttributeCenter.Node():
print "This attribute is a node"
else:
print "This attribute is not a node"
outputInformation = readAttribute.getInformation(0)
print "Key: " + outputInformation.getKey() + "\nValue: " + outputInformation.getValue()
print readAttribute.getValuesString()
i = i + 1
print "Rectilinear Dimensions"
rectdimensions = rectgrid.getDimensions()
print "The dimensions' tag: " + rectdimensions.getItemTag()
print "Contains the values: " + rectdimensions.getValuesString()
print "Rectilinear Coordinates"
rectcoordinates = rectgrid.getCoordinates()
print "Contains the values: "
for coordinateaxes in rectcoordinates:
print coordinateaxes.getValuesString()
print "Regular Grid"
reggrid = gridHolder.getRegularGrid(0)
print "The Regular Grid's tag is: " + reggrid.getItemTag()
print "The Regular Grid's name is: " + reggrid.getName()
for property in reggrid.getItemProperties():
print property + ": " + reggrid.getItemProperties()[property]
print "The Regular Grid's time is: " + str(reggrid.getTime().getValue())
i=0
outstring = ""
while i < reggrid.getNumberMaps():
readMap = reggrid.getMap(i)
print "Map # " + str(i)
taskIDMap = readMap.getMap()
j = 0
for task in taskIDMap:
nodeIDmap = taskIDMap[task]
k = 0
for node in nodeIDmap:
remoteIDmap = nodeIDmap[node]
for remote in remoteIDmap:
outstring = outstring + "taskID: " + str(task) + "\tlocalnodeID: " + str(node) +"\tremotenodeID: " + str(remote) + "\n"
k = k + 1
if k == nodeIDmap.size():
break
j = j + 1
if j == taskIDMap.size():
break
i = i + 1
i = 0
print outstring
while i < reggrid.getNumberSets():
readSet = reggrid.getSet(i)
print "Set # " + str(i)
print readSet.getName()
if readSet.