Created
May 8, 2015 16:13
-
-
Save wence-/f26a73724e46181a345e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| from firedrake import * | |
| mesh = UnitTriangleMesh() | |
| V = FunctionSpace(mesh, 'RT', 1) | |
| u = TrialFunction(V) | |
| v = TestFunction(V) | |
| n = FacetNormal(mesh) | |
| mu = Constant(1.0) | |
| muM = as_tensor([[mu, 0], [0, mu]]) | |
| a = mu*(-inner(outer(v,n),grad(u)) -inner(outer(u,n),grad(v)))*ds | |
| b = (-inner(outer(v, n), dot(grad(u), muM)) - inner(outer(u, n), dot(grad(v), muM)))*ds | |
| print "b" | |
| print assemble(b).M.values | |
| print "a" | |
| print assemble(a).M.values |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment