xref: /petsc/src/ts/tutorials/phasefield/biharmonictest.m (revision 2a1887a77e7b2c6e00dd0ba96d1387c839460237)
1c4762a1bSJed Brown
2c4762a1bSJed Brown% Runs the heat equation solver for several mesh spacing and determines the order of accuracy of the method with respect to time
3c4762a1bSJed Brown
4c4762a1bSJed Brownn = 5;
5c4762a1bSJed Brownu = cell(n,1);
6c4762a1bSJed Brownfor i=1:n
7*188af4bfSBarry Smith        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*188af4bfSBarry Smith%  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'])
9c4762a1bSJed Brown  ii = 2^(i-1);
10c4762a1bSJed Brownut = PetscBinaryRead('binaryoutput');%,'precision','float128');
11c4762a1bSJed Brown  u{i} = ut(1:ii:(320*ii));
12c4762a1bSJed Brownend
13c4762a1bSJed Brown
14c4762a1bSJed Brownustar = (4*u{n} - u{n-1})/3;
15c4762a1bSJed Brown
16c4762a1bSJed Brownfor i=1:n
17c4762a1bSJed Brown  norm(ustar - u{i})
18c4762a1bSJed Brownend
19c4762a1bSJed Brown
20c4762a1bSJed Brown
21