~fluidity-core/fluidity/adjoint

« back to all changes in this revision

Viewing changes to tests/burgers_mms_steady_adjoint_gradient_init_revolve/burgers.sage

Merge the fluidity_revolve branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import numpy
 
2
 
 
3
u = sin(x) + cos(x)
 
4
v = 1.0
 
5
 
 
6
#f = u * diff(u, x) - v * diff(u, x, 2) # forward source
 
7
f = - v * diff(u, x, 2) # forward source
 
8
J = 0.5 * integrate(u**2, x, -10, 10)
 
9
 
 
10
print "Forward source term: ", str(f).replace('e^', 'exp').replace('^', '**')
 
11
print "True value of functional: ", float(J)