TEBD_Check_StopCrit
PURPOSE 
Check stopping criterion : checks if the stopping criterion is satisfied
SYNOPSIS 
function [stopstatus,printstatus,statusstr,runhist] = TEBD_Check_StopCrit(par,residuals,runhist,iter,stopstatus)
DESCRIPTION 
CROSS-REFERENCE INFORMATION 
This function calls:
This function is called by:
- TEBD_NC_v2_1 TEBD v2.1: main solver. Generates the dual variables at every of the algorithm.
- TEBD_NC_v2_2 TEBD v2.2: main solver. Only generates dual variables for the last iteration of the algorithm.
- TEBD_v2_1 TEBD v2.1: main solver. Generates the dual variables at every of the algorithm.
- TEBD_v2_2 TEBD v2.2: main solver. Only generates dual variables for the last iteration of the algorithm.
SOURCE CODE 
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027 function [stopstatus,printstatus,statusstr,runhist] = TEBD_Check_StopCrit(par,residuals,runhist,iter,stopstatus)
0028 statusstr = '';
0029 printstatus = 0;
0030 if stopstatus >= 3 && residuals.resnorm3 < par.tol
0031 statusstr = [statusstr ,'****************Stop Criterion 3 satisfied**************************\n'];
0032 stopstatus = 2;
0033 printstatus = 1;
0034 runhist.finalresnorm3 = residuals.resnorm3;
0035 runhist.numiterations3 = iter;
0036 end
0037 if stopstatus >= 2 && residuals.resnorm2 < par.tol
0038 statusstr = [statusstr ,'****************Stop Criterion 2 satisfied**************************\n'];
0039 stopstatus = 1;
0040 printstatus = 1;
0041 runhist.finalresnorm2 = residuals.resnorm2;
0042 runhist.numiterations2 = iter;
0043 end
0044 if stopstatus >= 1 && residuals.resnorm < par.tol
0045 statusstr = [statusstr ,'****************Stop Criterion satisfied**************************\n'];
0046 stopstatus = 0;
0047 printstatus = 0;
0048 end
0049
0050
0051
Generated on Tue 06-Aug-2013 17:07:59 by m2html © 2005