Skip to content

Commit

Permalink
Fixed spinsphere test
Browse files Browse the repository at this point in the history
  • Loading branch information
Abinand Gopal committed Dec 1, 2017
1 parent 1789854 commit 1e9fbf5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/spinopsphere/test_spinsphere.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,16 @@
%% GL:

% Solve with DT and DT/2:
S = spinopsphere('GL'); S.tspan = S.tspan/10;
S = spinopsphere('GL'); S.tspan = S.tspan/10;
S.init = spherefun(@(x,y,z) cos(cosh(x.*z)-y));
N = 128; dt = 1e-1;
s = rng; u = spinsphere(S, N, dt, 'plot', 'off');
rng(s); v = spinsphere(S, N, dt/2, 'plot', 'off');
u = spinsphere(S, N, dt, 'plot', 'off');
v = spinsphere(S, N, dt/2, 'plot', 'off');

% Compare:
dom = S.domain;
[xx, yy] = meshgrid(linspace(dom(1), dom(2), 50));
scale = max(max(abs(v(xx,yy))));
pass(2) = max(max(abs(u(xx,yy) - v(xx,yy))))/scale < tol;

end
end

0 comments on commit 1e9fbf5

Please sign in to comment.