diff --git a/@msh/msh.m b/@msh/msh.m index a5bfa824..d06ba1a5 100644 --- a/@msh/msh.m +++ b/@msh/msh.m @@ -1402,6 +1402,7 @@ function plotter(cmap,round_dec,yylabel,apply_pivot) switch classifier case{'both','distance'} % process gdat info + land = []; if ~isempty(gdat.mainland) land = gdat.mainland; land(isnan(land(:,1)),:) = []; @@ -1411,7 +1412,13 @@ function plotter(cmap,round_dec,yylabel,apply_pivot) inner(isnan(inner(:,1)),:) = []; land = [land; inner]; end - [~,ldst] = ourKNNsearch(land',eb_mid',1); + if ~isempty(land) + [~,ldst] = ourKNNsearch(land',eb_mid',1); + else + % set distance to be larger than dist_lim + % everywhere when no land exists + ldst = eb_mid(:,1)*0 + 2*dist_lim + end eb_class = ldst > dist_lim; if strcmp(classifier,'both') % ii) based on depth diff --git a/README.md b/README.md index 5e3ad4c0..17f39846 100644 --- a/README.md +++ b/README.md @@ -154,6 +154,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Deleting boundary conditions by specifyng their indices in `msh.object.bd` field. See https://github.com/CHLNDDEV/OceanMesh2D/pull/205 - Ability for user to set their own axis limits when plotting with `msh.plot()`. https://github.com/CHLNDDEV/OceanMesh2D/pull/224 ## Fixed +- Minor fix to `msh.make_bc` using the `auto` method. https://github.com/CHLNDDEV/OceanMesh2D/pull/237 - correction in setting stereographic projection bounds in `setProj` to make sure points are not pushed outside and become NaNs (was limited to radius of 178 deg but made sure can go up to full 180 deg). https://github.com/CHLNDDEV/OceanMesh2D/pull/225 - Correctly deleting weirs from boundary object through `make_bc` delete method. See https://github.com/CHLNDDEV/OceanMesh2D/pull/205 - Array format fix for reading in ibtype and nvell from fort.14 file and when executing carry_over_weirs. See https://github.com/CHLNDDEV/OceanMesh2D/pull/206