1% Testing divand in 2 dimensions with relative correlation length.
2
3% grid of background field
4[xi,yi] = ndgrid(linspace(-1,1,30));
5
6x = 0;
7y = 0;
8f = 1;
9
10mask = ones(size(xi));
11pm = ones(size(xi)) / (xi(2,1)-xi(1,1));
12pn = ones(size(xi)) / (yi(1,2)-yi(1,1));
13
14
15
16u = ones(size(xi));
17v = u;
18
19a = 5;
20u = a*yi;
21v = -a*xi;
22
23L = 0.2 * ones(size(xi));
24%L = 0.2 * ones(size(xi));
25L = 0.4 * (2 - xi);
26
27fi = divand(mask,{pm,pn},{xi,yi},{x,y},f,L,200);
28
29
30if any(fi(1,:) < fi(end,:))
31    error('unexpected values');
32end
33
34% Copyright (C) 2014 Alexander Barth <a.barth@ulg.ac.be>
35%
36% This program is free software; you can redistribute it and/or modify it under
37% the terms of the GNU General Public License as published by the Free Software
38% Foundation; either version 2 of the License, or (at your option) any later
39% version.
40%
41% This program is distributed in the hope that it will be useful, but WITHOUT
42% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
43% FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
44% details.
45%
46% You should have received a copy of the GNU General Public License along with
47% this program; if not, see <http://www.gnu.org/licenses/>.
48