1 function F=f_assembly_fortran(A,X,u0, lambda, params)
7 disp('testing if sparse assembly of F same result in fortran')
8 exe = './fortran/f_assembly_test.exe';
10 %Writing all arrays to text files for use by fortran tester
11 write_array_nd(swap23(X{1}),'X');
12 write_array_nd(swap23(X{2}),'Y');
13 write_array_nd(swap23(X{3}),'Z');
14 write_array_nd(swap23(u0{1}),'Xu0');
15 write_array_nd(swap23(u0{2}),'Yu0');
16 write_array_nd(swap23(u0{3}),'Zu0');
21 F_fort=swap23(read_array_nd('F'));
22 err= norm(F(:)-F_fort(:),inf)
24 tol = 10*eps(single(1.));
26 fprintf('error %g OK, tol = %g\n',err,tol)
28 warning(sprintf('error %g too large\n',err))
30 error(sprintf('error %g too large, tol=%g',err,tol))
34 warning(['file ',exe,' does not exist'])