From 8736e5d161b3b08d6a53b09cc73301de9fa23d0b Mon Sep 17 00:00:00 2001 From: Keith Roberts Date: Thu, 29 Jul 2021 12:56:53 -0300 Subject: [PATCH 1/5] Prepare for new version --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 921db845..cac5a949 100644 --- a/README.md +++ b/README.md @@ -148,6 +148,9 @@ Changelog The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ### Unreleased (on current HEAD of the Projection branch) +- None + +### [5.0.0] - 2021-07-29 ## Added - `meshgen.build()` now will rewind the iteration set in the case mesh improvement cannot improve the qualities. https://github.com/CHLNDDEV/OceanMesh2D/pull/234 - `msh.plot()` now has a `cmap` in which the user can specify their any `cmocean` colormap From 7d64013795c6c946f24a0c94dfa9736671b973b5 Mon Sep 17 00:00:00 2001 From: Keith Roberts Date: Thu, 29 Jul 2021 15:04:50 -0300 Subject: [PATCH 2/5] change email --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cac5a949..3c71f57d 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Besides posting [issues](https://github.com/CHLNDDEV/OceanMesh2D/issues) with th Note: If the slack link invite isn't working, please send either one of us and an email and we'll fix it. By default, the invite link expires every 30 days. -Otherwise please reach out to either Dr. William Pringle (wpringle@anl.gov) or Dr. Keith Roberts (krober@usp.br) with questions or concerns or feel free to start an Issue in the issues tab above. +Otherwise please reach out to either Dr. William Pringle (wpringle@anl.gov) or Dr. Keith Roberts (keithrbt0@gmail.com) with questions or concerns or feel free to start an Issue in the issues tab above. Contributing From 2bcc85a066a560d7e097288ace08b92dd559f8d5 Mon Sep 17 00:00:00 2001 From: Keith Roberts Date: Sat, 31 Jul 2021 11:50:26 -0300 Subject: [PATCH 3/5] Update msh.m Correct error message. --- @msh/msh.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/@msh/msh.m b/@msh/msh.m index 9d96ffc9..2d13a759 100644 --- a/@msh/msh.m +++ b/@msh/msh.m @@ -375,7 +375,7 @@ function write(obj,fname,type) projtype = MAP_PROJECTION.name; else error(['no native projection in msh class, please specify the plotting projection: ' ... - 'plot(m,''proj'',''lamb''), or no projection: plot(m,''proj'',''none'')']) + 'plot(m,''type'',''tri'','proj'',''lamb''), or no projection: plot(m,''type',''tri'',''proj'',''none'')']) end end From 97e522c3e7a571caab252fbe43ae4dfe04080870 Mon Sep 17 00:00:00 2001 From: William Pringle Date: Sun, 1 Aug 2021 17:17:18 -0500 Subject: [PATCH 4/5] adding legend for 'bd' plot --- @msh/msh.m | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/@msh/msh.m b/@msh/msh.m index 2d13a759..52f52586 100644 --- a/@msh/msh.m +++ b/@msh/msh.m @@ -335,6 +335,7 @@ function write(obj,fname,type) proj = 1; axis_limits = []; % use mesh extents to determine plot extents cmap = 1; % default value is specified in plot method + leg_ind = []; projtype = []; type = 'tri'; @@ -375,7 +376,7 @@ function write(obj,fname,type) projtype = MAP_PROJECTION.name; else error(['no native projection in msh class, please specify the plotting projection: ' ... - 'plot(m,''type'',''tri'','proj'',''lamb''), or no projection: plot(m,''type',''tri'',''proj'',''none'')']) + 'plot(m,''type'',''tri'',''proj'',''lamb''), or no projection: plot(m,''type'',''tri'',''proj'',''none'')']) end end @@ -445,6 +446,8 @@ function write(obj,fname,type) simpplot(obj.p,obj.t); end case('bd') + legend_names = {'open ocean boundary','outer no-flux boundary',... + 'inner no-flux boundary','subgrid scale barriers'}; if tri if proj m_triplot(obj.p(:,1),obj.p(:,2),obj.t); @@ -455,35 +458,44 @@ function write(obj,fname,type) if ~isempty(obj.bd) for nb = 1 : obj.bd.nbou if obj.bd.ibtype(nb) == 24 || obj.bd.ibtype(nb) == 94 + if sum(leg_ind == 4) == 0 + leg_ind(end+1) = 4; + end if proj % plot front facing m_plot(obj.p(obj.bd.nbvv(1:obj.bd.nvell(nb),nb),1),... obj.p(obj.bd.nbvv(1:obj.bd.nvell(nb),nb),2),'g-','linewi',1.2); % plot back facing - m_plot(obj.p(obj.bd.ibconn(1:obj.bd.nvell(nb),nb),1),... + h(4) = m_plot(obj.p(obj.bd.ibconn(1:obj.bd.nvell(nb),nb),1),... obj.p(obj.bd.ibconn(1:obj.bd.nvell(nb),nb),2),'y-','linewi',1.2); else % plot front facing plot(obj.p(obj.bd.nbvv(1:obj.bd.nvell(nb),nb),1),... obj.p(obj.bd.nbvv(1:obj.bd.nvell(nb),nb),2),'g-','linewi',1.2); % plot back facing - plot(obj.p(obj.bd.ibconn(1:obj.bd.nvell(nb),nb),1),... + h(4) = plot(obj.p(obj.bd.ibconn(1:obj.bd.nvell(nb),nb),1),... obj.p(obj.bd.ibconn(1:obj.bd.nvell(nb),nb),2),'y-','linewi',1.2); end elseif obj.bd.ibtype(nb) == 20 + if sum(leg_ind == 2) == 0 + leg_ind(end+1) = 2; + end if proj - m_plot(obj.p(obj.bd.nbvv(1:obj.bd.nvell(nb),nb),1),... + h(2) = m_plot(obj.p(obj.bd.nbvv(1:obj.bd.nvell(nb),nb),1),... obj.p(obj.bd.nbvv(1:obj.bd.nvell(nb),nb),2),'r-','linewi',1.2); else - plot(obj.p(obj.bd.nbvv(1:obj.bd.nvell(nb),nb),1),... + h(2) = plot(obj.p(obj.bd.nbvv(1:obj.bd.nvell(nb),nb),1),... obj.p(obj.bd.nbvv(1:obj.bd.nvell(nb),nb),2),'r-','linewi',1.2); end else + if sum(leg_ind == 3) == 0 + leg_ind(end+1) = 3; + end if proj - m_plot(obj.p(obj.bd.nbvv(1:obj.bd.nvell(nb),nb),1),... + h(3) = m_plot(obj.p(obj.bd.nbvv(1:obj.bd.nvell(nb),nb),1),... obj.p(obj.bd.nbvv(1:obj.bd.nvell(nb),nb),2),'g-','linewi',1.2); else - plot(obj.p(obj.bd.nbvv(1:obj.bd.nvell(nb),nb),1),... + h(3) = plot(obj.p(obj.bd.nbvv(1:obj.bd.nvell(nb),nb),1),... obj.p(obj.bd.nbvv(1:obj.bd.nvell(nb),nb),2),'g-','linewi',1.2); end end @@ -491,11 +503,14 @@ function write(obj,fname,type) end if ~isempty(obj.op) for nb = 1 : obj.op.nope + if sum(leg_ind == 1) == 0 + leg_ind(end+1) = 1; + end if proj - m_plot(obj.p(obj.op.nbdv(1:obj.op.nvdll(nb),nb),1),... + h(1) = m_plot(obj.p(obj.op.nbdv(1:obj.op.nvdll(nb),nb),1),... obj.p(obj.op.nbdv(1:obj.op.nvdll(nb),nb),2),'b-','linewi',3.2); else - plot(obj.p(obj.op.nbdv(1:obj.op.nvdll(nb),nb),1),... + h(1) = plot(obj.p(obj.op.nbdv(1:obj.op.nvdll(nb),nb),1),... obj.p(obj.op.nbdv(1:obj.op.nvdll(nb),nb),2),'b-','linewi',1.2); end end @@ -713,6 +728,9 @@ function write(obj,fname,type) % now add the box m_grid('FontSize',fsz,'bac',bgc); end + if ~isempty(leg_ind) + legend(h(leg_ind),legend_names(leg_ind),'location','best') + end function plotter(cmap,round_dec,yylabel,apply_pivot) % applies the plot for the quantiy 'q' and specific From c503b9e562bc072226644fdc8a24570015c771d1 Mon Sep 17 00:00:00 2001 From: William Pringle Date: Sun, 1 Aug 2021 20:13:43 -0500 Subject: [PATCH 5/5] msh.plot() bd legend in changelog --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 3c71f57d..2e685085 100644 --- a/README.md +++ b/README.md @@ -166,6 +166,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - tidal constituents for `Make_f15` can now contain "major8" in addition to other constituents in the string/cell array https://github.com/CHLNDDEV/OceanMesh2D/pull/221 - Correctly collect NDBC and NOS stations in mesh when creating `fort15` file using `Make_f15` for meteorological, velocity and elevation records https://github.com/CHLNDDEV/OceanMesh2D/pull/242 ## Changed +- `msh.plot()` using type `bd` option now creates a legend for the different boundary condition types. https://github.com/CHLNDDEV/OceanMesh2D/pull/247 - forcing facecolor to white in `m_trimesh` so that it does not intefere with background color option. https://github.com/CHLNDDEV/OceanMesh2D/pull/245 - made topographic elevation bound option for max_ele, wl, slp, and g `edgefx` kwargs consistent and added explanation of this option is included in `edgefx` help. https://github.com/CHLNDDEV/OceanMesh2D/pull/230 - `m_plot()` function calls `m_grid()` with background color input kwarg (if `backcolor` option used) instead of manual application. https://github.com/CHLNDDEV/OceanMesh2D/pull/225