~fluidity-core/fluidity/adjoint

« back to all changes in this revision

Viewing changes to tests/shallow_water_optimisation_check_gradient_revolve_2d/constants_revolve_2d.py

Merge the fluidity_revolve branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from math import sin, cos, pi
 
2
import numpy
 
3
 
 
4
theta = 0.5
 
5
h = 1.0
 
6
g = 1.0
 
7
d0 = 1.0
 
8
 
 
9
def eta_src(X, t):
 
10
  x = X[0]
 
11
  y = X[1]
 
12
  return   2*pi*d0*cos(2*(t + y)*pi) + 2*pi*d0*cos(2*(t + x)*pi) - 2*pi*cos(2*(t + y)*pi) - 2*pi*cos(2*(t + x)*pi)
 
13
 
 
14
def u_src(X, t):
 
15
  x = X[0]
 
16
  y = X[1]
 
17
  return numpy.array([-2*pi*g*cos(2*(t + x)*pi) + 2*pi*cos(2*(t + x)*pi),-2*pi*g*cos(2*(t + y)*pi) + 2*pi*cos(2*(t + y)*pi),0])
 
18
 
 
19
def u_exact(X, t):
 
20
  x = X[0]
 
21
  y = X[1]
 
22
  return numpy.array([sin(2*(t + x)*pi), sin(2*(t + y)*pi), 0.0])
 
23
 
 
24
def eta_exact(X, t):
 
25
  x = X[0]
 
26
  y = X[1]
 
27
  return -sin(2*(t + y)*pi) - sin(2*(t + x)*pi)