Created
December 16, 2013 10:23
-
-
Save funsim/7984928 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from dolfin import * | |
import sys | |
if len(sys.argv) < 2: | |
print "Usage: plot_mesh.py meshfile [facet_files]" | |
sys.exit(1) | |
mesh = Mesh(sys.argv[1]) | |
print "Number of vertices: ", mesh.num_vertices() | |
print "Number of facets: ", mesh.num_facets() | |
print "Number of cells: ", mesh.num_cells() | |
print "hmin: ", mesh.hmin() | |
print "hmax: ", mesh.hmax() | |
plot(mesh, axes=True) | |
# Load boundary mesh if provided | |
if len(sys.argv) == 3: | |
boundary_mesh = MeshFunction('size_t', mesh, sys.argv[2]) | |
plot(boundary_mesh, axes=True) | |
interactive() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment