# Testsuite

We need to build synthetic tests in order to verify the quality of the reconstuction.

## 1. Synthetic surfaces

The discrete representations $z, p=\partial_x z,$ and $q=\partial_y z$ of the following surfaces and gradients.

### 1.1. $xy$

Since we are working on Q1 Lagrange elements, we must have an exact reconstruction when z is in $Q1$.

./feelpp_h3_surface_rec --polymap.study surface_rec/mesureEtalon2020/angle30  --polymap.p="y:x:y" --polymap.q="x:x:y" --v=1 --polymap.z="x*y:x:y" --pc-type=boomeramg --polymap.pmean=0 --polymap.computeError true --repository.prefix=surface_rec/testsuite/xy/

error L2 : 4.213159e-08 error H1 : 3.198344e-07

### 1.2. $\cos 2$

\begin{aligned} z(x, y)=\sin (x)+0.1 y+0.2 \cos (5 x) \sin (y) & \\ +0.1 \cos (7 x) \sin (7 y) \exp \left(-5(x+\pi)^{4}\right) & \\ z_{x}(x, y)=\cos (x)-\sin (5 x) \sin (y)-0.7 \sin (7 x) \sin (7 y) \exp \left(-5(x+\pi)^{4}\right) &-2(x+\pi)^{3} \cos (7 x) \sin (7 y) \exp \left(-5(x+\pi)^{4}\right) \\ z_{y}(x, y)=0.1+0.2 \cos (5 x) \cos (y)+0.7 \cos (7 x) \cos (7 y) \exp \left(-5(x+\pi)^{4}\right) & . \end{aligned}

Domain:

$x \in[-2 \pi, \pi], \quad y \in\left\{\begin{array}{ll} {[0,20]} & \text { for } m=760, n=930 \\ {[0,10]} & \text { else } \end{array}\right.$
./feelpp_h3_surface_rec --polymap.study surface_rec/mesureEtalon2020/angle30  --polymap.p="cos(x)- sin(5*x)*sin(y)-0.7*sin(7*x)*sin(7*y)*exp(-5*(x+3.141592)*(x+3.141592)*(x+3.141592)*(x+3.141592))-2*(x+3.141592)*(x+3.141592)*(x+3.141592)*cos(7*x)*sin(7*y)*exp(-5*(x+3.141592)*(x+3.141592)*(x+3.141592)*(x+3.141592)):x:y" --polymap.q="0.1+0.2*cos(5*x)*cos(y)+0.7*cos(7*x)*cos(7*y)*exp(-5*(x+3.141592)*(x+3.141592)*(x+3.141592)*(x+3.141592)):x:y" --v=1 --polymap.z="sin(x) + 0.1*y + 0.2*cos(5*x)*sin(y) + 0.1*cos(7*x)*sin(7*y)*exp(-5*(x+3.141592)*(x+3.141592)*(x+3.141592)*(x+3.141592)):x:y" --pc-type=boomeramg --polymap.pmean=0 --polymap.computeError true --repository.prefix=surface_rec/testsuite/cos2/

error L2 : 3.011495e-05 error H1 : 1.524331e-04

### 1.3. $\sin 2$

\begin{aligned} z(x, y) &=1.6 \sin (x) \sin (y) y \\ z_{x}(x, y) &=1.6 \cos (x) \sin (y) y \\ z_{y}(x, y) &=1.6 \sin (x) \cos (y) y+1.6 \sin (x) \sin (y) \end{aligned}

Domain:

$x \in\left[\frac{\pi}{4}, 6 \pi\right], \quad y \in\left[0, \frac{11 \pi}{2}\right]$
./feelpp_h3_surface_rec --polymap.study surface_rec/mesureEtalon2020/angle30  --polymap.p="1.6 * cos(x) * sin(y) * y :x:y" --polymap.q="1.6 * sin(x) * cos(y) * y + 1.6 * sin(x) * sin(y) :x:y" --v=0 --polymap.z="1.6 * sin(x) * sin(y) * y :x:y" --pc-type=boomeramg --polymap.pmean=0 --polymap.computeError true --repository.prefix=surface_rec/testsuite/sin2/

error L2 : 3.740478e-05 error H1 : 6.171780e-05

### 1.4. g2sTestSurf

Surface

\begin{aligned} z(x, y)=\frac{5}{2} & \exp \left(-\frac{3}{16} x^{2}+\frac{5}{8} x-\frac{19}{16}-\frac{1}{8} x y+\frac{7}{8} y-\frac{3}{16} y^{2}\right) \\ &+3 \exp \left(-\frac{2}{7} x^{2}+\frac{32}{7} x-\frac{142}{7}-\frac{1}{7} x y+\frac{15}{7} y-\frac{1}{7} y^{2}\right) \\ &-5 \exp \left(-\frac{5}{18} x^{2}+\frac{20}{9} x-\frac{125}{18}+\frac{1}{9} x y+\frac{5}{9} y-\frac{1}{9} y^{2}\right) \\ &-2 \exp \left(-\frac{3}{28} x^{2}-\frac{1}{7} x-\frac{75}{7}+\frac{1}{14} x y+\frac{19}{7} y-\frac{5}{28} y^{2}\right) \\ &+5 \exp \left(-\frac{1}{6} x^{2}+\frac{14}{3} x-\frac{194}{3}-\frac{1}{3} x y+\frac{38}{3} y-\frac{2}{3} y^{2}\right) \end{aligned}

Domain:

$x, y \in[-1,10]$
./feelpp_h3_surface_rec --polymap.study surface_rec/mesureEtalon2020/angle30  --polymap.p="5/2* (-3/8*x + 5/8 - 1/8*y) *exp(-3/16*x^2 + 5/8 * x - 19/16 - 1/8*x*y + 7/8*y - 3/16*y^2) + 3* (-4/7*x + 32/7 - 1/7*y) *exp(-2/7*x^2 + 32/7 * x - 142/7 - 1/7*x*y + 15/7*y - 1/7*y^2) - 5* (-5/9*x + 20/9 + 1/9*y) *exp(-5/18*x^2 + 20/9 * x - 125/18 - 1/9*x*y + 5/9*y - 1/9*y^2) - 2* (-3/14*x -1/7 + 1/14*y) *exp(-3/28*x^2 - 1/7 * x - 75/7 + 1/14*x*y + 19/7*y - 5/28*y^2) + 5* (-1/3*x + 14/3 - 1/3*y) *exp(-1/16*x^2 + 14/3 * x - 194/3 - 1/3*x*y + 38/3*y - 2/3*y^2) :x:y" --polymap.q="5/2* (-3/8*y + 7/8 - 1/8*x) *exp(-3/16*x^2 + 5/8 * x - 19/16 - 1/8*x*y + 7/8*y - 3/16*y^2) + 3* (-2/7*y + 15/7 - 1/7*x) *exp(-2/7*x^2 + 32/7 * x - 142/7 - 1/7*x*y + 15/7*y - 1/7*y^2) - 5* (-2/9*y + 5/9 + 1/9*x) *exp(-5/18*x^2 + 20/9 * x - 125/18 - 1/9*x*y + 5/9*y - 1/9*y^2) - 2* (-5/14*y + 19/7 + 1/14*x) *exp(-3/28*x^2 - 1/7 * x - 75/7 + 1/14*x*y + 19/7*y - 5/28*y^2) + 5* (-4/3*y + 38/3 - 1/3*x) *exp(-1/16*x^2 + 14/3 * x - 194/3 - 1/3*x*y + 38/3*y - 2/3*y^2) :x:y" --v=1 --polymap.z="5/2*exp(-3/16*x^2 + 5/8 * x - 19/16 - 1/8*x*y + 7/8*y - 3/16*y^2)+ 3*exp(-2/7*x^2 + 32/7 * x - 142/7 - 1/7*x*y + 15/7*y - 1/7*y^2)- 5 *exp(-5/18*x^2 + 20/9 * x - 125/18 - 1/9*x*y + 5/9*y - 1/9*y^2)- 2*exp(-3/28*x^2 - 1/7 * x - 75/7 + 1/14*x*y + 19/7*y - 5/28*y^2)+ 5*exp(-1/16*x^2 + 14/3 * x - 194/3 - 1/3*x*y + 38/3*y - 2/3*y^2) :x:y" --pc-type=boomeramg --polymap.pmean=0 --polymap.computeError true --repository.prefix=surface_rec/testsuite/g2sTestSurf/

error L2 : 3.982165e+01 error H1 : 1.404327e+02