Hi - is it possible to set a default value for a MeshFunction that is created from a sparse MeshValueCollection?
When I display the MeshFunction, it seems to default to a very large number, I'd like to be able to have it default to zero or something … or be able to scale the values in the display:
mesh = Mesh("testing.xml.gz")
mvc = MeshValueCollection("size_t", mesh, "testing_facets.xml.gz")
mf = MeshFunction("size_t", mesh, mvc)
plot(mf, interactive=True)
Here is an example (sparse) MeshValueCollection:
<?xml version="1.0" encoding="UTF-8"?>
<dolfin xmlns:dolfin="http://fenicsproject.org">
<mesh_value_collection name="boundary_markers" type="uint" dim="2" size="6">
<value cell_index="3" local_entity="2" value="3" />
<value cell_index="9" local_entity="1" value="3" />
<value cell_index="7" local_entity="1" value="1" />
<value cell_index="8" local_entity="0" value="2" />
<value cell_index="0" local_entity="2" value="1" />
<value cell_index="6" local_entity="0" value="2" />
</mesh_value_collection>
</dolfin>
Here is the example mesh:
<?xml version="1.0" encoding="UTF-8"?>
<dolfin xmlns:dolfin="http://fenicsproject.org">
<mesh celltype="tetrahedron" dim="3">
<cells size="12">
<tetrahedron index="0" v0="0" v1="1" v2="2" v3="3" />
<tetrahedron index="1" v0="1" v1="2" v2="4" v3="5" />
<tetrahedron index="2" v0="2" v1="3" v2="4" v3="6" />
<tetrahedron index="3" v0="0" v1="1" v2="2" v3="7" />
<tetrahedron index="4" v0="0" v1="2" v2="3" v3="8" />
<tetrahedron index="5" v0="2" v1="3" v2="6" v3="8" />
<tetrahedron index="6" v0="2" v1="5" v2="6" v3="8" />
<tetrahedron index="7" v0="1" v1="2" v2="3" v3="4" />
<tetrahedron index="8" v0="2" v1="5" v2="7" v3="8" />
<tetrahedron index="9" v0="0" v1="2" v2="7" v3="8" />
<tetrahedron index="10" v0="1" v1="2" v2="5" v3="7" />
<tetrahedron index="11" v0="2" v1="4" v2="5" v3="6" />
</cells>
<vertices size="9">
<vertex index="0" x="-5.00000000e-01" y="-5.00000000e-01" z="5.00000000e-01" />
<vertex index="1" x="5.00000000e-01" y="-5.00000000e-01" z="5.00000000e-01" />
<vertex index="2" x="-4.64727495e-02" y="2.92189643e-02" z="-2.63658106e-02" />
<vertex index="3" x="-5.00000000e-01" y="5.00000000e-01" z="5.00000000e-01" />
<vertex index="4" x="5.00000000e-01" y="5.00000000e-01" z="5.00000000e-01" />
<vertex index="5" x="5.00000000e-01" y="5.00000000e-01" z="-5.00000000e-01" />
<vertex index="6" x="-5.00000000e-01" y="5.00000000e-01" z="-5.00000000e-01" />
<vertex index="7" x="5.00000000e-01" y="-5.00000000e-01" z="-5.00000000e-01" />
<vertex index="8" x="-5.00000000e-01" y="-5.00000000e-01" z="-5.00000000e-01" />
</vertices>
</mesh>
</dolfin>