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

Allowing msh.BoundCr to map over msh attributes #186

Closed WPringle closed 3 years ago

WPringle commented 3 years ago
krober10nd commented 3 years ago

Typo in deprecated.

 error('This function has been depracated. Use "BoundCr" instead')
krober10nd commented 3 years ago

while we're at it.

msh.BoundCr() - > msh.bound_courant_number()

and

msh.getBoundaryOfMesh() -> msh.get_boundary_of_mesh()
WPringle commented 3 years ago

I made the renaming changes.

Also I found a bad call to the map_mesh_properties in msh.plot() for the subdomain so I fixed that.

krober10nd commented 3 years ago

Thanks...I won't have time to test this out until the weekend.

krober10nd commented 3 years ago

Seem to be getting an error when trying to migrate the boundary conditions

Error using horzcat
The following error occurred converting from double
to int32:
Attempt to convert to unimplemented sparse type

Error in intersect>intersectR2012a (line 220)
            [c,iau] = unique([a(ia) b([])],order);

Error in intersect (line 159)
        [varargout{1:nlhs}] =
        intersectR2012a(varargin{1:2},logical(flaginds(1:3)));

Error in msh/map_mesh_properties (line 3828)
                    [~,~,idx_new] =
                    intersect(idx_old,ind,'stable');

Error in msh/bound_courant_number/DecimateTria (line
2880)
                obj =
                map_mesh_properties(obj,'msh_old',m_old);

Error in msh/bound_courant_number (line 2774)
                    obj = DecimateTria(obj,bad);
krober10nd commented 3 years ago

So more tests reveal msh.bd is the culprit but msh.ob migrates, likely because in my mesh I only have one open ocean boundary and several land boundaries. I would suggest for this usage case to delete the boundaries as it's not trivial to remap them to a new mesh that has edited connectivity.

WPringle commented 3 years ago

Ok, I put the line to delete bcs in the bound_courant_number function

krober10nd commented 3 years ago

Okay, this is fine by me. I do think there's far too much verbosity/messages going to the screen and this hides key warnings to the user (i.e., there goes your boundaries and control file) but these are relatively easy to regenerate.

I'd like to deal with the verbosity next.