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

fix to carry over weirs #206

Merged
merged 4 commits into from
Apr 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions @msh/msh.m
Original file line number Diff line number Diff line change
Expand Up @@ -1264,9 +1264,9 @@ function plotter(cmap,round_dec,yylabel,apply_pivot)
% varargin{1}: geodata class that had crestlines passed.
%
% ---------
% 'delete' - deletes a user-clicked boundary condition from msh.
% 'delete' - deletes a user-clicked land/mainland boundary condition from a msh.
% varargins:
% index of boundary to delete
% index of land/mainland boundary to delete

if nargin < 2
error('Needs type: one of "auto", "outer", "inner", "delete", or "weirs"')
Expand Down Expand Up @@ -1836,7 +1836,7 @@ function plotter(cmap,round_dec,yylabel,apply_pivot)
disp(['Deleting boundary with index ',num2str(del)]) ;

obj.bd.nbvv(:,del)=[];
if ~isempty(obj.bd.ibconn)
if isfield(obj.bd,'ibconn')
obj.bd.ibconn(:,del)=[];
obj.bd.barinht(:,del)=[];
obj.bd.barincfsb(:,del)=[];
Expand Down Expand Up @@ -2584,9 +2584,9 @@ function plotter(cmap,round_dec,yylabel,apply_pivot)
jj = obj1.bd.ibtype == 24;
obj.bd.nbou = obj.bd.nbou + sum(jj);
% types of boundaries
obj.bd.ibtype = [obj.bd.ibtype ; obj1.bd.ibtype(jj)];
obj.bd.ibtype = [obj.bd.ibtype obj1.bd.ibtype(jj)];
% new boundaries come after what's already on
obj.bd.nvell = [obj.bd.nvell; obj1.bd.nvell(jj)];
obj.bd.nvell = [obj.bd.nvell obj1.bd.nvell(jj)];
% nvel is twice the number of nodes on each boundary
obj.bd.nvel = 2*sum(obj.bd.nvell);
% nbvv is a matrix of boundary nodes
Expand Down
8 changes: 4 additions & 4 deletions @msh/private/readfort14.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
msgline = fgetl(fid) ;
neta = sscanf(msgline,'%d %*s') ;

nvdll = zeros(nope,1) ;
ibtypee = zeros(nope,1) ;
nvdll = zeros(1,nope) ;
ibtypee = zeros(1,nope) ;
nbdv = sparse(neta,nope) ;
% tic
for i = 1: nope
Expand Down Expand Up @@ -84,8 +84,8 @@
msgline = fgetl(fid) ;
nvel = sscanf(msgline,'%d %*s') ;

nvell = zeros(nbou,1) ;
ibtype = zeros(nbou,1) ;
nvell = zeros(1,nbou) ;
ibtype = zeros(1,nbou) ;
nbvv = sparse(nvel,nbou) ;
ibconn = sparse(nvel,nbou) ;
barinht = sparse(nvel,nbou) ;
Expand Down
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Getting help

Besides posting [issues](https://github.com/CHLNDDEV/OceanMesh2D/issues) with the code on Github, you can also ask questions via our Slack channel [here](https://join.slack.com/t/oceanmesh2d/shared_invite/zt-ldexcc7m-LkkxsUTUekHbJNxwlyrMYQ).

Note: If the slack link invite isn't working, please send either one of us and an email and we'll fix it. By default, the invite link expires every 30 days.
Note: If the slack link invite isn't working, please send either one of us and an email and we'll fix it. By default, the invite link expires every 30 days.

Otherwise please reach out to either Dr. William Pringle (wpringle@anl.gov) or Dr. Keith Roberts (krober@usp.br) with questions or concerns or feel free to start an Issue in the issues tab above.

Expand Down Expand Up @@ -70,10 +70,10 @@ PLEASE READ THE USER GUIDE!
A recent pdf of the user guide is located in this branch. For a continually updated version click [here](https://www.overleaf.com/read/hsqjhvtbkgvj#/54715995/) (wait for compilation and then click download PDF)

Run the "setup.sh" bash script to download the required m_map package and the base datasets:
- GSHHG global shoreline
- GSHHG global shoreline
- SRTM15_PLUS global topobathy DEM

Additional data required for some of the following examples must be downloaded manually from [here](https://drive.google.com/open?id=1LeQJFKaVCM2K59pKO9jDcB02yjTmJPmL). Specifically, Examples 2, 3, 4, 5 and 5b require additional datasets from the google drive folder while base datasets are sufficient for the other examples.
Additional data required for some of the following examples must be downloaded manually from [here](https://drive.google.com/open?id=1LeQJFKaVCM2K59pKO9jDcB02yjTmJPmL). Specifically, Examples 2, 3, 4, 5 and 5b require additional datasets from the google drive folder while base datasets are sufficient for the other examples.
```
Featured in ┌╼ Examples/Example_1_NZ.m %<- A simple mesh around South Island New Zealand that uses GSHHS shoreline.
user guide ├── Examples/Example_2_NY.m %<- A high-resolution mesh around the New York/Manhattan area that uses a DEM created from LiDAR data.
Expand All @@ -91,7 +91,7 @@ Testing

To ensure the software is fully functional on your system before building some crazy meshes it is strongly recommended to run the tests (RunTests.m) in the Tests/ directory.

We test all pull requests using this test suite on a local host before accepting. For substantial pull requests we will also test the Examples from the Examples/ directory.
We test all pull requests using this test suite on a local host before accepting. For substantial pull requests we will also test the Examples from the Examples/ directory.

References!
==============
Expand Down Expand Up @@ -141,10 +141,11 @@ Changelog
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

### Unreleased
## Added
## Added
- Deleting boundary conditions by specifyng their indices in `msh.object.bd` field. See https://github.com/CHLNDDEV/OceanMesh2D/pull/205
## Fixed
- 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

### [4.0.0] - 2021-03-14
## Added
Expand All @@ -153,23 +154,23 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Mesh "cleaning" modes moderate and aggressive transfer nodal attributes via improvements to `msh.map_mesh_properties`
- `msh.remove_attribute()` method to remove f13 attribute(s)
- new `msh.interp()` `slope_calc` kwarg option to set the method of computing the topographic gradients (slopes), either `rms` [default] or `abs`
- new `extract_subdomain()` `keep_numbering` kwarg option to keep the full mesh triangulation numbering on the subdomain [off by default].
- new `extract_subdomain()` `keep_numbering` kwarg option to keep the full mesh triangulation numbering on the subdomain [off by default].

## Changed
- `msh.plot()` overhaul. All options specified via kwarg.
- `msh.plot()` option `subset` option is now called `subdomain`
- `msh.plot()` arbitary f13 option now utilizes `colormap` kwarg
- `utilities/extract_subdomain` now is called with kwargs.
- Cleaning up `msh.bound_courant_number()` to use `msh.get_boundary_of_mesh()` for Delaunay-triangulation and allowing `msh.clean()` to do the transfer of attributes automatically.
- `msh.plus(obj1,obj2)` can now carry over obj2 f13 attributes if also exist in obj1
- `msh.plus(obj1,obj2)` can now carry over obj2 f13 attributes if also exist in obj1
- `msh()` more efficient storing of boundary conditions read in from fort.xx files, and `msh.write()` can write out arbitrary vertex indices (instead of just 1 to NP).

## Fixed
- Boundary labeling fix
- Prompt when labeling bcs using `outer` kwarg in `make_bc`
- fix for boundary condition mapping in `msh.map_mesh_properties()` especially for weirs/barriers
- fix for barrier mapping in `msh.plus()` routine
- fix for `msh.make_bc(m,auto,gdat)` where gdat is empty. In this case it uses the depths on the mesh to determine the open boundaries.
- fix for `msh.make_bc(m,auto,gdat)` where gdat is empty. In this case it uses the depths on the mesh to determine the open boundaries.
- check for `poly2ccw` mapping toolbox function in `kml2struct`
- fix for `msh.plot()` on log colormap when plotting f13 attributes

Expand Down