CHLNDDEV / OceanMesh2D

A two-dimensional triangular mesh generator with pre- and post-processing utilities written in pure MATLAB (no toolboxes required) designed specifically to build models that solve shallow-water equations or wave equations in a coastal environment (ADCIRC, FVCOM, WaveWatch3, SWAN, SCHISM, Telemac, etc.).
https://github.com/sponsors/krober10nd
GNU General Public License v3.0
179 stars 65 forks source link

Adding threshold option to extract_subdomain #177

Closed krober10nd closed 3 years ago

krober10nd commented 3 years ago

Note this maps all nodal attributes to the subdomain. For example, if the parent mesh had a directional wind stress nodal attribute, now the subdomain does too.

plot(sub,'type','dir','proj','lamb');
krober10nd commented 3 years ago

Perhaps the kwargs of extract_subdomain could be specified as name/value pairs instead of fixed position args.

WPringle commented 3 years ago

Yes I agree we should change the kwarg to name/value pairs. Also can you have threshold work both ways or as a range. Often I want to do it so only elements shallower than 250 m are kept, i.e., only continental shelf.

krober10nd commented 3 years ago

Yes I agree we should change the kwarg to name/value pairs. Also can you have threshold work both ways or as a range. Often I want to do it so only elements shallower than 250 m are kept, i.e., only continental shelf.

Sure that's reasonable. Also, when you do the extraction, you might want to remove singly connected elements there.

Singly elements can be deleted using msh.clean

WPringle commented 3 years ago

Ok I'm still a little confused about the the description of min_depth and max_depth on the help and how it is actually implemented. I think the way it is implemented is correct; so that if depth is less than the max_depth and more than the min_depth and inside the polygon then it is trimmed. But help is saying max_depth is to keep parts that are sufficiently deep when it should be other way around. Keep the parts that are shallower than max_depth and deeper than min_depth right?

WPringle commented 3 years ago

and change the if statement to be max_depth ~= +9999 rather than negative

WPringle commented 3 years ago

Can change the max_depth to be sufficiently shallow and min_depth to be sufficiently deep on the help?