Diff of the two buildlogs: -- --- b1/build.log 2024-05-03 02:47:34.151553276 +0000 +++ b2/build.log 2024-05-03 02:52:39.134584033 +0000 @@ -1,6 +1,6 @@ I: pbuilder: network access will be disabled during build -I: Current time: Thu May 2 14:37:34 -12 2024 -I: pbuilder-time-stamp: 1714703854 +I: Current time: Thu Jun 5 23:10:36 +14 2025 +I: pbuilder-time-stamp: 1749114636 I: Building the build Environment I: extracting base tarball [/var/cache/pbuilder/unstable-reproducible-base.tgz] I: copying local configuration @@ -30,52 +30,84 @@ dpkg-source: info: applying xtest-in-bim1c_norm.patch I: Not using root during the build. I: Installing the build-deps -I: user script /srv/workspace/pbuilder/192368/tmp/hooks/D02_print_environment starting +I: user script /srv/workspace/pbuilder/128791/tmp/hooks/D01_modify_environment starting +debug: Running on ionos15-amd64. +I: Changing host+domainname to test build reproducibility +I: Adding a custom variable just for the fun of it... +I: Changing /bin/sh to bash +'/bin/sh' -> '/bin/bash' +lrwxrwxrwx 1 root root 9 Jun 5 09:10 /bin/sh -> /bin/bash +I: Setting pbuilder2's login shell to /bin/bash +I: Setting pbuilder2's GECOS to second user,second room,second work-phone,second home-phone,second other +I: user script /srv/workspace/pbuilder/128791/tmp/hooks/D01_modify_environment finished +I: user script /srv/workspace/pbuilder/128791/tmp/hooks/D02_print_environment starting I: set - BUILDDIR='/build/reproducible-path' - BUILDUSERGECOS='first user,first room,first work-phone,first home-phone,first other' - BUILDUSERNAME='pbuilder1' - BUILD_ARCH='amd64' - DEBIAN_FRONTEND='noninteractive' - DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=20 ' - DISTRIBUTION='unstable' - HOME='/root' - HOST_ARCH='amd64' + BASH=/bin/sh + BASHOPTS=checkwinsize:cmdhist:complete_fullquote:extquote:force_fignore:globasciiranges:globskipdots:hostcomplete:interactive_comments:patsub_replacement:progcomp:promptvars:sourcepath + BASH_ALIASES=() + BASH_ARGC=() + BASH_ARGV=() + BASH_CMDS=() + BASH_LINENO=([0]="12" [1]="0") + BASH_LOADABLES_PATH=/usr/local/lib/bash:/usr/lib/bash:/opt/local/lib/bash:/usr/pkg/lib/bash:/opt/pkg/lib/bash:. + BASH_SOURCE=([0]="/tmp/hooks/D02_print_environment" [1]="/tmp/hooks/D02_print_environment") + BASH_VERSINFO=([0]="5" [1]="2" [2]="21" [3]="1" [4]="release" [5]="x86_64-pc-linux-gnu") + BASH_VERSION='5.2.21(1)-release' + BUILDDIR=/build/reproducible-path + BUILDUSERGECOS='second user,second room,second work-phone,second home-phone,second other' + BUILDUSERNAME=pbuilder2 + BUILD_ARCH=amd64 + DEBIAN_FRONTEND=noninteractive + DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=42 ' + DIRSTACK=() + DISTRIBUTION=unstable + EUID=0 + FUNCNAME=([0]="Echo" [1]="main") + GROUPS=() + HOME=/root + HOSTNAME=i-capture-the-hostname + HOSTTYPE=x86_64 + HOST_ARCH=amd64 IFS=' ' - INVOCATION_ID='ab48bc47f3634ede882913246b7adfaf' - LANG='C' - LANGUAGE='en_US:en' - LC_ALL='C' - MAIL='/var/mail/root' - OPTIND='1' - PATH='/usr/sbin:/usr/bin:/sbin:/bin:/usr/games' - PBCURRENTCOMMANDLINEOPERATION='build' - PBUILDER_OPERATION='build' - PBUILDER_PKGDATADIR='/usr/share/pbuilder' - PBUILDER_PKGLIBDIR='/usr/lib/pbuilder' - PBUILDER_SYSCONFDIR='/etc' - PPID='192368' - PS1='# ' - PS2='> ' + INVOCATION_ID=17daa212307e46d7a69ca421fafd9b52 + LANG=C + LANGUAGE=et_EE:et + LC_ALL=C + MACHTYPE=x86_64-pc-linux-gnu + MAIL=/var/mail/root + OPTERR=1 + OPTIND=1 + OSTYPE=linux-gnu + PATH=/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path + PBCURRENTCOMMANDLINEOPERATION=build + PBUILDER_OPERATION=build + PBUILDER_PKGDATADIR=/usr/share/pbuilder + PBUILDER_PKGLIBDIR=/usr/lib/pbuilder + PBUILDER_SYSCONFDIR=/etc + PIPESTATUS=([0]="0") + POSIXLY_CORRECT=y + PPID=128791 PS4='+ ' - PWD='/' - SHELL='/bin/bash' - SHLVL='2' - SUDO_COMMAND='/usr/bin/timeout -k 18.1h 18h /usr/bin/ionice -c 3 /usr/bin/nice /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/r-b-build.oCMKRa9o/pbuilderrc_iSyX --distribution unstable --hookdir /etc/pbuilder/first-build-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/unstable-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.oCMKRa9o/b1 --logfile b1/build.log octave-bim_1.1.6-1.dsc' - SUDO_GID='110' - SUDO_UID='105' - SUDO_USER='jenkins' - TERM='unknown' - TZ='/usr/share/zoneinfo/Etc/GMT+12' - USER='root' - _='/usr/bin/systemd-run' - http_proxy='http://46.16.76.132:3128' + PWD=/ + SHELL=/bin/bash + SHELLOPTS=braceexpand:errexit:hashall:interactive-comments:posix + SHLVL=3 + SUDO_COMMAND='/usr/bin/timeout -k 24.1h 24h /usr/bin/ionice -c 3 /usr/bin/nice -n 11 /usr/bin/unshare --uts -- /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/r-b-build.oCMKRa9o/pbuilderrc_1YGJ --distribution unstable --hookdir /etc/pbuilder/rebuild-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/unstable-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.oCMKRa9o/b2 --logfile b2/build.log octave-bim_1.1.6-1.dsc' + SUDO_GID=111 + SUDO_UID=106 + SUDO_USER=jenkins + TERM=unknown + TZ=/usr/share/zoneinfo/Etc/GMT-14 + UID=0 + USER=root + _='I: set' + http_proxy=http://213.165.73.152:3128 I: uname -a - Linux ionos1-amd64 6.1.0-20-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.85-1 (2024-04-11) x86_64 GNU/Linux + Linux i-capture-the-hostname 6.6.13+bpo-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.6.13-1~bpo12+1 (2024-02-15) x86_64 GNU/Linux I: ls -l /bin - lrwxrwxrwx 1 root root 7 May 1 07:43 /bin -> usr/bin -I: user script /srv/workspace/pbuilder/192368/tmp/hooks/D02_print_environment finished + lrwxrwxrwx 1 root root 7 Jun 4 14:05 /bin -> usr/bin +I: user script /srv/workspace/pbuilder/128791/tmp/hooks/D02_print_environment finished -> Attempting to satisfy build-dependencies -> Creating pbuilder-satisfydepends-dummy package Package: pbuilder-satisfydepends-dummy @@ -701,7 +733,7 @@ Get: 582 http://deb.debian.org/debian unstable/main amd64 gmsh amd64 4.12.2+ds1-1 [37.0 kB] Get: 583 http://deb.debian.org/debian unstable/main amd64 octave-splines all 1.3.5-2 [24.7 kB] Get: 584 http://deb.debian.org/debian unstable/main amd64 octave-msh all 1.0.12-1 [24.7 kB] -Fetched 290 MB in 41s (7110 kB/s) +Fetched 290 MB in 47s (6174 kB/s) debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package tzdata. (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 19694 files and directories currently installed.) @@ -2584,8 +2616,8 @@ Setting up tzdata (2024a-4) ... Current default time zone: 'Etc/UTC' -Local time is now: Fri May 3 02:45:27 UTC 2024. -Universal Time is now: Fri May 3 02:45:27 UTC 2024. +Local time is now: Thu Jun 5 09:14:48 UTC 2025. +Universal Time is now: Thu Jun 5 09:14:48 UTC 2025. Run 'dpkg-reconfigure tzdata' if you wish to change it. Setting up liberror-perl (0.17029-2) ... @@ -3105,7 +3137,11 @@ Building tag database... -> Finished parsing the build-deps I: Building the package -I: Running cd /build/reproducible-path/octave-bim-1.1.6/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-buildpackage -us -uc -b && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-genchanges -S > ../octave-bim_1.1.6-1_source.changes +I: user script /srv/workspace/pbuilder/128791/tmp/hooks/A99_set_merged_usr starting +Not re-configuring usrmerge for unstable +I: user script /srv/workspace/pbuilder/128791/tmp/hooks/A99_set_merged_usr finished +hostname: Name or service not known +I: Running cd /build/reproducible-path/octave-bim-1.1.6/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path" HOME="/nonexistent/second-build" dpkg-buildpackage -us -uc -b && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path" HOME="/nonexistent/second-build" dpkg-genchanges -S > ../octave-bim_1.1.6-1_source.changes dpkg-buildpackage: info: source package octave-bim dpkg-buildpackage: info: source version 1.1.6-1 dpkg-buildpackage: info: source distribution unstable @@ -3143,28 +3179,8 @@ Checking package... Run the unit tests... Checking m files ... -[inst/bim1a_axisymmetric_advection_diffusion.m] ->>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim1a_axisymmetric_advection_diffusion.m -***** test - n = 3; - mesh = linspace(1,2,n+1)'; - uex = @(r) exp(r); - duexdr = @(r) uex(r); - d2uexdr2 = @(r) uex(r); - Nnodes = numel(mesh); - Nelements = Nnodes-1; - D = 1; v = 1; - alpha = D*ones(Nelements,1); - gamma = ones(Nnodes,1); - eta = ones(Nnodes,1); - beta = 1/D*v*ones(Nelements,1); - f = @(r) -D./r.*duexdr(r) - D.*d2uexdr2(r) ... - + v./r .* uex(r) + v * duexdr(r); - rhs = bim1a_axisymmetric_rhs(mesh, ones(Nelements,1), f(mesh)); - S = bim1a_axisymmetric_advection_diffusion(mesh,alpha,gamma,eta,beta); - u = zeros(Nnodes,1); u([1,end]) = uex(mesh([1 end])); - u(2:end-1) = S(2:end-1,2:end-1)\(rhs(2:end-1) - S(2:end-1,[1 end])*u([1 end])); - assert(u,uex(mesh),1e-7) +[inst/bim1a_axisymmetric_reaction.m] +>>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim1a_axisymmetric_reaction.m ***** test n = 100; mesh = linspace(0,1,n+1)'; @@ -3172,14 +3188,18 @@ uex = @(r) - r.^2 + 1; Nnodes = numel(mesh); Nelements = Nnodes-1; - D = 1; v = 0; + D = 1; v = cm; sigma = 1; alpha = D*ones(Nelements,1); gamma = ones(Nnodes,1); eta = ones(Nnodes,1); - beta = v; - f = @(r) 4*D; + beta = 0; + delta = ones(Nelements,1); + zeta = sigma*ones(Nnodes,1); + f = @(r) 4*D + sigma*uex(r); rhs = bim1a_axisymmetric_rhs(mesh, ones(Nelements,1), f(mesh)); S = bim1a_axisymmetric_advection_diffusion(mesh,alpha,gamma,eta,beta); + R = bim1a_axisymmetric_reaction(mesh, delta, zeta); + S += R; u = zeros(Nnodes,1); u(end) = uex(mesh(end)); u(1:end-1) = S(1:end-1,1:end-1)\(rhs(1:end-1) - S(1:end-1,end)*u(end)); assert(u,uex(mesh),1e-3) @@ -3190,123 +3210,46 @@ uex = @(r) - r.^2 + 1; Nnodes = numel(mesh); Nelements = Nnodes-1; - D = 1; v = cm; + D = 1; v = cm; sigma = 1; alpha = D*ones(Nelements,1); gamma = ones(Nnodes,1); eta = ones(Nnodes,1); beta = 1/D*v; - f = @(r) 4*D + 2 - 4*r.^2; + delta = ones(Nelements,1); + zeta = sigma*ones(Nnodes,1); + f = @(r) 4*D + 2 - 4*r.^2 + sigma*uex(r); rhs = bim1a_axisymmetric_rhs(mesh, ones(Nelements,1), f(mesh)); S = bim1a_axisymmetric_advection_diffusion(mesh,alpha,gamma,eta,beta); + R = bim1a_axisymmetric_reaction(mesh, delta, zeta); + S += R; u = zeros(Nnodes,1); u(end) = uex(mesh(end)); u(1:end-1) = S(1:end-1,1:end-1)\(rhs(1:end-1) - S(1:end-1,end)*u(end)); assert(u,uex(mesh),1e-3) ***** test x = linspace(0,1,101); - A = bim1a_axisymmetric_advection_diffusion(x,1,1,1,0); - alpha = ones(100,1); - gamma = ones(101,1); - eta = gamma; - B = bim1a_axisymmetric_advection_diffusion(x,alpha,gamma,eta,0); + A = bim1a_axisymmetric_reaction(x,1,1); + delta = ones(100,1); + zeta = ones(101,1); + B = bim1a_axisymmetric_reaction(x,delta,zeta); assert(A,B) -4 tests, 4 passed, 0 known failure, 0 skipped -[inst/bim2a_reaction.m] ->>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim2a_reaction.m -***** shared mesh,delta,zeta,nnodes,nelem -***** test -***** test -***** test -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/bim3c_unknowns_on_faces.m] ->>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim3c_unknowns_on_faces.m -***** shared mesh -***** test -***** test -***** test -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/bim1c_norm.m] ->>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim1c_norm.m -***** xtest -***** shared L, V, m - L = rand (1); V = rand (1); m = linspace (0,1,5).^2; m *= L; - u = V * ones (size (m))'; - uinf = bim1c_norm (m, u, 'inf'); - uL2 = bim1c_norm (m, u, 'L2'); - uH1 = bim1c_norm (m, u, 'H1'); - assert ([uinf, uL2, uH1], [V, V*sqrt(L), V*sqrt(L)], 1e-12); -***** test - u = V * m'; - uinf = bim1c_norm (m, u, 'inf'); - uL2 = bim1c_norm (m, u, 'L2'); - uH1 = bim1c_norm (m, u, 'H1'); - assert ([uinf, uL2, uH1], - [L*V, V*sqrt(L^3/3), V*sqrt(L^3/3 + L)], - 1e-12); -***** test - u = V * ones (size (diff (m)))'; - uinf = bim1c_norm (m, u, 'inf'); - uL2 = bim1c_norm (m, u, 'L2'); - assert ([uinf, uL2], [V, V*sqrt(L)], 1e-12); 3 tests, 3 passed, 0 known failure, 0 skipped -[inst/bim3c_global_flux.m] ->>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim3c_global_flux.m +[inst/bim1a_axisymmetric_rhs.m] +>>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim1a_axisymmetric_rhs.m ***** test - N = 10; pp = linspace (0, 1, N); msh = bim3c_mesh_properties (msh3m_structured_mesh (pp, pp, pp, 1, 1:6)); - u = ones (N^3, 1); - v = ones (N^3, 1); - alpha = ones (columns (msh.t), 1); - F = bim3c_global_flux (msh, u, alpha, v); - assert (norm (F(:), inf), 0, 100*eps); + x = linspace(0,1,101); + A = bim1a_axisymmetric_rhs(x,1,1); + delta = ones(100,1); + zeta = ones(101,1); + B = bim1a_axisymmetric_rhs(x,delta,zeta); + assert(A,B) 1 test, 1 passed, 0 known failure, 0 skipped -[inst/bim3a_rhs.m] ->>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim3a_rhs.m -***** shared mesh,f,g,nnodes,nelem +[inst/bim2c_mesh_properties.m] +>>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim2c_mesh_properties.m +***** shared mesh ***** test ***** test ***** test 3 tests, 3 passed, 0 known failure, 0 skipped -[inst/bim2c_intrp.m] ->>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim2c_intrp.m -***** test - msh = bim2c_mesh_properties (msh2m_structured_mesh (linspace (0, 1, 11), linspace (0, 1, 13), 1, 1:4)); - x = y = linspace (0, 1, 100).'; - u = msh.p(1, :).'; - ui = bim2c_intrp (msh, u, [], [x, y]); - assert (ui, linspace (0, 1, 100), 10*eps); -1 test, 1 passed, 0 known failure, 0 skipped -[inst/bim2c_norm.m] ->>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim2c_norm.m -***** test -***** shared L, V, x, y, m - L = rand (1); V = rand (1); x = linspace (0,L,4); y = x; - m = msh2m_structured_mesh (x,y,1,1:4); - m.area = msh2m_geometrical_properties (m, 'area'); - m.shg = msh2m_geometrical_properties (m, 'shg'); - u = V * ones (columns(m.p),1); - uinf = bim2c_norm (m, u, 'inf'); - uL2 = bim2c_norm (m, u, 'L2'); - uH1 = bim2c_norm (m, u, 'H1'); - assert ([uinf, uL2, uH1], [V, V*L, V*L], 1e-12); -***** test - u = V * (m.p(1,:) + 2*m.p(2,:))'; - uinf = bim2c_norm (m, u, 'inf'); - uL2 = bim2c_norm (m, u, 'L2'); - uH1 = bim2c_norm (m, u, 'H1'); - assert ([uinf, uL2, uH1], - [3*L*V, V*L^2*sqrt(8/3), V*sqrt(8/3*L^4 + 5*L^2)], - 1e-12); -***** test - u = V * ones (columns(m.t),1); - uinf = bim2c_norm (m, u, 'inf'); - uL2 = bim2c_norm (m, u, 'L2'); - assert ([uinf, uL2], [V, V*L], 1e-12); -***** test - u = V * ones (columns(m.t),1); - uvect = [u, 2*u]; - uinf = bim2c_norm (m, uvect, 'inf'); - uL2 = bim2c_norm (m, uvect, 'L2'); - assert ([uinf, uL2], [2*V, V*L*sqrt(5)], 1e-12); -4 tests, 4 passed, 0 known failure, 0 skipped [inst/bim2a_axisymmetric_advection_diffusion.m] >>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim2a_axisymmetric_advection_diffusion.m ***** test @@ -3474,284 +3417,48 @@ B = bim2a_axisymmetric_advection_diffusion(mesh,alpha,gamma,eta,beta); assert(A,B) 7 tests, 7 passed, 0 known failure, 0 skipped -[inst/bim3a_osc_advection_diffusion.m] ->>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim3a_osc_advection_diffusion.m -***** shared msh, epsilon, M, nnodes, nelem, x, y, z -***** test - msh = bim3c_mesh_properties (msh3m_structured_mesh (0:5, 0:5, 0:5, 1, 1:6)); - x = msh.p (1, :).'; - y = msh.p (2, :).'; - z = msh.p (3, :).'; - u = ones (size (x)); - M = bim3a_osc_advection_diffusion (msh, 1, 0); - assert (M * u, zeros (size (u)), eps * 100) -***** test - u = x; - bnd = bim3c_unknowns_on_faces (msh, [1, 2]); - int = setdiff (1:columns (msh.p), bnd); - assert (M(int, int) * u(int), -M(int, bnd) * u(bnd), 100 * eps) -***** test - u = y; - bnd = bim3c_unknowns_on_faces (msh, [3, 4]); - int = setdiff (1:columns (msh.p), bnd); - assert (M(int, int) * u(int), -M(int, bnd) * u(bnd), 100 * eps) -***** test - u = z; - bnd = bim3c_unknowns_on_faces (msh, [5, 6]); - int = setdiff (1:columns (msh.p), bnd); - assert (M(int, int) * u(int), -M(int, bnd) * u(bnd), 100 * eps) -***** test - u = z; - bnd = bim3c_unknowns_on_faces (msh, [5, 6]); - int = setdiff (1:columns (msh.p), bnd); - M = bim3a_osc_advection_diffusion (msh, pi, 0); - assert (M(int, int) * u(int), -M(int, bnd) * u(bnd), 100 * eps) -***** test - M = bim3a_osc_advection_diffusion (msh, 1, x); - assert (norm (sum (M, 1), inf), 0, eps * 100) -***** test - M = bim3a_osc_advection_diffusion (msh, 1, y); - assert (norm (sum (M, 1), inf), 0, eps * 100) -***** test - M = bim3a_osc_advection_diffusion (msh, 1, z); - assert (norm (sum (M, 1), inf), 0, eps * 100) -***** demo - gmsh_input = [["Point(1) = {0, 0, 0, .1}; \n"], ... - ["Point(2) = {1, 0, 0, .1}; \n"], ... - ["Point(3) = {0, -.3, 0, .1}; \n"], ... - ["Point(4) = {0, +.3, 0, .1}; \n"], ... - ["Point(5) = {1, -.3, 0, .1}; \n"], ... - ["Point(6) = {1, 0.3, 0, .1}; \n"], ... - ["Point(7) = {0, 0, -.3, .1}; \n"], ... - ["Point(8) = {0, 0, +.3, .1}; \n"], ... - ["Point(9) = {1, 0, -.3, .1}; \n"], ... - ["Point(10) = {1, 0, 0.3, .1}; \n"], ... - ["Circle(1) = {4, 1, 7}; \n"], ... - ["Circle(2) = {7, 1, 3}; \n"], ... - ["Circle(3) = {3, 1, 8}; \n"], ... - ["Circle(4) = {8, 1, 4}; \n"], ... - ["Circle(5) = {6, 2, 9}; \n"], ... - ["Circle(6) = {9, 2, 5}; \n"], ... - ["Circle(7) = {5, 2, 10}; \n"], ... - ["Circle(8) = {10, 2, 6}; \n"], ... - ["Line(9) = {4, 6}; \n"], ... - ["Line(10) = {3, 5}; \n"], ... - ["Line(11) = {8, 10}; \n"], ... - ["Line(12) = {7, 9}; \n"], ... - ["Line Loop(13) = {4, 1, 2, 3}; \n"], ... - ["Plane Surface(14) = {13}; \n"], ... - ["Line Loop(15) = {5, 6, 7, 8}; \n"], ... - ["Plane Surface(16) = {15}; \n"], ... - ["Line Loop(17) = {9, -8, -11, 4}; \n"], ... - ["Ruled Surface(18) = {17}; \n"], ... - ["Line Loop(19) = {12, -5, -9, 1}; \n"], ... - ["Ruled Surface(20) = {19}; \n"], ... - ["Line Loop(21) = {12, 6, -10, -2}; \n"], ... - ["Ruled Surface(22) = {21}; \n"], ... - ["Line Loop(23) = {11, -7, -10, 3}; \n"], ... - ["Ruled Surface(24) = {23}; \n"], ... - ["Surface Loop(25) = {18, 20, 22, 16, 24, 14}; \n"], ... - ["Volume(26) = {25}; \n"]]; - fname = tmpnam (); - [fid, msg] = fopen (strcat (fname, ".geo"), "w"); - if (fid < 0); error (msg); endif - fputs (fid, gmsh_input); - fclose (fid); - msh = bim3c_mesh_properties (msh3m_gmsh (fname, "clscale", ".25")); - x = msh.p (1, :).'; - u = x; - bnd = bim3c_unknowns_on_faces (msh, [14, 16]); - int = setdiff (1:columns (msh.p), bnd); - Mosc = bim3a_osc_advection_diffusion (msh, 1, msh.p(1,:)'*0); - Mgal = bim3a_advection_diffusion (msh, 1, msh.p(1,:)'*0); - u(int) = Mosc(int, int) \ ( - Mosc(int, bnd) * u(bnd)); - uosc = u; - u(int) = Mgal(int, int) \ ( - Mgal(int, bnd) * u(bnd)); - ugal = u; - fname_out = tmpnam (); - printf ("saving results to %s \n", strcat (fname_out, ".vtu")); - fpl_vtk_raw_write_field (fname_out, msh, {uosc, "u_osc"; ugal, "u_galerkin"}, {}); - unlink (fname); -***** demo - gmsh_input = [["Point(1) = {0, 0, 0, .1}; \n"], ... - ["Point(2) = {1, 0, 0, .1}; \n"], ... - ["Point(3) = {0, -.3, 0, .1}; \n"], ... - ["Point(4) = {0, +.3, 0, .1}; \n"], ... - ["Point(5) = {1, -.3, 0, .1}; \n"], ... - ["Point(6) = {1, 0.3, 0, .1}; \n"], ... - ["Point(7) = {0, 0, -.3, .1}; \n"], ... - ["Point(8) = {0, 0, +.3, .1}; \n"], ... - ["Point(9) = {1, 0, -.3, .1}; \n"], ... - ["Point(10) = {1, 0, 0.3, .1}; \n"], ... - ["Circle(1) = {4, 1, 7}; \n"], ... - ["Circle(2) = {7, 1, 3}; \n"], ... - ["Circle(3) = {3, 1, 8}; \n"], ... - ["Circle(4) = {8, 1, 4}; \n"], ... - ["Circle(5) = {6, 2, 9}; \n"], ... - ["Circle(6) = {9, 2, 5}; \n"], ... - ["Circle(7) = {5, 2, 10}; \n"], ... - ["Circle(8) = {10, 2, 6}; \n"], ... - ["Line(9) = {4, 6}; \n"], ... - ["Line(10) = {3, 5}; \n"], ... - ["Line(11) = {8, 10}; \n"], ... - ["Line(12) = {7, 9}; \n"], ... - ["Line Loop(13) = {4, 1, 2, 3}; \n"], ... - ["Plane Surface(14) = {13}; \n"], ... - ["Line Loop(15) = {5, 6, 7, 8}; \n"], ... - ["Plane Surface(16) = {15}; \n"], ... - ["Line Loop(17) = {9, -8, -11, 4}; \n"], ... - ["Ruled Surface(18) = {17}; \n"], ... - ["Line Loop(19) = {12, -5, -9, 1}; \n"], ... - ["Ruled Surface(20) = {19}; \n"], ... - ["Line Loop(21) = {12, 6, -10, -2}; \n"], ... - ["Ruled Surface(22) = {21}; \n"], ... - ["Line Loop(23) = {11, -7, -10, 3}; \n"], ... - ["Ruled Surface(24) = {23}; \n"], ... - ["Surface Loop(25) = {18, 20, 22, 16, 24, 14}; \n"], ... - ["Volume(26) = {25}; \n"]]; - fname = tmpnam (); - [fid, msg] = fopen (strcat (fname, ".geo"), "w"); - if (fid < 0); error (msg); endif - fputs (fid, gmsh_input); - fclose (fid); - msh = bim3c_mesh_properties (msh3m_gmsh (fname, "clscale", ".25")); - x = msh.p (1, :).'; - u = x; - bnd = bim3c_unknowns_on_faces (msh, [14, 16]); - int = setdiff (1:columns (msh.p), bnd); - Mosc = bim3a_osc_advection_diffusion (msh, 1, msh.p(1,:)'*0); - Mgal = bim3a_advection_diffusion (msh, 1, msh.p(1,:)'*0); - f = bim3a_rhs (msh, 10, 1); - u(int) = Mosc(int, int) \ (f(int) - Mosc(int, bnd) * u(bnd)); - uosc = u; - u(int) = Mgal(int, int) \ (f(int) - Mgal(int, bnd) * u(bnd)); - ugal = u; - fname_out = tmpnam (); - printf ("saving results to %s \n", strcat (fname_out, ".vtu")); - fpl_vtk_raw_write_field (fname_out, msh, {uosc, "u_osc"; ugal, "u_galerkin"}, {}); - unlink (fname); -8 tests, 8 passed, 0 known failure, 0 skipped -[inst/bim2a_axisymmetric_rhs.m] ->>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim2a_axisymmetric_rhs.m -***** shared mesh,f,g,nnodes,nelem -***** test -***** test -***** test -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/bim2c_tri_to_nodes.m] ->>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim2c_tri_to_nodes.m +[inst/bim1a_advection_upwind.m] +>>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim1a_advection_upwind.m ***** test - msh = bim2c_mesh_properties (msh2m_structured_mesh (linspace (0, 1, 3), linspace (0, 1, 3), 1, 1:4, "random")); - nel = columns (msh.t); - nnod = columns (msh.p); - u_tri = randn (nel, 1); - un1 = bim2c_tri_to_nodes (msh, u_tri); - [un2, m] = bim2c_tri_to_nodes (msh, u_tri); - assert (un1, un2, 1e-10) + n = 200; + mesh = linspace(0,1,n+1)'; + uex = @(r) - r.^2 + 1; + Nnodes = numel(mesh); + Nelements = Nnodes-1; + D = 1; v = 1; sigma = 0; + alpha = D*ones(Nelements,1); + gamma = ones(Nnodes,1); + eta = ones(Nnodes,1); + beta = 1/D*v*ones(Nelements,1); + delta = ones(Nelements,1); + zeta = sigma*ones(Nnodes,1); + f = @(r) 2*D - 2*v.*r + sigma*uex(r); + rhs = bim1a_rhs(mesh, ones(Nelements,1), f(mesh)); + S = bim1a_laplacian(mesh,alpha,gamma); + A = bim1a_advection_upwind(mesh, beta); + R = bim1a_reaction(mesh, delta, zeta); + S += (A+R); + u = zeros(Nnodes,1); u([1 end]) = uex(mesh([1 end])); + u(2:end-1) = S(2:end-1,2:end-1)\(rhs(2:end-1) - S(2:end-1,[1 end])*u([1 end])); + assert(u,uex(mesh),1e-3) 1 test, 1 passed, 0 known failure, 0 skipped -[inst/bim3c_intrp.m] ->>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim3c_intrp.m +[inst/bim1a_reaction.m] +>>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim1a_reaction.m ***** test - msh = bim3c_mesh_properties (msh3m_structured_mesh (linspace (0, 1, 11), linspace (0, 1, 9), linspace (0, 1, 13), 1, 1:6)); - x = y = z = linspace (0, 1, 100).'; - u = msh.p(1, :).'; - ui = bim3c_intrp (msh, u, [], [x, y, z]); - assert (ui, linspace (0, 1, 100), 10*eps); + x = linspace(0,1,101); + A = bim1a_reaction(x,1,1); + delta = ones(100,1); + zeta = ones(101,1); + B = bim1a_reaction(x,delta,zeta); + assert(A,B) 1 test, 1 passed, 0 known failure, 0 skipped -[inst/bim3a_reaction.m] ->>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim3a_reaction.m -***** shared mesh,delta,zeta,nnodes,nelem +[inst/bim3a_rhs.m] +>>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim3a_rhs.m +***** shared mesh,f,g,nnodes,nelem ***** test ***** test ***** test 3 tests, 3 passed, 0 known failure, 0 skipped -[inst/bim2a_axisymmetric_boundary_mass.m] ->>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim2a_axisymmetric_boundary_mass.m -***** test - n = 3; - [mesh] = msh2m_structured_mesh(linspace(1,2,n+1),linspace(0,1,n+1),1,1:4); - mesh = bim2c_mesh_properties(mesh); - uex = @(r,z) exp(r); - duexdr = @(r,z) uex(r,z); - d2uexdr2 = @(r,z) uex(r,z); - duexdz = @(r,z) 0*uex(r,z); - d2uexdz2 = @(r,z) 0*uex(r,z); - Rnodesr = bim2c_unknowns_on_side(mesh,[2]); - Rnodesl = bim2c_unknowns_on_side(mesh,[4]); - Nnodes = columns(mesh.p); - Nelements = columns(mesh.t); - D = 1; vr = 1; vz = 0; - alpha = D*ones(Nelements,1); - gamma = ones(Nnodes,1); - eta = ones(Nnodes,1); - beta = 1/D*[vr*ones(1,Nelements); vz*ones(1,Nelements)]; - f = @(r,z) -D./r.*duexdr(r,z) - D.*d2uexdr2(r,z) ... - + vr./r .* uex(r,z) + vr * duexdr(r,z) ... - - D.*d2uexdz2(r,z) + vz * duexdz(r,z); - gr = @(r,z) uex(r,z) - 1 * (-D*duexdr(r,z) + vr*uex(r,z)); - gl = @(r,z) uex(r,z) - (-1) * (-D*duexdr(r,z) + vr*uex(r,z)); - rhs = bim2a_axisymmetric_rhs(mesh, ones(Nelements,1), f(mesh.p(1,:), mesh.p(2,:))); - S = bim2a_axisymmetric_advection_diffusion(mesh,alpha,gamma,eta,beta); - Mr = bim2a_axisymmetric_boundary_mass(mesh,2); Ml = bim2a_axisymmetric_boundary_mass(mesh,4); - S(Rnodesr,Rnodesr) += Mr; - rhs(Rnodesr) += diag(Mr) .* gr(mesh.p(1,Rnodesr), mesh.p(2,Rnodesr))'; - S(Rnodesl,Rnodesl) += Ml; - rhs(Rnodesl) += diag(Ml) .* gl(mesh.p(1,Rnodesl), mesh.p(2,Rnodesl))'; - u = S\rhs; - assert(u,uex(mesh.p(1,:), mesh.p(2,:))',1e-7) -***** test - n = 10; - [mesh] = msh2m_structured_mesh(linspace(1,2,n+1),linspace(0,1,n+1),1,1:4); - mesh = bim2c_mesh_properties(mesh); - uex = @(r,z) exp(r); - duexdr = @(r,z) uex(r,z); - d2uexdr2 = @(r,z) uex(r,z); - duexdz = @(r,z) 0*uex(r,z); - d2uexdz2 = @(r,z) 0*uex(r,z); - Rnodesr = bim2c_unknowns_on_side(mesh,[2]); - Rnodesl = bim2c_unknowns_on_side(mesh,[4]); - Rnodesb = bim2c_unknowns_on_side(mesh,[1]); - Rnodest = bim2c_unknowns_on_side(mesh,[3]); - Nnodes = columns(mesh.p); - Nelements = columns(mesh.t); - D = 1; vr = 1; vz = 0; - alpha = D*ones(Nelements,1); - gamma = ones(Nnodes,1); - eta = ones(Nnodes,1); - beta = 1/D*[vr*ones(1,Nelements); vz*ones(1,Nelements)]; - f = @(r,z) -D./r.*duexdr(r,z) - D.*d2uexdr2(r,z) ... - + vr./r .* uex(r,z) + vr * duexdr(r,z) ... - - D.*d2uexdz2(r,z) + vz * duexdz(r,z); - gr = @(r,z) uex(r,z) - 1 * (-D*duexdr(r,z) + vr*uex(r,z)); - gl = @(r,z) uex(r,z) - (-1) * (-D*duexdr(r,z) + vr*uex(r,z)); - gb = @(r,z) uex(r,z) - (-1) * (-D*duexdz(r,z) + vz*uex(r,z)); - gt = @(r,z) uex(r,z) - 1 * (-D*duexdz(r,z) + vz*uex(r,z)); - rhs = bim2a_axisymmetric_rhs(mesh, ones(Nelements,1), f(mesh.p(1,:), mesh.p(2,:))); - S = bim2a_axisymmetric_advection_diffusion(mesh,alpha,gamma,eta,beta); - Mr = bim2a_axisymmetric_boundary_mass(mesh,2); Ml = bim2a_axisymmetric_boundary_mass(mesh,4); - Mb = bim2a_axisymmetric_boundary_mass(mesh,1); Mt = bim2a_axisymmetric_boundary_mass(mesh,3); - S(Rnodesr,Rnodesr) += Mr; - rhs(Rnodesr) += diag(Mr) .* gr(mesh.p(1,Rnodesr), mesh.p(2,Rnodesr))'; - S(Rnodesl,Rnodesl) += Ml; - rhs(Rnodesl) += diag(Ml) .* gl(mesh.p(1,Rnodesl), mesh.p(2,Rnodesl))'; - S(Rnodesb,Rnodesb) += Mb; - rhs(Rnodesb) += diag(Mb) .* gb(mesh.p(1,Rnodesb), mesh.p(2,Rnodesb))'; - S(Rnodest,Rnodest) += Mt; - rhs(Rnodest) += diag(Mt) .* gt(mesh.p(1,Rnodest), mesh.p(2,Rnodest))'; - u = S\rhs; - assert(u,uex(mesh.p(1,:), mesh.p(2,:))',1e-7) -2 tests, 2 passed, 0 known failure, 0 skipped -[inst/bim3c_tri_to_nodes.m] ->>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim3c_tri_to_nodes.m -***** test - msh = bim3c_mesh_properties (msh3m_structured_mesh (linspace (0, 1, 31), linspace (0, 1, 13), linspace (0, 1, 13), 1, 1:6)); - nel = columns (msh.t); - nnod = columns (msh.p); - u_tri = randn (nel, 1); - un1 = bim3c_tri_to_nodes (msh, u_tri); - [un2, m] = bim3c_tri_to_nodes (msh, u_tri); - assert (un1, un2, 1e-10) -1 test, 1 passed, 0 known failure, 0 skipped [inst/bim3a_laplacian.m] >>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim3a_laplacian.m ***** shared mesh,epsilon,kappa,nnodes,nelem @@ -3759,44 +3466,6 @@ ***** test ***** test 3 tests, 3 passed, 0 known failure, 0 skipped -[inst/bim2a_axisymmetric_reaction.m] ->>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim2a_axisymmetric_reaction.m -***** shared mesh,delta,zeta,nnodes,nelem -***** test -***** test -***** test -***** test - n = 20; - [mesh] = msh2m_structured_mesh(linspace(1,2,n+1),linspace(0,1,n+1),1,1:4); - mesh = bim2c_mesh_properties(mesh); - uex = @(r,z) exp(r) .* exp(1-z); - duexdr = @(r,z) uex(r,z); - d2uexdr2 = @(r,z) uex(r,z); - duexdz = @(r,z) -uex(r,z); - d2uexdz2 = @(r,z) uex(r,z); - Dnodes = bim2c_unknowns_on_side(mesh,[1,2,3,4]); - Nnodes = columns(mesh.p); - Nelements = columns(mesh.t); - Varnodes = setdiff(1:Nnodes,Dnodes); - D = 1; vr = 1; vz = 1; sigma = 1; - alpha = D*ones(Nelements,1); - gamma = ones(Nnodes,1); - eta = ones(Nnodes,1); - delta = sigma*ones(columns(mesh.t),1); - zeta = ones(columns(mesh.p),1); - beta = 1/D*[vr*ones(1,Nelements); vz*ones(1,Nelements)]; - f = @(r,z) -D./r.*duexdr(r,z) - D.*d2uexdr2(r,z) ... - + vr./r .* uex(r,z) + vr * duexdr(r,z) ... - - D.*d2uexdz2(r,z) + vz * duexdz(r,z) ... - + sigma * uex(r,z); - rhs = bim2a_axisymmetric_rhs(mesh, ones(Nelements,1), f(mesh.p(1,:), mesh.p(2,:))); - S = bim2a_axisymmetric_advection_diffusion(mesh,alpha,gamma,eta,beta); - C = bim2a_axisymmetric_reaction(mesh,delta,zeta); - S += C; - u = zeros(Nnodes,1); u(Dnodes) = uex(mesh.p(1,Dnodes), mesh.p(2,Dnodes)); - u(Varnodes) = S(Varnodes,Varnodes)\(rhs(Varnodes) - S(Varnodes,Dnodes)*u(Dnodes)); - assert(u,uex(mesh.p(1,:), mesh.p(2,:))',1e-3) -4 tests, 4 passed, 0 known failure, 0 skipped [inst/bim3c_mesh_properties.m] >>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim3c_mesh_properties.m ***** shared mesh @@ -3805,33 +3474,70 @@ ***** test ***** test 4 tests, 4 passed, 0 known failure, 0 skipped -[inst/bim2c_mesh_properties.m] ->>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim2c_mesh_properties.m -***** shared mesh +[inst/bim2a_axisymmetric_rhs.m] +>>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim2a_axisymmetric_rhs.m +***** shared mesh,f,g,nnodes,nelem ***** test ***** test ***** test 3 tests, 3 passed, 0 known failure, 0 skipped -[inst/bim1a_reaction.m] ->>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim1a_reaction.m +[inst/bim3c_norm.m] +>>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim3c_norm.m ***** test - x = linspace(0,1,101); - A = bim1a_reaction(x,1,1); - delta = ones(100,1); - zeta = ones(101,1); - B = bim1a_reaction(x,delta,zeta); - assert(A,B) -1 test, 1 passed, 0 known failure, 0 skipped -[inst/bim1a_rhs.m] ->>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim1a_rhs.m +***** shared L, V, x, y, z, m + L = rand (1); V = rand (1); x = linspace (0,L,4); y = x; z = x; + m = msh3m_structured_mesh (x,y,z,1,1:6); + m.area = msh3m_geometrical_properties (m, 'area'); + m.shg = msh3m_geometrical_properties (m, 'shg'); + u = V * ones (columns(m.p),1); + uinf = bim3c_norm (m, u, 'inf'); + uL2 = bim3c_norm (m, u, 'L2'); + uH1 = bim3c_norm (m, u, 'H1'); + assert ([uinf, uL2, uH1], [V, V*sqrt(L^3), V*sqrt(L^3)], 1e-12); ***** test - x = linspace(0,1,101); - A = bim1a_rhs(x,1,1); - delta = ones(100,1); - zeta = ones(101,1); - B = bim1a_rhs(x,delta,zeta); - assert(A,B) -1 test, 1 passed, 0 known failure, 0 skipped + u = V * (m.p(1,:) + 2*m.p(2,:) + 3*m.p(3,:))'; + uinf = bim3c_norm (m, u, 'inf'); + uL2 = bim3c_norm (m, u, 'L2'); + uH1 = bim3c_norm (m, u, 'H1'); + assert ([uinf, uL2, uH1], + [6*L*V, V*sqrt(61/6*L^5), V*sqrt(61/6*L^5 + 14*L^3)], + 1e-12); +***** test + u = V * ones (columns(m.t),1); + uinf = bim3c_norm (m, u, 'inf'); + uL2 = bim3c_norm (m, u, 'L2'); + assert ([uinf, uL2], [V, V*sqrt(L^3)], 1e-12); +***** test + u = V * ones (columns(m.t),1); + uvect = [u, 2*u, 3*u]; + uinf = bim3c_norm (m, uvect, 'inf'); + uL2 = bim3c_norm (m, uvect, 'L2'); + assert ([uinf, uL2], [3*V, V*sqrt(14*L^3)], 1e-12); +4 tests, 4 passed, 0 known failure, 0 skipped +[inst/bim1c_norm.m] +>>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim1c_norm.m +***** xtest +***** shared L, V, m + L = rand (1); V = rand (1); m = linspace (0,1,5).^2; m *= L; + u = V * ones (size (m))'; + uinf = bim1c_norm (m, u, 'inf'); + uL2 = bim1c_norm (m, u, 'L2'); + uH1 = bim1c_norm (m, u, 'H1'); + assert ([uinf, uL2, uH1], [V, V*sqrt(L), V*sqrt(L)], 1e-12); +***** test + u = V * m'; + uinf = bim1c_norm (m, u, 'inf'); + uL2 = bim1c_norm (m, u, 'L2'); + uH1 = bim1c_norm (m, u, 'H1'); + assert ([uinf, uL2, uH1], + [L*V, V*sqrt(L^3/3), V*sqrt(L^3/3 + L)], + 1e-12); +***** test + u = V * ones (size (diff (m)))'; + uinf = bim1c_norm (m, u, 'inf'); + uL2 = bim1c_norm (m, u, 'L2'); + assert ([uinf, uL2], [V, V*sqrt(L)], 1e-12); +3 tests, 3 passed, 0 known failure, 0 skipped [inst/bim2a_advection_diffusion.m] >>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim2a_advection_diffusion.m ***** test @@ -3970,6 +3676,104 @@ B = bim2a_advection_diffusion(mesh,alpha,gamma,eta,beta); assert(A,B) 8 tests, 8 passed, 0 known failure, 0 skipped +[inst/bim2a_reaction.m] +>>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim2a_reaction.m +***** shared mesh,delta,zeta,nnodes,nelem +***** test +***** test +***** test +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/bim3c_intrp.m] +>>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim3c_intrp.m +***** test + msh = bim3c_mesh_properties (msh3m_structured_mesh (linspace (0, 1, 11), linspace (0, 1, 9), linspace (0, 1, 13), 1, 1:6)); + x = y = z = linspace (0, 1, 100).'; + u = msh.p(1, :).'; + ui = bim3c_intrp (msh, u, [], [x, y, z]); + assert (ui, linspace (0, 1, 100), 10*eps); +1 test, 1 passed, 0 known failure, 0 skipped +[inst/bim2c_norm.m] +>>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim2c_norm.m +***** test +***** shared L, V, x, y, m + L = rand (1); V = rand (1); x = linspace (0,L,4); y = x; + m = msh2m_structured_mesh (x,y,1,1:4); + m.area = msh2m_geometrical_properties (m, 'area'); + m.shg = msh2m_geometrical_properties (m, 'shg'); + u = V * ones (columns(m.p),1); + uinf = bim2c_norm (m, u, 'inf'); + uL2 = bim2c_norm (m, u, 'L2'); + uH1 = bim2c_norm (m, u, 'H1'); + assert ([uinf, uL2, uH1], [V, V*L, V*L], 1e-12); +***** test + u = V * (m.p(1,:) + 2*m.p(2,:))'; + uinf = bim2c_norm (m, u, 'inf'); + uL2 = bim2c_norm (m, u, 'L2'); + uH1 = bim2c_norm (m, u, 'H1'); + assert ([uinf, uL2, uH1], + [3*L*V, V*L^2*sqrt(8/3), V*sqrt(8/3*L^4 + 5*L^2)], + 1e-12); +***** test + u = V * ones (columns(m.t),1); + uinf = bim2c_norm (m, u, 'inf'); + uL2 = bim2c_norm (m, u, 'L2'); + assert ([uinf, uL2], [V, V*L], 1e-12); +***** test + u = V * ones (columns(m.t),1); + uvect = [u, 2*u]; + uinf = bim2c_norm (m, uvect, 'inf'); + uL2 = bim2c_norm (m, uvect, 'L2'); + assert ([uinf, uL2], [2*V, V*L*sqrt(5)], 1e-12); +4 tests, 4 passed, 0 known failure, 0 skipped +[inst/bim2a_axisymmetric_reaction.m] +>>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim2a_axisymmetric_reaction.m +***** shared mesh,delta,zeta,nnodes,nelem +***** test +***** test +***** test +***** test + n = 20; + [mesh] = msh2m_structured_mesh(linspace(1,2,n+1),linspace(0,1,n+1),1,1:4); + mesh = bim2c_mesh_properties(mesh); + uex = @(r,z) exp(r) .* exp(1-z); + duexdr = @(r,z) uex(r,z); + d2uexdr2 = @(r,z) uex(r,z); + duexdz = @(r,z) -uex(r,z); + d2uexdz2 = @(r,z) uex(r,z); + Dnodes = bim2c_unknowns_on_side(mesh,[1,2,3,4]); + Nnodes = columns(mesh.p); + Nelements = columns(mesh.t); + Varnodes = setdiff(1:Nnodes,Dnodes); + D = 1; vr = 1; vz = 1; sigma = 1; + alpha = D*ones(Nelements,1); + gamma = ones(Nnodes,1); + eta = ones(Nnodes,1); + delta = sigma*ones(columns(mesh.t),1); + zeta = ones(columns(mesh.p),1); + beta = 1/D*[vr*ones(1,Nelements); vz*ones(1,Nelements)]; + f = @(r,z) -D./r.*duexdr(r,z) - D.*d2uexdr2(r,z) ... + + vr./r .* uex(r,z) + vr * duexdr(r,z) ... + - D.*d2uexdz2(r,z) + vz * duexdz(r,z) ... + + sigma * uex(r,z); + rhs = bim2a_axisymmetric_rhs(mesh, ones(Nelements,1), f(mesh.p(1,:), mesh.p(2,:))); + S = bim2a_axisymmetric_advection_diffusion(mesh,alpha,gamma,eta,beta); + C = bim2a_axisymmetric_reaction(mesh,delta,zeta); + S += C; + u = zeros(Nnodes,1); u(Dnodes) = uex(mesh.p(1,Dnodes), mesh.p(2,Dnodes)); + u(Varnodes) = S(Varnodes,Varnodes)\(rhs(Varnodes) - S(Varnodes,Dnodes)*u(Dnodes)); + assert(u,uex(mesh.p(1,:), mesh.p(2,:))',1e-3) +4 tests, 4 passed, 0 known failure, 0 skipped +[inst/bim1a_advection_diffusion.m] +>>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim1a_advection_diffusion.m +***** test + x = linspace(0,1,101); + A = bim1a_advection_diffusion(x,1,1,1,0); + alpha = ones(100,1); + gamma = ones(101,1); + eta = gamma; + B = bim1a_advection_diffusion(x,alpha,gamma,eta,0); + assert(A,B) +1 test, 1 passed, 0 known failure, 0 skipped [inst/bim2a_rhs.m] >>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim2a_rhs.m ***** shared mesh,f,g,nnodes,nelem @@ -4010,59 +3814,12 @@ M = bim3a_osc_laplacian (msh, pi); assert (M(int, int) * u(int), -M(int, bnd) * u(bnd), 100 * eps) 5 tests, 5 passed, 0 known failure, 0 skipped -[inst/bim1a_axisymmetric_reaction.m] ->>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim1a_axisymmetric_reaction.m +[inst/bim3a_reaction.m] +>>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim3a_reaction.m +***** shared mesh,delta,zeta,nnodes,nelem ***** test - n = 100; - mesh = linspace(0,1,n+1)'; - cm = (mesh(1:end-1) + mesh(2:end))/2; - uex = @(r) - r.^2 + 1; - Nnodes = numel(mesh); - Nelements = Nnodes-1; - D = 1; v = cm; sigma = 1; - alpha = D*ones(Nelements,1); - gamma = ones(Nnodes,1); - eta = ones(Nnodes,1); - beta = 0; - delta = ones(Nelements,1); - zeta = sigma*ones(Nnodes,1); - f = @(r) 4*D + sigma*uex(r); - rhs = bim1a_axisymmetric_rhs(mesh, ones(Nelements,1), f(mesh)); - S = bim1a_axisymmetric_advection_diffusion(mesh,alpha,gamma,eta,beta); - R = bim1a_axisymmetric_reaction(mesh, delta, zeta); - S += R; - u = zeros(Nnodes,1); u(end) = uex(mesh(end)); - u(1:end-1) = S(1:end-1,1:end-1)\(rhs(1:end-1) - S(1:end-1,end)*u(end)); - assert(u,uex(mesh),1e-3) ***** test - n = 100; - mesh = linspace(0,1,n+1)'; - cm = (mesh(1:end-1) + mesh(2:end))/2; - uex = @(r) - r.^2 + 1; - Nnodes = numel(mesh); - Nelements = Nnodes-1; - D = 1; v = cm; sigma = 1; - alpha = D*ones(Nelements,1); - gamma = ones(Nnodes,1); - eta = ones(Nnodes,1); - beta = 1/D*v; - delta = ones(Nelements,1); - zeta = sigma*ones(Nnodes,1); - f = @(r) 4*D + 2 - 4*r.^2 + sigma*uex(r); - rhs = bim1a_axisymmetric_rhs(mesh, ones(Nelements,1), f(mesh)); - S = bim1a_axisymmetric_advection_diffusion(mesh,alpha,gamma,eta,beta); - R = bim1a_axisymmetric_reaction(mesh, delta, zeta); - S += R; - u = zeros(Nnodes,1); u(end) = uex(mesh(end)); - u(1:end-1) = S(1:end-1,1:end-1)\(rhs(1:end-1) - S(1:end-1,end)*u(end)); - assert(u,uex(mesh),1e-3) ***** test - x = linspace(0,1,101); - A = bim1a_axisymmetric_reaction(x,1,1); - delta = ones(100,1); - zeta = ones(101,1); - B = bim1a_axisymmetric_reaction(x,delta,zeta); - assert(A,B) 3 tests, 3 passed, 0 known failure, 0 skipped [inst/bim1a_axisymmetric_advection_upwind.m] >>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim1a_axisymmetric_advection_upwind.m @@ -4088,50 +3845,120 @@ uh = M \ rhs; assert(uh, uex(mesh), 1e-3); 1 test, 1 passed, 0 known failure, 0 skipped -[inst/bim3c_norm.m] ->>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim3c_norm.m +[inst/bim3c_global_flux.m] +>>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim3c_global_flux.m ***** test -***** shared L, V, x, y, z, m - L = rand (1); V = rand (1); x = linspace (0,L,4); y = x; z = x; - m = msh3m_structured_mesh (x,y,z,1,1:6); - m.area = msh3m_geometrical_properties (m, 'area'); - m.shg = msh3m_geometrical_properties (m, 'shg'); - u = V * ones (columns(m.p),1); - uinf = bim3c_norm (m, u, 'inf'); - uL2 = bim3c_norm (m, u, 'L2'); - uH1 = bim3c_norm (m, u, 'H1'); - assert ([uinf, uL2, uH1], [V, V*sqrt(L^3), V*sqrt(L^3)], 1e-12); + N = 10; pp = linspace (0, 1, N); msh = bim3c_mesh_properties (msh3m_structured_mesh (pp, pp, pp, 1, 1:6)); + u = ones (N^3, 1); + v = ones (N^3, 1); + alpha = ones (columns (msh.t), 1); + F = bim3c_global_flux (msh, u, alpha, v); + assert (norm (F(:), inf), 0, 100*eps); +1 test, 1 passed, 0 known failure, 0 skipped +[inst/bim1a_rhs.m] +>>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim1a_rhs.m ***** test - u = V * (m.p(1,:) + 2*m.p(2,:) + 3*m.p(3,:))'; - uinf = bim3c_norm (m, u, 'inf'); - uL2 = bim3c_norm (m, u, 'L2'); - uH1 = bim3c_norm (m, u, 'H1'); - assert ([uinf, uL2, uH1], - [6*L*V, V*sqrt(61/6*L^5), V*sqrt(61/6*L^5 + 14*L^3)], - 1e-12); + x = linspace(0,1,101); + A = bim1a_rhs(x,1,1); + delta = ones(100,1); + zeta = ones(101,1); + B = bim1a_rhs(x,delta,zeta); + assert(A,B) +1 test, 1 passed, 0 known failure, 0 skipped +[inst/bim3c_tri_to_nodes.m] +>>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim3c_tri_to_nodes.m ***** test - u = V * ones (columns(m.t),1); - uinf = bim3c_norm (m, u, 'inf'); - uL2 = bim3c_norm (m, u, 'L2'); - assert ([uinf, uL2], [V, V*sqrt(L^3)], 1e-12); + msh = bim3c_mesh_properties (msh3m_structured_mesh (linspace (0, 1, 31), linspace (0, 1, 13), linspace (0, 1, 13), 1, 1:6)); + nel = columns (msh.t); + nnod = columns (msh.p); + u_tri = randn (nel, 1); + un1 = bim3c_tri_to_nodes (msh, u_tri); + [un2, m] = bim3c_tri_to_nodes (msh, u_tri); + assert (un1, un2, 1e-10) +1 test, 1 passed, 0 known failure, 0 skipped +[inst/bim2c_intrp.m] +>>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim2c_intrp.m ***** test - u = V * ones (columns(m.t),1); - uvect = [u, 2*u, 3*u]; - uinf = bim3c_norm (m, uvect, 'inf'); - uL2 = bim3c_norm (m, uvect, 'L2'); - assert ([uinf, uL2], [3*V, V*sqrt(14*L^3)], 1e-12); -4 tests, 4 passed, 0 known failure, 0 skipped -[inst/bim1a_advection_diffusion.m] ->>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim1a_advection_diffusion.m + msh = bim2c_mesh_properties (msh2m_structured_mesh (linspace (0, 1, 11), linspace (0, 1, 13), 1, 1:4)); + x = y = linspace (0, 1, 100).'; + u = msh.p(1, :).'; + ui = bim2c_intrp (msh, u, [], [x, y]); + assert (ui, linspace (0, 1, 100), 10*eps); +1 test, 1 passed, 0 known failure, 0 skipped +[inst/bim3c_unknowns_on_faces.m] +>>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim3c_unknowns_on_faces.m +***** shared mesh +***** test +***** test +***** test +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/bim1a_axisymmetric_advection_diffusion.m] +>>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim1a_axisymmetric_advection_diffusion.m +***** test + n = 3; + mesh = linspace(1,2,n+1)'; + uex = @(r) exp(r); + duexdr = @(r) uex(r); + d2uexdr2 = @(r) uex(r); + Nnodes = numel(mesh); + Nelements = Nnodes-1; + D = 1; v = 1; + alpha = D*ones(Nelements,1); + gamma = ones(Nnodes,1); + eta = ones(Nnodes,1); + beta = 1/D*v*ones(Nelements,1); + f = @(r) -D./r.*duexdr(r) - D.*d2uexdr2(r) ... + + v./r .* uex(r) + v * duexdr(r); + rhs = bim1a_axisymmetric_rhs(mesh, ones(Nelements,1), f(mesh)); + S = bim1a_axisymmetric_advection_diffusion(mesh,alpha,gamma,eta,beta); + u = zeros(Nnodes,1); u([1,end]) = uex(mesh([1 end])); + u(2:end-1) = S(2:end-1,2:end-1)\(rhs(2:end-1) - S(2:end-1,[1 end])*u([1 end])); + assert(u,uex(mesh),1e-7) +***** test + n = 100; + mesh = linspace(0,1,n+1)'; + cm = (mesh(1:end-1) + mesh(2:end))/2; + uex = @(r) - r.^2 + 1; + Nnodes = numel(mesh); + Nelements = Nnodes-1; + D = 1; v = 0; + alpha = D*ones(Nelements,1); + gamma = ones(Nnodes,1); + eta = ones(Nnodes,1); + beta = v; + f = @(r) 4*D; + rhs = bim1a_axisymmetric_rhs(mesh, ones(Nelements,1), f(mesh)); + S = bim1a_axisymmetric_advection_diffusion(mesh,alpha,gamma,eta,beta); + u = zeros(Nnodes,1); u(end) = uex(mesh(end)); + u(1:end-1) = S(1:end-1,1:end-1)\(rhs(1:end-1) - S(1:end-1,end)*u(end)); + assert(u,uex(mesh),1e-3) +***** test + n = 100; + mesh = linspace(0,1,n+1)'; + cm = (mesh(1:end-1) + mesh(2:end))/2; + uex = @(r) - r.^2 + 1; + Nnodes = numel(mesh); + Nelements = Nnodes-1; + D = 1; v = cm; + alpha = D*ones(Nelements,1); + gamma = ones(Nnodes,1); + eta = ones(Nnodes,1); + beta = 1/D*v; + f = @(r) 4*D + 2 - 4*r.^2; + rhs = bim1a_axisymmetric_rhs(mesh, ones(Nelements,1), f(mesh)); + S = bim1a_axisymmetric_advection_diffusion(mesh,alpha,gamma,eta,beta); + u = zeros(Nnodes,1); u(end) = uex(mesh(end)); + u(1:end-1) = S(1:end-1,1:end-1)\(rhs(1:end-1) - S(1:end-1,end)*u(end)); + assert(u,uex(mesh),1e-3) ***** test x = linspace(0,1,101); - A = bim1a_advection_diffusion(x,1,1,1,0); + A = bim1a_axisymmetric_advection_diffusion(x,1,1,1,0); alpha = ones(100,1); gamma = ones(101,1); eta = gamma; - B = bim1a_advection_diffusion(x,alpha,gamma,eta,0); + B = bim1a_axisymmetric_advection_diffusion(x,alpha,gamma,eta,0); assert(A,B) -1 test, 1 passed, 0 known failure, 0 skipped +4 tests, 4 passed, 0 known failure, 0 skipped [inst/bim1c_elem_to_nodes.m] >>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim1c_elem_to_nodes.m ***** test @@ -4147,40 +3974,249 @@ assert (un1, un3, 1e-10) assert (un1, un4, 1e-10) 1 test, 1 passed, 0 known failure, 0 skipped -[inst/bim1a_advection_upwind.m] ->>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim1a_advection_upwind.m +[inst/bim2a_axisymmetric_boundary_mass.m] +>>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim2a_axisymmetric_boundary_mass.m ***** test - n = 200; - mesh = linspace(0,1,n+1)'; - uex = @(r) - r.^2 + 1; - Nnodes = numel(mesh); - Nelements = Nnodes-1; - D = 1; v = 1; sigma = 0; + n = 3; + [mesh] = msh2m_structured_mesh(linspace(1,2,n+1),linspace(0,1,n+1),1,1:4); + mesh = bim2c_mesh_properties(mesh); + uex = @(r,z) exp(r); + duexdr = @(r,z) uex(r,z); + d2uexdr2 = @(r,z) uex(r,z); + duexdz = @(r,z) 0*uex(r,z); + d2uexdz2 = @(r,z) 0*uex(r,z); + Rnodesr = bim2c_unknowns_on_side(mesh,[2]); + Rnodesl = bim2c_unknowns_on_side(mesh,[4]); + Nnodes = columns(mesh.p); + Nelements = columns(mesh.t); + D = 1; vr = 1; vz = 0; alpha = D*ones(Nelements,1); gamma = ones(Nnodes,1); eta = ones(Nnodes,1); - beta = 1/D*v*ones(Nelements,1); - delta = ones(Nelements,1); - zeta = sigma*ones(Nnodes,1); - f = @(r) 2*D - 2*v.*r + sigma*uex(r); - rhs = bim1a_rhs(mesh, ones(Nelements,1), f(mesh)); - S = bim1a_laplacian(mesh,alpha,gamma); - A = bim1a_advection_upwind(mesh, beta); - R = bim1a_reaction(mesh, delta, zeta); - S += (A+R); - u = zeros(Nnodes,1); u([1 end]) = uex(mesh([1 end])); - u(2:end-1) = S(2:end-1,2:end-1)\(rhs(2:end-1) - S(2:end-1,[1 end])*u([1 end])); - assert(u,uex(mesh),1e-3) -1 test, 1 passed, 0 known failure, 0 skipped -[inst/bim1a_axisymmetric_rhs.m] ->>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim1a_axisymmetric_rhs.m + beta = 1/D*[vr*ones(1,Nelements); vz*ones(1,Nelements)]; + f = @(r,z) -D./r.*duexdr(r,z) - D.*d2uexdr2(r,z) ... + + vr./r .* uex(r,z) + vr * duexdr(r,z) ... + - D.*d2uexdz2(r,z) + vz * duexdz(r,z); + gr = @(r,z) uex(r,z) - 1 * (-D*duexdr(r,z) + vr*uex(r,z)); + gl = @(r,z) uex(r,z) - (-1) * (-D*duexdr(r,z) + vr*uex(r,z)); + rhs = bim2a_axisymmetric_rhs(mesh, ones(Nelements,1), f(mesh.p(1,:), mesh.p(2,:))); + S = bim2a_axisymmetric_advection_diffusion(mesh,alpha,gamma,eta,beta); + Mr = bim2a_axisymmetric_boundary_mass(mesh,2); Ml = bim2a_axisymmetric_boundary_mass(mesh,4); + S(Rnodesr,Rnodesr) += Mr; + rhs(Rnodesr) += diag(Mr) .* gr(mesh.p(1,Rnodesr), mesh.p(2,Rnodesr))'; + S(Rnodesl,Rnodesl) += Ml; + rhs(Rnodesl) += diag(Ml) .* gl(mesh.p(1,Rnodesl), mesh.p(2,Rnodesl))'; + u = S\rhs; + assert(u,uex(mesh.p(1,:), mesh.p(2,:))',1e-7) ***** test - x = linspace(0,1,101); - A = bim1a_axisymmetric_rhs(x,1,1); - delta = ones(100,1); - zeta = ones(101,1); - B = bim1a_axisymmetric_rhs(x,delta,zeta); - assert(A,B) + n = 10; + [mesh] = msh2m_structured_mesh(linspace(1,2,n+1),linspace(0,1,n+1),1,1:4); + mesh = bim2c_mesh_properties(mesh); + uex = @(r,z) exp(r); + duexdr = @(r,z) uex(r,z); + d2uexdr2 = @(r,z) uex(r,z); + duexdz = @(r,z) 0*uex(r,z); + d2uexdz2 = @(r,z) 0*uex(r,z); + Rnodesr = bim2c_unknowns_on_side(mesh,[2]); + Rnodesl = bim2c_unknowns_on_side(mesh,[4]); + Rnodesb = bim2c_unknowns_on_side(mesh,[1]); + Rnodest = bim2c_unknowns_on_side(mesh,[3]); + Nnodes = columns(mesh.p); + Nelements = columns(mesh.t); + D = 1; vr = 1; vz = 0; + alpha = D*ones(Nelements,1); + gamma = ones(Nnodes,1); + eta = ones(Nnodes,1); + beta = 1/D*[vr*ones(1,Nelements); vz*ones(1,Nelements)]; + f = @(r,z) -D./r.*duexdr(r,z) - D.*d2uexdr2(r,z) ... + + vr./r .* uex(r,z) + vr * duexdr(r,z) ... + - D.*d2uexdz2(r,z) + vz * duexdz(r,z); + gr = @(r,z) uex(r,z) - 1 * (-D*duexdr(r,z) + vr*uex(r,z)); + gl = @(r,z) uex(r,z) - (-1) * (-D*duexdr(r,z) + vr*uex(r,z)); + gb = @(r,z) uex(r,z) - (-1) * (-D*duexdz(r,z) + vz*uex(r,z)); + gt = @(r,z) uex(r,z) - 1 * (-D*duexdz(r,z) + vz*uex(r,z)); + rhs = bim2a_axisymmetric_rhs(mesh, ones(Nelements,1), f(mesh.p(1,:), mesh.p(2,:))); + S = bim2a_axisymmetric_advection_diffusion(mesh,alpha,gamma,eta,beta); + Mr = bim2a_axisymmetric_boundary_mass(mesh,2); Ml = bim2a_axisymmetric_boundary_mass(mesh,4); + Mb = bim2a_axisymmetric_boundary_mass(mesh,1); Mt = bim2a_axisymmetric_boundary_mass(mesh,3); + S(Rnodesr,Rnodesr) += Mr; + rhs(Rnodesr) += diag(Mr) .* gr(mesh.p(1,Rnodesr), mesh.p(2,Rnodesr))'; + S(Rnodesl,Rnodesl) += Ml; + rhs(Rnodesl) += diag(Ml) .* gl(mesh.p(1,Rnodesl), mesh.p(2,Rnodesl))'; + S(Rnodesb,Rnodesb) += Mb; + rhs(Rnodesb) += diag(Mb) .* gb(mesh.p(1,Rnodesb), mesh.p(2,Rnodesb))'; + S(Rnodest,Rnodest) += Mt; + rhs(Rnodest) += diag(Mt) .* gt(mesh.p(1,Rnodest), mesh.p(2,Rnodest))'; + u = S\rhs; + assert(u,uex(mesh.p(1,:), mesh.p(2,:))',1e-7) +2 tests, 2 passed, 0 known failure, 0 skipped +[inst/bim3a_osc_advection_diffusion.m] +>>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim3a_osc_advection_diffusion.m +***** shared msh, epsilon, M, nnodes, nelem, x, y, z +***** test + msh = bim3c_mesh_properties (msh3m_structured_mesh (0:5, 0:5, 0:5, 1, 1:6)); + x = msh.p (1, :).'; + y = msh.p (2, :).'; + z = msh.p (3, :).'; + u = ones (size (x)); + M = bim3a_osc_advection_diffusion (msh, 1, 0); + assert (M * u, zeros (size (u)), eps * 100) +***** test + u = x; + bnd = bim3c_unknowns_on_faces (msh, [1, 2]); + int = setdiff (1:columns (msh.p), bnd); + assert (M(int, int) * u(int), -M(int, bnd) * u(bnd), 100 * eps) +***** test + u = y; + bnd = bim3c_unknowns_on_faces (msh, [3, 4]); + int = setdiff (1:columns (msh.p), bnd); + assert (M(int, int) * u(int), -M(int, bnd) * u(bnd), 100 * eps) +***** test + u = z; + bnd = bim3c_unknowns_on_faces (msh, [5, 6]); + int = setdiff (1:columns (msh.p), bnd); + assert (M(int, int) * u(int), -M(int, bnd) * u(bnd), 100 * eps) +***** test + u = z; + bnd = bim3c_unknowns_on_faces (msh, [5, 6]); + int = setdiff (1:columns (msh.p), bnd); + M = bim3a_osc_advection_diffusion (msh, pi, 0); + assert (M(int, int) * u(int), -M(int, bnd) * u(bnd), 100 * eps) +***** test + M = bim3a_osc_advection_diffusion (msh, 1, x); + assert (norm (sum (M, 1), inf), 0, eps * 100) +***** test + M = bim3a_osc_advection_diffusion (msh, 1, y); + assert (norm (sum (M, 1), inf), 0, eps * 100) +***** test + M = bim3a_osc_advection_diffusion (msh, 1, z); + assert (norm (sum (M, 1), inf), 0, eps * 100) +***** demo + gmsh_input = [["Point(1) = {0, 0, 0, .1}; \n"], ... + ["Point(2) = {1, 0, 0, .1}; \n"], ... + ["Point(3) = {0, -.3, 0, .1}; \n"], ... + ["Point(4) = {0, +.3, 0, .1}; \n"], ... + ["Point(5) = {1, -.3, 0, .1}; \n"], ... + ["Point(6) = {1, 0.3, 0, .1}; \n"], ... + ["Point(7) = {0, 0, -.3, .1}; \n"], ... + ["Point(8) = {0, 0, +.3, .1}; \n"], ... + ["Point(9) = {1, 0, -.3, .1}; \n"], ... + ["Point(10) = {1, 0, 0.3, .1}; \n"], ... + ["Circle(1) = {4, 1, 7}; \n"], ... + ["Circle(2) = {7, 1, 3}; \n"], ... + ["Circle(3) = {3, 1, 8}; \n"], ... + ["Circle(4) = {8, 1, 4}; \n"], ... + ["Circle(5) = {6, 2, 9}; \n"], ... + ["Circle(6) = {9, 2, 5}; \n"], ... + ["Circle(7) = {5, 2, 10}; \n"], ... + ["Circle(8) = {10, 2, 6}; \n"], ... + ["Line(9) = {4, 6}; \n"], ... + ["Line(10) = {3, 5}; \n"], ... + ["Line(11) = {8, 10}; \n"], ... + ["Line(12) = {7, 9}; \n"], ... + ["Line Loop(13) = {4, 1, 2, 3}; \n"], ... + ["Plane Surface(14) = {13}; \n"], ... + ["Line Loop(15) = {5, 6, 7, 8}; \n"], ... + ["Plane Surface(16) = {15}; \n"], ... + ["Line Loop(17) = {9, -8, -11, 4}; \n"], ... + ["Ruled Surface(18) = {17}; \n"], ... + ["Line Loop(19) = {12, -5, -9, 1}; \n"], ... + ["Ruled Surface(20) = {19}; \n"], ... + ["Line Loop(21) = {12, 6, -10, -2}; \n"], ... + ["Ruled Surface(22) = {21}; \n"], ... + ["Line Loop(23) = {11, -7, -10, 3}; \n"], ... + ["Ruled Surface(24) = {23}; \n"], ... + ["Surface Loop(25) = {18, 20, 22, 16, 24, 14}; \n"], ... + ["Volume(26) = {25}; \n"]]; + fname = tmpnam (); + [fid, msg] = fopen (strcat (fname, ".geo"), "w"); + if (fid < 0); error (msg); endif + fputs (fid, gmsh_input); + fclose (fid); + msh = bim3c_mesh_properties (msh3m_gmsh (fname, "clscale", ".25")); + x = msh.p (1, :).'; + u = x; + bnd = bim3c_unknowns_on_faces (msh, [14, 16]); + int = setdiff (1:columns (msh.p), bnd); + Mosc = bim3a_osc_advection_diffusion (msh, 1, msh.p(1,:)'*0); + Mgal = bim3a_advection_diffusion (msh, 1, msh.p(1,:)'*0); + u(int) = Mosc(int, int) \ ( - Mosc(int, bnd) * u(bnd)); + uosc = u; + u(int) = Mgal(int, int) \ ( - Mgal(int, bnd) * u(bnd)); + ugal = u; + fname_out = tmpnam (); + printf ("saving results to %s \n", strcat (fname_out, ".vtu")); + fpl_vtk_raw_write_field (fname_out, msh, {uosc, "u_osc"; ugal, "u_galerkin"}, {}); + unlink (fname); +***** demo + gmsh_input = [["Point(1) = {0, 0, 0, .1}; \n"], ... + ["Point(2) = {1, 0, 0, .1}; \n"], ... + ["Point(3) = {0, -.3, 0, .1}; \n"], ... + ["Point(4) = {0, +.3, 0, .1}; \n"], ... + ["Point(5) = {1, -.3, 0, .1}; \n"], ... + ["Point(6) = {1, 0.3, 0, .1}; \n"], ... + ["Point(7) = {0, 0, -.3, .1}; \n"], ... + ["Point(8) = {0, 0, +.3, .1}; \n"], ... + ["Point(9) = {1, 0, -.3, .1}; \n"], ... + ["Point(10) = {1, 0, 0.3, .1}; \n"], ... + ["Circle(1) = {4, 1, 7}; \n"], ... + ["Circle(2) = {7, 1, 3}; \n"], ... + ["Circle(3) = {3, 1, 8}; \n"], ... + ["Circle(4) = {8, 1, 4}; \n"], ... + ["Circle(5) = {6, 2, 9}; \n"], ... + ["Circle(6) = {9, 2, 5}; \n"], ... + ["Circle(7) = {5, 2, 10}; \n"], ... + ["Circle(8) = {10, 2, 6}; \n"], ... + ["Line(9) = {4, 6}; \n"], ... + ["Line(10) = {3, 5}; \n"], ... + ["Line(11) = {8, 10}; \n"], ... + ["Line(12) = {7, 9}; \n"], ... + ["Line Loop(13) = {4, 1, 2, 3}; \n"], ... + ["Plane Surface(14) = {13}; \n"], ... + ["Line Loop(15) = {5, 6, 7, 8}; \n"], ... + ["Plane Surface(16) = {15}; \n"], ... + ["Line Loop(17) = {9, -8, -11, 4}; \n"], ... + ["Ruled Surface(18) = {17}; \n"], ... + ["Line Loop(19) = {12, -5, -9, 1}; \n"], ... + ["Ruled Surface(20) = {19}; \n"], ... + ["Line Loop(21) = {12, 6, -10, -2}; \n"], ... + ["Ruled Surface(22) = {21}; \n"], ... + ["Line Loop(23) = {11, -7, -10, 3}; \n"], ... + ["Ruled Surface(24) = {23}; \n"], ... + ["Surface Loop(25) = {18, 20, 22, 16, 24, 14}; \n"], ... + ["Volume(26) = {25}; \n"]]; + fname = tmpnam (); + [fid, msg] = fopen (strcat (fname, ".geo"), "w"); + if (fid < 0); error (msg); endif + fputs (fid, gmsh_input); + fclose (fid); + msh = bim3c_mesh_properties (msh3m_gmsh (fname, "clscale", ".25")); + x = msh.p (1, :).'; + u = x; + bnd = bim3c_unknowns_on_faces (msh, [14, 16]); + int = setdiff (1:columns (msh.p), bnd); + Mosc = bim3a_osc_advection_diffusion (msh, 1, msh.p(1,:)'*0); + Mgal = bim3a_advection_diffusion (msh, 1, msh.p(1,:)'*0); + f = bim3a_rhs (msh, 10, 1); + u(int) = Mosc(int, int) \ (f(int) - Mosc(int, bnd) * u(bnd)); + uosc = u; + u(int) = Mgal(int, int) \ (f(int) - Mgal(int, bnd) * u(bnd)); + ugal = u; + fname_out = tmpnam (); + printf ("saving results to %s \n", strcat (fname_out, ".vtu")); + fpl_vtk_raw_write_field (fname_out, msh, {uosc, "u_osc"; ugal, "u_galerkin"}, {}); + unlink (fname); +8 tests, 8 passed, 0 known failure, 0 skipped +[inst/bim2c_tri_to_nodes.m] +>>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim2c_tri_to_nodes.m +***** test + msh = bim2c_mesh_properties (msh2m_structured_mesh (linspace (0, 1, 3), linspace (0, 1, 3), 1, 1:4, "random")); + nel = columns (msh.t); + nnod = columns (msh.p); + u_tri = randn (nel, 1); + un1 = bim2c_tri_to_nodes (msh, u_tri); + [un2, m] = bim2c_tri_to_nodes (msh, u_tri); + assert (un1, un2, 1e-10) 1 test, 1 passed, 0 known failure, 0 skipped Checking C++ files ... Done running the unit tests. @@ -4210,12 +4246,14 @@ dpkg-buildpackage: info: binary-only upload (no source included) dpkg-genchanges: info: including full source code in upload I: copying local configuration +I: user script /srv/workspace/pbuilder/128791/tmp/hooks/B01_cleanup starting +I: user script /srv/workspace/pbuilder/128791/tmp/hooks/B01_cleanup finished I: unmounting dev/ptmx filesystem I: unmounting dev/pts filesystem I: unmounting dev/shm filesystem I: unmounting proc filesystem I: unmounting sys filesystem I: cleaning the build env -I: removing directory /srv/workspace/pbuilder/192368 and its subdirectories -I: Current time: Thu May 2 14:47:33 -12 2024 -I: pbuilder-time-stamp: 1714704453 +I: removing directory /srv/workspace/pbuilder/128791 and its subdirectories +I: Current time: Thu Jun 5 23:15:38 +14 2025 +I: pbuilder-time-stamp: 1749114938