-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Dear Henrik, On 29/09/15 13:12, Buesing, Henrik wrote:
Dear Firedrakers,
I define a potential function on a DG function space (see attached file). Now I would like to inspect the values on my mesh.
But when I do a
print assemble(psiw).vector().array()
Assembly of an expression like this does a pointwise computation. If I look at the expression for psiw I see that it is: gradpw = (pw('+') - pw('-'))/Delta_h_facet # Define constants rhow = 1000.0 rhon = 200.0 grav = 9.81 # Potential for upwinding diffz = jump(z_func)/Delta_h_facet psiw = gradpw + rhow*grav*diffz This clearly can't be evaluated pointwise in each cell (since it computes jumps over facets). The normal thing to do is to do this weakly. This might be right: u = TrialFunction(W) v = TestFunction(W) pot = Function(W) solve(dot(u, v)*dx == psiw*v[0]('+')*dS_h, pot) print pot.vector().array()
I get an error (see below). In contrast evaluating the integral over the facets
print assemble(psiw*dS_h)
This is fine, because it does the integral to compute a value. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJWCocpAAoJECOc1kQ8PEYvaH4H/jfn6A7ScJtcd0OWw9IqR+Yy 7VykfJx7Jmb/WUIdEqxS7YUDJPBQnj83Nhj3PYJh3Yscj1qYl0k+1wM5Q1K1CPBI 7XhwNLGPXRbx9gHUVXVZQV7NEnMRngEDLcNJhm2HpBsaKzRhKYu1xughLCf0VG9T MLbgHUgYFJPju4VoJOaUU3UlcPCGot2xESJHv//DDbyotGdGkxK5/9mgNWg1OUw9 366fAnYvNZoXho2IEIfkUKtAFtK/RY2GW5bGCTjlAwIvdYSpz7MnT951q2tjaUjJ tMMEBwhvlUZKyjocBeo/vlcJIEdBlgAk9Qd48NtFeNsZRdAHLPYkH/Xh/8ZOd/Q= =LXZW -----END PGP SIGNATURE-----