Skip to content

Commit 5d60ea7

Browse files
authored
Merge pull request #237 from CHLNDDEV/makebc_auto_bugfix
bug fix for make_bc auto option when no mainland exists
2 parents 7aeb91d + e2a5d90 commit 5d60ea7

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

@msh/msh.m

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1402,6 +1402,7 @@ function plotter(cmap,round_dec,yylabel,apply_pivot)
14021402
switch classifier
14031403
case{'both','distance'}
14041404
% process gdat info
1405+
land = [];
14051406
if ~isempty(gdat.mainland)
14061407
land = gdat.mainland;
14071408
land(isnan(land(:,1)),:) = [];
@@ -1411,7 +1412,13 @@ function plotter(cmap,round_dec,yylabel,apply_pivot)
14111412
inner(isnan(inner(:,1)),:) = [];
14121413
land = [land; inner];
14131414
end
1414-
[~,ldst] = ourKNNsearch(land',eb_mid',1);
1415+
if ~isempty(land)
1416+
[~,ldst] = ourKNNsearch(land',eb_mid',1);
1417+
else
1418+
% set distance to be larger than dist_lim
1419+
% everywhere when no land exists
1420+
ldst = eb_mid(:,1)*0 + 2*dist_lim
1421+
end
14151422
eb_class = ldst > dist_lim;
14161423
if strcmp(classifier,'both')
14171424
% ii) based on depth

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
154154
- Deleting boundary conditions by specifyng their indices in `msh.object.bd` field. See https://github.com/CHLNDDEV/OceanMesh2D/pull/205
155155
- Ability for user to set their own axis limits when plotting with `msh.plot()`. https://github.com/CHLNDDEV/OceanMesh2D/pull/224
156156
## Fixed
157+
- Minor fix to `msh.make_bc` using the `auto` method. https://github.com/CHLNDDEV/OceanMesh2D/pull/237
157158
- 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
158159
- Correctly deleting weirs from boundary object through `make_bc` delete method. See https://github.com/CHLNDDEV/OceanMesh2D/pull/205
159160
- 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

0 commit comments

Comments
 (0)