Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meshgen.build Exiting early #286

Closed
soloyant opened this issue May 23, 2023 · 2 comments
Closed

meshgen.build Exiting early #286

soloyant opened this issue May 23, 2023 · 2 comments

Comments

@soloyant
Copy link

Hi,

First of all, I want to address a big thank you to the development community for this great tool. I have been using it for the past year and can't imagine working without it anymore.

Describe the bug
The issue happens when trying to mesh a wide coastal domain (100+ x 100+ km) with no coastline shapefile provided. For smaller domains or domains including a large enough cumulated area of holes/mainlands using the shapefile argument, the build method applied to a meshgen object iterates correctly. However, it ends early with no specific error returned in some cases, which seem to be depending on the domain size. Changing the geodata and edgefx parameters don't change the result, only reducing the surface covered by bbox will allow the algorithm to run completely.

To Reproduce

Script:

dem = 'SRTM15+.nc'; 
bbox = [[-91.6119;-90.1796;-90.1796;-91.6119], [29.7817;29.7817;28.5891;28.5891]];
min_el = 30;
max_el = 25000
grade = 0.2;
R = 3;
dt = 0.9;
wl = 10;
slp = 10;

gdat = geodata('dem', dem, 'h0', min_el, 'bbox', bbox);
fh = edgefx('geodata', gdat, 'fs', R, 'max_el', max_el, 'g', grade, 'dt', dt, 'wl', wl, 'slp', slp);
mshopts = meshgen('ef', fh, 'bou', gdat, 'proj', 'Mercator', 'memory_gb', 30, 'pfix', bbox);
mshopts = mshopts.build;

Output:

Current mapping parameters -
 Projection: Mercator  (function: mp_cyl)
 longitudes: -91.6119     -90.1796       
 Latitudes: 28.5891      29.7817         
 sphere: normal                          
Forming initial point distribution...
    for box #1
Using 196 fixed points.
Number of initial points after rejection is 7973
Elapsed time is 31.492860 seconds.
 ------------------------------------------------------->
Begin iterating...
Exiting

Expected behavior
The build method should start iterating and improving a mesh based on given parameters regardless of the domain size.

Configuration (please complete the following information):

  • OS: MacOS
  • Version: OS Ventura (13.3.1)

Additional context
N/A

@krober10nd
Copy link
Collaborator

krober10nd commented May 24, 2023

Hi,

Happy to help.

Your issue seems to me like it's triggering the following logic

disp('Exiting')

I'd check the domain definition that is being read in via

plot(your_geodata_obj,'omega')

and potentially toggle the your_geodata_obj.inpoly_flip field from 0 to 1 or from 1 to 0 (depending on what it is).

@soloyant
Copy link
Author

Hi Keith,

Switching the inpoly_flip field did the trick, thank you for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants