Skip to content

Instantly share code, notes, and snippets.

@wence-
Created February 29, 2016 13:51
Show Gist options
  • Save wence-/5c94a304d27e2d35b551 to your computer and use it in GitHub Desktop.
Save wence-/5c94a304d27e2d35b551 to your computer and use it in GitHub Desktop.
w_theta = Function(V)
_, sigma_theta = split(w_theta)
theta_form = m*det(I + sigma_theta)*dx
theta = Constant(assemble(theta_form)/total_area)
def updatetheta(snes, it, rnorm, constant, w_theta):
x = snes.getSolution()
with w_theta.dat.vec as v:
x.copy(v)
constant.assign(assemble(theta_form)/total_area)
print constant.dat.data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment