xref: /petsc/src/ts/tutorials/phasefield/biharmonictest.m (revision 607e733f3db3ee7f6f605a13295c517df8dbb9c9)
1
2% Runs the heat equation solver for several mesh spacing and determines the order of accuracy of the method with respect to time
3
4n = 5;
5u = cell(n,1);
6for i=1:n
7        system(['./biharmonic -ts_monitor -snes_vi_monitor -pc_type lu -vi -snes_max_it 250 -snes_converged_reason  -snes_linesearch_minlambda 1.e-30  -ts_type beuler    -da_refine  ' int2str(i+4) '    -kappa .00001 -ts_time_step 5.96046e-06 -ts_monitor_solution -ts_monitor_solution_initial -ksp_monitor_true_residual -snes_linesearch_monitor -ts_max_time .011 -ts_max_steps 10'])
8%  system(['./biharmonic -ts_monitor -snes_linesearch_monitor -snes_vi_monitor -ksp_monitor_true_residual -snes_max_it 250 -snes_vi_type ss -snes_linesearch_minlambda 1.e-30 -snes_rtol 1.e-25 -snes_atol 1.e-15 -pc_type lu -vi -snes_converged_reason   -ts_type cn    -da_refine ' int2str(i+4) '   -kappa .00001 -ts_time_step 2.96046e-07  -ts_max_time 1. -ts_max_steps 30'])
9  ii = 2^(i-1);
10ut = PetscBinaryRead('binaryoutput');%,'precision','float128');
11  u{i} = ut(1:ii:(320*ii));
12end
13
14ustar = (4*u{n} - u{n-1})/3;
15
16for i=1:n
17  norm(ustar - u{i})
18end
19
20
21