annotate checkSbplib.m @ 1031:2ef20d00b386 feature/advectionRV

For easier comparison, return both the first order and residual viscosity when evaluating the residual. Add the first order and residual viscosity to the state of the RungekuttaRV time steppers
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Thu, 17 Jan 2019 10:25:06 +0100
parents 579c348244a0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
139
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
1 function [files,res] = checkSbplib()
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
2
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
3
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
4 files = collectTargets([]);
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
5
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
6 if nargout == 0
140
579c348244a0 Added a settings file to checkSbplib()
Jonatan Werpers <jonatan@werpers.com>
parents: 139
diff changeset
7 checkcode(files, '-config=checksettings.txt');
139
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
8 return
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
9 end
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
10
140
579c348244a0 Added a settings file to checkSbplib()
Jonatan Werpers <jonatan@werpers.com>
parents: 139
diff changeset
11 res = checkcode(files, '-config=checksettings.txt');
139
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
12
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
13 % Remove any empty respones
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
14 I = [];
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
15 for i = 1:length(res)
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
16 if isempty(res{i})
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
17 I(end+1) = i;
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
18 end
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
19 end
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
20
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
21 files(I) = [];
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
22 res(I) = [];
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
23 end
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
24
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
25 function targets = collectTargets(dirPath)
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
26 [mfiles, packages] = getFilesAndPackages(dirPath);
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
27
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
28 targets = {};
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
29 for i = 1:length(mfiles)
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
30 targets{i} = fullfile(dirPath, mfiles{i});
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
31 end
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
32
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
33 for i = 1:length(packages)
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
34 subtargets = collectTargets(fullfile(dirPath, packages{i}));
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
35 targets = [targets subtargets];
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
36 end
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
37 end
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
38
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
39 function [mfiles, packages] = getFilesAndPackages(dirPath)
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
40 if isempty(dirPath)
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
41 l = dir();
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
42 else
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
43 l = dir(dirPath);
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
44 end
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
45
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
46 packages = {};
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
47 mfiles = {};
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
48
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
49 for i = 1:length(l)
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
50 if l(i).isdir && l(i).name(1) == '+'
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
51 packages{end+1} = l(i).name;
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
52 elseif ~l(i).isdir && strcmp(l(i).name(end-1:end),'.m')
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
53 mfiles{end+1} = l(i).name;
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
54 end
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
55 end
6cf264b023b0 Added script to check all the code in a directory.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff changeset
56 end