Diff of the two buildlogs: -- --- b1/build.log 2024-10-23 19:27:26.998830130 +0000 +++ b2/build.log 2024-10-23 19:32:08.928825517 +0000 @@ -1,6 +1,6 @@ I: pbuilder: network access will be disabled during build -I: Current time: Wed Oct 23 07:19:23 -12 2024 -I: pbuilder-time-stamp: 1729711163 +I: Current time: Wed Nov 26 15:50:29 +14 2025 +I: pbuilder-time-stamp: 1764121829 I: Building the build Environment I: extracting base tarball [/var/cache/pbuilder/trixie-reproducible-base.tgz] I: copying local configuration @@ -30,51 +30,83 @@ 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/727912/tmp/hooks/D02_print_environment starting +I: user script /srv/workspace/pbuilder/2368959/tmp/hooks/D01_modify_environment starting +debug: Running on infom02-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 Nov 26 01:50 /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/2368959/tmp/hooks/D01_modify_environment finished +I: user script /srv/workspace/pbuilder/2368959/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' + 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]="32" [3]="1" [4]="release" [5]="x86_64-pc-linux-gnu") + BASH_VERSION='5.2.32(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=12 ' - DISTRIBUTION='trixie' - HOME='/root' - HOST_ARCH='amd64' + DIRSTACK=() + DISTRIBUTION=trixie + EUID=0 + FUNCNAME=([0]="Echo" [1]="main") + GROUPS=() + HOME=/root + HOSTNAME=i-capture-the-hostname + HOSTTYPE=x86_64 + HOST_ARCH=amd64 IFS=' ' - INVOCATION_ID='93f26f815b894301bf87113f55bc2347' - 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='727912' - PS1='# ' - PS2='> ' + INVOCATION_ID=1eb7ef4527cb49e48790d7c5d92d42b5 + 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=2368959 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.9JNJlm3a/pbuilderrc_ulqd --distribution trixie --hookdir /etc/pbuilder/first-build-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/trixie-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.9JNJlm3a/b1 --logfile b1/build.log octave-bim_1.1.6-1.dsc' - SUDO_GID='109' - SUDO_UID='104' - SUDO_USER='jenkins' - TERM='unknown' - TZ='/usr/share/zoneinfo/Etc/GMT+12' - USER='root' - _='/usr/bin/systemd-run' + 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.9JNJlm3a/pbuilderrc_Il7i --distribution trixie --hookdir /etc/pbuilder/rebuild-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/trixie-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.9JNJlm3a/b2 --logfile b2/build.log octave-bim_1.1.6-1.dsc' + SUDO_GID=109 + SUDO_UID=104 + SUDO_USER=jenkins + TERM=unknown + TZ=/usr/share/zoneinfo/Etc/GMT-14 + UID=0 + USER=root + _='I: set' I: uname -a - Linux infom01-amd64 6.1.0-26-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.112-1 (2024-09-30) x86_64 GNU/Linux + Linux i-capture-the-hostname 6.10.11+bpo-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.10.11-1~bpo12+1 (2024-10-03) x86_64 GNU/Linux I: ls -l /bin - lrwxrwxrwx 1 root root 7 Aug 4 21:30 /bin -> usr/bin -I: user script /srv/workspace/pbuilder/727912/tmp/hooks/D02_print_environment finished + lrwxrwxrwx 1 root root 7 Aug 4 2024 /bin -> usr/bin +I: user script /srv/workspace/pbuilder/2368959/tmp/hooks/D02_print_environment finished -> Attempting to satisfy build-dependencies -> Creating pbuilder-satisfydepends-dummy package Package: pbuilder-satisfydepends-dummy @@ -710,7 +742,7 @@ Get: 592 http://deb.debian.org/debian trixie/main amd64 gmsh amd64 4.13.1+ds1-3 [37.8 kB] Get: 593 http://deb.debian.org/debian trixie/main amd64 octave-splines all 1.3.5-2 [24.7 kB] Get: 594 http://deb.debian.org/debian trixie/main amd64 octave-msh all 1.0.12-1 [24.7 kB] -Fetched 310 MB in 5s (61.3 MB/s) +Fetched 310 MB in 8s (38.9 MB/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 ... 21880 files and directories currently installed.) @@ -2638,8 +2670,8 @@ Setting up tzdata (2024a-4) ... Current default time zone: 'Etc/UTC' -Local time is now: Wed Oct 23 19:24:26 UTC 2024. -Universal Time is now: Wed Oct 23 19:24:26 UTC 2024. +Local time is now: Wed Nov 26 01:54:04 UTC 2025. +Universal Time is now: Wed Nov 26 01:54:04 UTC 2025. Run 'dpkg-reconfigure tzdata' if you wish to change it. Setting up libxcb-present0:amd64 (1.17.0-2) ... @@ -3154,7 +3186,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/2368959/tmp/hooks/A99_set_merged_usr starting +Not re-configuring usrmerge for trixie +I: user script /srv/workspace/pbuilder/2368959/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 @@ -3192,6 +3228,40 @@ Checking package... Run the unit tests... Checking m files ... +[inst/bim3c_global_flux.m] +>>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim3c_global_flux.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); +1 test, 1 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/bim2c_norm.m] >>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim2c_norm.m ***** test @@ -3225,17 +3295,271 @@ 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/bim2c_tri_to_nodes.m] ->>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim2c_tri_to_nodes.m +[inst/bim3c_norm.m] +>>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim3c_norm.m ***** test - msh = bim2c_mesh_properties (msh2m_structured_mesh (linspace (0, 1, 3), linspace (0, 1, 3), 1, 1:4, "random")); +***** 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 + 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/bim3a_laplacian.m] +>>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim3a_laplacian.m +***** shared mesh,epsilon,kappa,nnodes,nelem +***** test +***** test +***** test +3 tests, 3 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 = bim2c_tri_to_nodes (msh, u_tri); - [un2, m] = bim2c_tri_to_nodes (msh, u_tri); + 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_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/bim1a_advection_upwind.m] +>>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim1a_advection_upwind.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; + 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/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/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/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/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_reaction.m] >>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim2a_axisymmetric_reaction.m ***** shared mesh,delta,zeta,nnodes,nelem @@ -3274,337 +3598,22 @@ 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/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/bim1a_rhs.m] ->>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim1a_rhs.m -***** 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 -[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_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); - assert(A,B) -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 - 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); - Dnodes = bim2c_unknowns_on_side(mesh,[2,4]); - Nnodes = columns(mesh.p); - Nelements = columns(mesh.t); - Varnodes = setdiff(1:Nnodes,Dnodes); - 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); - 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); - 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-7) -***** 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; - 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); - 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); - 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) -***** 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) .* 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; - alpha = D*ones(Nelements,1); - gamma = ones(Nnodes,1); - eta = ones(Nnodes,1); - beta = 1/D * mesh.p(1,:)'; - f = @(r,z) -D./r.*duexdr(r,z) - D.*d2uexdr2(r,z) ... - + 1./r .* uex(r,z) + duexdr(r,z) ... - - D.*d2uexdz2(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); - 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) -***** 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) .* 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; - alpha = D*ones(Nelements,1); - gamma = ones(Nnodes,1); - eta = ones(Nnodes,1); - beta = 1/D * 1/2*(mesh.p(1,:)').^2; - f = @(r,z) 1./r.*(1+r).*(r-D) .* 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); - 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) -***** test - n = 3; - [mesh] = msh2m_structured_mesh(linspace(-2,-1,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); - Dnodes = bim2c_unknowns_on_side(mesh,[2,4]); - Nnodes = columns(mesh.p); - Nelements = columns(mesh.t); - Varnodes = setdiff(1:Nnodes,Dnodes); - 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); - rhs = bim2a_axisymmetric_rhs(mesh, ones(Nelements,1), f(abs(mesh.p(1,:)), mesh.p(2,:))); - S = bim2a_axisymmetric_advection_diffusion(mesh,alpha,gamma,eta,beta); - u = zeros(Nnodes,1); u(Dnodes) = uex(abs(mesh.p(1,Dnodes)), mesh.p(2,Dnodes)); - u(Varnodes) = S(Varnodes,Varnodes)\(rhs(Varnodes) - S(Varnodes,Dnodes)*u(Dnodes)); - assert(u,uex(abs(mesh.p(1,:)), mesh.p(2,:))',1e-7) -***** test - n = 10; - [mesh] = msh2m_structured_mesh(linspace(-2,-1,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; - alpha = D*ones(Nelements,1); - gamma = ones(Nnodes,1); - eta = ones(Nnodes,1); - beta = 1/D * 1/2*(mesh.p(1,:)').^2; - f = @(r,z) 1./r.*(1+r).*(r-D) .* uex(r,z); - rhs = bim2a_axisymmetric_rhs(mesh, ones(Nelements,1), f(abs(mesh.p(1,:)), mesh.p(2,:))); - S = bim2a_axisymmetric_advection_diffusion(mesh,alpha,gamma,eta,beta); - u = zeros(Nnodes,1); u(Dnodes) = uex(abs(mesh.p(1,Dnodes)), mesh.p(2,Dnodes)); - u(Varnodes) = S(Varnodes,Varnodes)\(rhs(Varnodes) - S(Varnodes,Dnodes)*u(Dnodes)); - assert(u,uex(abs(mesh.p(1,:)), mesh.p(2,:))',1e-3) -***** test - [mesh] = msh2m_structured_mesh([0:.1:1],[0:.1:1],1,1:4); - mesh = bim2c_mesh_properties(mesh); - x = mesh.p(1,:)'; y = mesh.p(2,:)'; - Dnodes = bim2c_unknowns_on_side(mesh,[1:4]); - Nnodes = columns(mesh.p); Nelements = columns(mesh.t); - alpha = ones(Nelements,1); eta=ones(Nnodes,1); - beta = 0; - gamma = ones(Nnodes,1); - A = bim2a_axisymmetric_advection_diffusion(mesh,1,1,1,0); - B = bim2a_axisymmetric_advection_diffusion(mesh,alpha,gamma,eta,beta); - assert(A,B) -7 tests, 7 passed, 0 known failure, 0 skipped -[inst/bim2c_intrp.m] ->>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim2c_intrp.m +[inst/bim3c_intrp.m] +>>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim3c_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).'; + 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 = bim2c_intrp (msh, u, [], [x, y]); + 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/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/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/bim1a_advection_upwind.m] ->>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim1a_advection_upwind.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; - 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_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/bim2a_axisymmetric_boundary_mass.m] >>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim2a_axisymmetric_boundary_mass.m ***** test @@ -3681,6 +3690,28 @@ 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_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/bim3a_reaction.m] +>>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim3a_reaction.m +***** shared mesh,delta,zeta,nnodes,nelem +***** test +***** test +***** test +3 tests, 3 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 +***** test +***** test +***** test +***** test +4 tests, 4 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 @@ -3819,53 +3850,25 @@ B = bim2a_advection_diffusion(mesh,alpha,gamma,eta,beta); assert(A,B) 8 tests, 8 passed, 0 known failure, 0 skipped -[inst/bim3c_global_flux.m] ->>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim3c_global_flux.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); -1 test, 1 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/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/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/bim1c_elem_to_nodes.m] ->>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim1c_elem_to_nodes.m +[inst/bim1a_rhs.m] +>>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim1a_rhs.m ***** test - n = 10; msh = linspace (0, 1, n+1); - nel = n; - nnod = n+1; - u_el = randn (nel, 1); - un1 = bim1c_elem_to_nodes (msh, u_el); - [un2, m] = bim1c_elem_to_nodes (msh, u_el); - un3 = bim1c_elem_to_nodes (m, u_el); - [un4, m] = bim1c_elem_to_nodes (m, u_el); - assert (un1, un2, 1e-10) - assert (un1, un3, 1e-10) - assert (un1, un4, 1e-10) + 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/bim1a_axisymmetric_rhs.m] >>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim1a_axisymmetric_rhs.m @@ -3877,15 +3880,75 @@ B = bim1a_axisymmetric_rhs(x,delta,zeta); assert(A,B) 1 test, 1 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 +[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 -3 tests, 3 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 + 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); + assert(A,B) +4 tests, 4 passed, 0 known failure, 0 skipped +[inst/bim3a_osc_laplacian.m] +>>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim3a_osc_laplacian.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)); @@ -3893,7 +3956,7 @@ y = msh.p (2, :).'; z = msh.p (3, :).'; u = ones (size (x)); - M = bim3a_osc_advection_diffusion (msh, 1, 0); + M = bim3a_osc_laplacian (msh, 1); assert (M * u, zeros (size (u)), eps * 100) ***** test u = x; @@ -3914,147 +3977,64 @@ 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); + 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_advection_upwind.m] +>>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim1a_axisymmetric_advection_upwind.m ***** 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) + nn = 20; + mesh = linspace(1,2,nn+1)'; + D = 1; v = 0; sigma = 0; + uex = @(r) exp(r); + duexdr = @(r) uex(r); + d2uexdr2 = @(r) uex(r); + f = @(r,z) -D./r.*duexdr(r) - D.*d2uexdr2(r) ... + + v./r .* uex(r) + v * duexdr(r) ... + + sigma * uex(r); + uex_left = uex(mesh(1)); uex_right = uex(mesh(end)); + Ar = bim1a_axisymmetric_laplacian (mesh, D, 1); + Adv = bim1a_axisymmetric_advection_upwind (mesh, v*ones(nn,1)); + R = bim1a_axisymmetric_reaction (mesh, sigma, 1); + M = Ar + Adv + R; + M(1,:) *= 0; M(1,1) = 1; + M(end,:) *= 0; M(end, end) = 1; + rhs = bim1a_axisymmetric_rhs (mesh, 1, f(mesh)); + rhs(1) = uex_left; rhs(end) = uex_right; + uh = M \ rhs; + assert(uh, uex(mesh), 1e-3); +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 - 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/bim3a_laplacian.m] ->>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim3a_laplacian.m -***** shared mesh,epsilon,kappa,nnodes,nelem + 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/bim2a_rhs.m] +>>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim2a_rhs.m +***** shared mesh,f,g,nnodes,nelem ***** test ***** test ***** test 3 tests, 3 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 -***** test -***** test +[inst/bim1c_elem_to_nodes.m] +>>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim1c_elem_to_nodes.m ***** test -3 tests, 3 passed, 0 known failure, 0 skipped + n = 10; msh = linspace (0, 1, n+1); + nel = n; + nnod = n+1; + u_el = randn (nel, 1); + un1 = bim1c_elem_to_nodes (msh, u_el); + [un2, m] = bim1c_elem_to_nodes (msh, u_el); + un3 = bim1c_elem_to_nodes (m, u_el); + [un4, m] = bim1c_elem_to_nodes (m, u_el); + assert (un1, un2, 1e-10) + assert (un1, un3, 1e-10) + assert (un1, un4, 1e-10) +1 test, 1 passed, 0 known failure, 0 skipped [inst/bim1a_axisymmetric_reaction.m] >>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim1a_axisymmetric_reaction.m ***** test @@ -4109,128 +4089,184 @@ B = bim1a_axisymmetric_reaction(x,delta,zeta); assert(A,B) 3 tests, 3 passed, 0 known failure, 0 skipped -[inst/bim3a_osc_laplacian.m] ->>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim3a_osc_laplacian.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_laplacian (msh, 1); - 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_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_reaction.m] ->>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim1a_reaction.m +[inst/bim2c_tri_to_nodes.m] +>>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim2c_tri_to_nodes.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) + 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 -[inst/bim3c_mesh_properties.m] ->>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim3c_mesh_properties.m -***** shared mesh -***** test -***** test -***** test -***** test -4 tests, 4 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 -***** 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 +[inst/bim2a_axisymmetric_advection_diffusion.m] +>>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim2a_axisymmetric_advection_diffusion.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); + Dnodes = bim2c_unknowns_on_side(mesh,[2,4]); + Nnodes = columns(mesh.p); + Nelements = columns(mesh.t); + Varnodes = setdiff(1:Nnodes,Dnodes); + 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); + 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); + 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-7) ***** test -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/bim3c_norm.m] ->>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim3c_norm.m + 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; + 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); + 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); + 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) ***** 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; + [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; + alpha = D*ones(Nelements,1); + gamma = ones(Nnodes,1); + eta = ones(Nnodes,1); + beta = 1/D * mesh.p(1,:)'; + f = @(r,z) -D./r.*duexdr(r,z) - D.*d2uexdr2(r,z) ... + + 1./r .* uex(r,z) + duexdr(r,z) ... + - D.*d2uexdz2(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); + 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) ***** 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); + 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) .* 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; + alpha = D*ones(Nelements,1); + gamma = ones(Nnodes,1); + eta = ones(Nnodes,1); + beta = 1/D * 1/2*(mesh.p(1,:)').^2; + f = @(r,z) 1./r.*(1+r).*(r-D) .* 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); + 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) ***** 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); + n = 3; + [mesh] = msh2m_structured_mesh(linspace(-2,-1,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); + Dnodes = bim2c_unknowns_on_side(mesh,[2,4]); + Nnodes = columns(mesh.p); + Nelements = columns(mesh.t); + Varnodes = setdiff(1:Nnodes,Dnodes); + 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); + rhs = bim2a_axisymmetric_rhs(mesh, ones(Nelements,1), f(abs(mesh.p(1,:)), mesh.p(2,:))); + S = bim2a_axisymmetric_advection_diffusion(mesh,alpha,gamma,eta,beta); + u = zeros(Nnodes,1); u(Dnodes) = uex(abs(mesh.p(1,Dnodes)), mesh.p(2,Dnodes)); + u(Varnodes) = S(Varnodes,Varnodes)\(rhs(Varnodes) - S(Varnodes,Dnodes)*u(Dnodes)); + assert(u,uex(abs(mesh.p(1,:)), mesh.p(2,:))',1e-7) ***** 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_axisymmetric_advection_upwind.m] ->>>>> /build/reproducible-path/octave-bim-1.1.6/inst/bim1a_axisymmetric_advection_upwind.m + n = 10; + [mesh] = msh2m_structured_mesh(linspace(-2,-1,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; + alpha = D*ones(Nelements,1); + gamma = ones(Nnodes,1); + eta = ones(Nnodes,1); + beta = 1/D * 1/2*(mesh.p(1,:)').^2; + f = @(r,z) 1./r.*(1+r).*(r-D) .* uex(r,z); + rhs = bim2a_axisymmetric_rhs(mesh, ones(Nelements,1), f(abs(mesh.p(1,:)), mesh.p(2,:))); + S = bim2a_axisymmetric_advection_diffusion(mesh,alpha,gamma,eta,beta); + u = zeros(Nnodes,1); u(Dnodes) = uex(abs(mesh.p(1,Dnodes)), mesh.p(2,Dnodes)); + u(Varnodes) = S(Varnodes,Varnodes)\(rhs(Varnodes) - S(Varnodes,Dnodes)*u(Dnodes)); + assert(u,uex(abs(mesh.p(1,:)), mesh.p(2,:))',1e-3) ***** test - nn = 20; - mesh = linspace(1,2,nn+1)'; - D = 1; v = 0; sigma = 0; - uex = @(r) exp(r); - duexdr = @(r) uex(r); - d2uexdr2 = @(r) uex(r); - f = @(r,z) -D./r.*duexdr(r) - D.*d2uexdr2(r) ... - + v./r .* uex(r) + v * duexdr(r) ... - + sigma * uex(r); - uex_left = uex(mesh(1)); uex_right = uex(mesh(end)); - Ar = bim1a_axisymmetric_laplacian (mesh, D, 1); - Adv = bim1a_axisymmetric_advection_upwind (mesh, v*ones(nn,1)); - R = bim1a_axisymmetric_reaction (mesh, sigma, 1); - M = Ar + Adv + R; - M(1,:) *= 0; M(1,1) = 1; - M(end,:) *= 0; M(end, end) = 1; - rhs = bim1a_axisymmetric_rhs (mesh, 1, f(mesh)); - rhs(1) = uex_left; rhs(end) = uex_right; - uh = M \ rhs; - assert(uh, uex(mesh), 1e-3); -1 test, 1 passed, 0 known failure, 0 skipped + [mesh] = msh2m_structured_mesh([0:.1:1],[0:.1:1],1,1:4); + mesh = bim2c_mesh_properties(mesh); + x = mesh.p(1,:)'; y = mesh.p(2,:)'; + Dnodes = bim2c_unknowns_on_side(mesh,[1:4]); + Nnodes = columns(mesh.p); Nelements = columns(mesh.t); + alpha = ones(Nelements,1); eta=ones(Nnodes,1); + beta = 0; + gamma = ones(Nnodes,1); + A = bim2a_axisymmetric_advection_diffusion(mesh,1,1,1,0); + B = bim2a_axisymmetric_advection_diffusion(mesh,alpha,gamma,eta,beta); + assert(A,B) +7 tests, 7 passed, 0 known failure, 0 skipped Checking C++ files ... Done running the unit tests. Summary: 92 tests, 92 passed, 0 known failures, 0 skipped @@ -4259,12 +4295,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/2368959/tmp/hooks/B01_cleanup starting +I: user script /srv/workspace/pbuilder/2368959/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/727912 and its subdirectories -I: Current time: Wed Oct 23 07:27:25 -12 2024 -I: pbuilder-time-stamp: 1729711645 +I: removing directory /srv/workspace/pbuilder/2368959 and its subdirectories +I: Current time: Wed Nov 26 15:55:08 +14 2025 +I: pbuilder-time-stamp: 1764122108