--- Begin Message ---
------------------------------------------------------------
revno: 5406
committer: Marie E. Rognes <meg@meg-laptop>
branch nick: dolfin
timestamp: Wed 2010-12-22 15:34:29 +0100
message:
Updates to dolfin-plot. Only rotate by default if 3D and allow
plotting of "P Lambda" and "P- Lambda"
modified:
scripts/dolfin-plot/dolfin-plot
--
lp:dolfin
https://code.launchpad.net/~dolfin-core/dolfin/main
Your team DOLFIN Core Team is subscribed to branch lp:dolfin.
To unsubscribe from this branch go to https://code.launchpad.net/~dolfin-core/dolfin/main/+edit-subscription
=== modified file 'scripts/dolfin-plot/dolfin-plot'
--- scripts/dolfin-plot/dolfin-plot 2010-12-08 21:06:56 +0000
+++ scripts/dolfin-plot/dolfin-plot 2010-12-22 14:34:29 +0000
@@ -7,7 +7,9 @@
__copyright__ = "Copyright (C) 2010 " + __author__
__license__ = "GNU GPL version 3 or any later version"
-# Last changed: 2010-12-08
+# Modified by Marie E. Rognes (meg@xxxxxxxxx), 2010
+
+# Last changed: 2010-12-22
import sys
@@ -92,7 +94,7 @@
sys.exit(0)
# Check for plotting of element
-if len(args) in (2, 3):
+if len(args) in (2, 3, 4):
# Get family and domain
family, domain = args[:2]
@@ -103,15 +105,26 @@
else:
degree = int(args[2])
+
+ # Create element
+ print "Creating finite element."
+
+ if len(args) == 3:
+ element = FiniteElement(family, domain, degree)
+ elif len(args) == 4:
+ assert family == "P Lambda" or family == "P- Lambda"
+ form_degree = int(args[3])
+ element = FiniteElement(family, domain, degree, form_degree)
+ else:
+ pass
+
+ # Rotate by default in 3D
+ rotate = 1 if str(domain) == "tetrahedron" else 0
+
# Check for rotate option
- rotate = 1
if "rotate" in options:
rotate = int(options["rotate"])
- # Create element
- print "Creating finite element."
- element = FiniteElement(family, domain, degree)
-
# Plot element
print "Plotting finite element."
plot(element, rotate=rotate)
--- End Message ---