Skip to content

Commit

Permalink
Force add example xdmfs in example 5
Browse files Browse the repository at this point in the history
  • Loading branch information
emmetfrancis committed Oct 18, 2024
1 parent a4319fb commit 7936be9
Show file tree
Hide file tree
Showing 4 changed files with 146 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/example5/example5.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@
"metadata": {},
"outputs": [],
"source": [
"j1pulse_fromxdmf = Parameter.from_xdmf(\"j1pulse_fromxdmf\", \"load_data.xdmf\", flux_unit, compartment = \"PM\")\n",
"j1pulse_fromxdmf = Parameter.from_xdmf(\"j1pulse_fromxdmf\", \"test_data.xdmf\", flux_unit, compartment = \"PM\")\n",
"add_reaction = True\n",
"if add_reaction:\n",
" jmag = Parameter(\"jmag\", 0.0, unit.dimensionless)\n",
Expand Down Expand Up @@ -718,7 +718,7 @@
" if model_cur.t >= 0.2 and not displayed:\n",
" visualization.plot(model_cur.sc['A'].u['u'],\n",
" clip_plane=(1, 1, 0), clip_origin=(0.5, 0.5, 0.5))\n",
" displayed = True\n"
" displayed = True"
]
},
{
Expand Down
Binary file added examples/example5/test_data.h5
Binary file not shown.
143 changes: 143 additions & 0 deletions examples/example5/test_data.xdmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
<?xml version="1.0"?>
<!DOCTYPE Xdmf SYSTEM "Xdmf.dtd" []>
<Xdmf Version="3.0" xmlns:xi="http://www.w3.org/2001/XInclude">
<Domain>
<Grid Name="TimeSeries_f_146" GridType="Collection" CollectionType="Temporal">
<Grid Name="mesh" GridType="Uniform">
<Topology NumberOfElements="512" TopologyType="Triangle" NodesPerElement="3">
<DataItem Dimensions="512 3" NumberType="UInt" Format="HDF">test_data.h5:/Mesh/0/mesh/topology</DataItem>
</Topology>
<Geometry GeometryType="XYZ">
<DataItem Dimensions="289 3" Format="HDF">test_data.h5:/Mesh/0/mesh/geometry</DataItem>
</Geometry>
<Time Value="0.000000000000000e+00" />
<Attribute Name="f_146" AttributeType="Scalar" Center="Node">
<DataItem Dimensions="289 1" Format="HDF">test_data.h5:/VisualisationVector/0</DataItem>
</Attribute>
</Grid>
<Grid Name="mesh" GridType="Uniform">
<Topology NumberOfElements="512" TopologyType="Triangle" NodesPerElement="3">
<DataItem Dimensions="512 3" NumberType="UInt" Format="HDF">test_data.h5:/Mesh/1/mesh/topology</DataItem>
</Topology>
<Geometry GeometryType="XYZ">
<DataItem Dimensions="289 3" Format="HDF">test_data.h5:/Mesh/1/mesh/geometry</DataItem>
</Geometry>
<Time Value="1.000000000000000e-01" />
<Attribute Name="f_146" AttributeType="Scalar" Center="Node">
<DataItem Dimensions="289 1" Format="HDF">test_data.h5:/VisualisationVector/1</DataItem>
</Attribute>
</Grid>
<Grid Name="mesh" GridType="Uniform">
<Topology NumberOfElements="512" TopologyType="Triangle" NodesPerElement="3">
<DataItem Dimensions="512 3" NumberType="UInt" Format="HDF">test_data.h5:/Mesh/2/mesh/topology</DataItem>
</Topology>
<Geometry GeometryType="XYZ">
<DataItem Dimensions="289 3" Format="HDF">test_data.h5:/Mesh/2/mesh/geometry</DataItem>
</Geometry>
<Time Value="2.000000000000000e-01" />
<Attribute Name="f_146" AttributeType="Scalar" Center="Node">
<DataItem Dimensions="289 1" Format="HDF">test_data.h5:/VisualisationVector/2</DataItem>
</Attribute>
</Grid>
<Grid Name="mesh" GridType="Uniform">
<Topology NumberOfElements="512" TopologyType="Triangle" NodesPerElement="3">
<DataItem Dimensions="512 3" NumberType="UInt" Format="HDF">test_data.h5:/Mesh/3/mesh/topology</DataItem>
</Topology>
<Geometry GeometryType="XYZ">
<DataItem Dimensions="289 3" Format="HDF">test_data.h5:/Mesh/3/mesh/geometry</DataItem>
</Geometry>
<Time Value="3.000000000000000e-01" />
<Attribute Name="f_146" AttributeType="Scalar" Center="Node">
<DataItem Dimensions="289 1" Format="HDF">test_data.h5:/VisualisationVector/3</DataItem>
</Attribute>
</Grid>
<Grid Name="mesh" GridType="Uniform">
<Topology NumberOfElements="512" TopologyType="Triangle" NodesPerElement="3">
<DataItem Dimensions="512 3" NumberType="UInt" Format="HDF">test_data.h5:/Mesh/4/mesh/topology</DataItem>
</Topology>
<Geometry GeometryType="XYZ">
<DataItem Dimensions="289 3" Format="HDF">test_data.h5:/Mesh/4/mesh/geometry</DataItem>
</Geometry>
<Time Value="4.000000000000000e-01" />
<Attribute Name="f_146" AttributeType="Scalar" Center="Node">
<DataItem Dimensions="289 1" Format="HDF">test_data.h5:/VisualisationVector/4</DataItem>
</Attribute>
</Grid>
<Grid Name="mesh" GridType="Uniform">
<Topology NumberOfElements="512" TopologyType="Triangle" NodesPerElement="3">
<DataItem Dimensions="512 3" NumberType="UInt" Format="HDF">test_data.h5:/Mesh/5/mesh/topology</DataItem>
</Topology>
<Geometry GeometryType="XYZ">
<DataItem Dimensions="289 3" Format="HDF">test_data.h5:/Mesh/5/mesh/geometry</DataItem>
</Geometry>
<Time Value="5.000000000000000e-01" />
<Attribute Name="f_146" AttributeType="Scalar" Center="Node">
<DataItem Dimensions="289 1" Format="HDF">test_data.h5:/VisualisationVector/5</DataItem>
</Attribute>
</Grid>
<Grid Name="mesh" GridType="Uniform">
<Topology NumberOfElements="512" TopologyType="Triangle" NodesPerElement="3">
<DataItem Dimensions="512 3" NumberType="UInt" Format="HDF">test_data.h5:/Mesh/6/mesh/topology</DataItem>
</Topology>
<Geometry GeometryType="XYZ">
<DataItem Dimensions="289 3" Format="HDF">test_data.h5:/Mesh/6/mesh/geometry</DataItem>
</Geometry>
<Time Value="6.000000000000000e-01" />
<Attribute Name="f_146" AttributeType="Scalar" Center="Node">
<DataItem Dimensions="289 1" Format="HDF">test_data.h5:/VisualisationVector/6</DataItem>
</Attribute>
</Grid>
<Grid Name="mesh" GridType="Uniform">
<Topology NumberOfElements="512" TopologyType="Triangle" NodesPerElement="3">
<DataItem Dimensions="512 3" NumberType="UInt" Format="HDF">test_data.h5:/Mesh/7/mesh/topology</DataItem>
</Topology>
<Geometry GeometryType="XYZ">
<DataItem Dimensions="289 3" Format="HDF">test_data.h5:/Mesh/7/mesh/geometry</DataItem>
</Geometry>
<Time Value="7.000000000000000e-01" />
<Attribute Name="f_146" AttributeType="Scalar" Center="Node">
<DataItem Dimensions="289 1" Format="HDF">test_data.h5:/VisualisationVector/7</DataItem>
</Attribute>
</Grid>
<Grid Name="mesh" GridType="Uniform">
<Topology NumberOfElements="512" TopologyType="Triangle" NodesPerElement="3">
<DataItem Dimensions="512 3" NumberType="UInt" Format="HDF">test_data.h5:/Mesh/8/mesh/topology</DataItem>
</Topology>
<Geometry GeometryType="XYZ">
<DataItem Dimensions="289 3" Format="HDF">test_data.h5:/Mesh/8/mesh/geometry</DataItem>
</Geometry>
<Time Value="8.000000000000000e-01" />
<Attribute Name="f_146" AttributeType="Scalar" Center="Node">
<DataItem Dimensions="289 1" Format="HDF">test_data.h5:/VisualisationVector/8</DataItem>
</Attribute>
</Grid>
<Grid Name="mesh" GridType="Uniform">
<Topology NumberOfElements="512" TopologyType="Triangle" NodesPerElement="3">
<DataItem Dimensions="512 3" NumberType="UInt" Format="HDF">test_data.h5:/Mesh/9/mesh/topology</DataItem>
</Topology>
<Geometry GeometryType="XYZ">
<DataItem Dimensions="289 3" Format="HDF">test_data.h5:/Mesh/9/mesh/geometry</DataItem>
</Geometry>
<Time Value="9.000000000000000e-01" />
<Attribute Name="f_146" AttributeType="Scalar" Center="Node">
<DataItem Dimensions="289 1" Format="HDF">test_data.h5:/VisualisationVector/9</DataItem>
</Attribute>
</Grid>
<Grid Name="mesh" GridType="Uniform">
<Topology NumberOfElements="512" TopologyType="Triangle" NodesPerElement="3">
<DataItem Dimensions="512 3" NumberType="UInt" Format="HDF">test_data.h5:/Mesh/10/mesh/topology</DataItem>
</Topology>
<Geometry GeometryType="XYZ">
<DataItem Dimensions="289 3" Format="HDF">test_data.h5:/Mesh/10/mesh/geometry</DataItem>
</Geometry>
<Time Value="1.000000000000000e+00" />
<Attribute Name="f_146" AttributeType="Scalar" Center="Node">
<DataItem Dimensions="289 1" Format="HDF">test_data.h5:/VisualisationVector/10</DataItem>
</Attribute>
<Attribute Name="f_146" AttributeType="Scalar" Center="Node">
<DataItem Dimensions="289 1" Format="HDF">test_data.h5:/VisualisationVector/11</DataItem>
</Attribute>
</Grid>
</Grid>
</Domain>
</Xdmf>
1 change: 1 addition & 0 deletions smart/model_assembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,7 @@ class Parameter(ObjectInstance):
notes: str = ""
use_preintegration: bool = False
sym_expr: Union[str, sym.core.Expr] = ""
xdmf_file: Union[str, Path] = ""

def to_dict(self):
"""Convert to a dict that can be used to recreate the object."""
Expand Down

0 comments on commit 7936be9

Please sign in to comment.