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
178 stars 64 forks source link

Problem creating fort.13 file for ADCIRC model in OceanMesh2D #293

Closed jalal-90 closed 11 months ago

jalal-90 commented 11 months ago

Dear all,

I am facing problem to create a fort.13 file for ADCIRC model in OceanMesh2D. Here, I added my problems followed by main code.

Problem Index exceeds array bounds.

Error in Calc_f13 (line 66) if strcmpi(varargin{1},'inpoly')

Main code

clearvars; clc;clear;close all

addpath('..') addpath(genpath('./utilities/')) addpath(genpath('./datasets/')) addpath(genpath('./OceanMesh2D_Datasets/')) addpath(genpath('./m_map/'))

% STEP 1: set mesh extents and set parameters for mesh. bbox = [110 134; % lon_min lon_max 20 32]; % lat_min lat_max min_el = 1e3; % minimum resolution in meters. max_el = 100e3; % maximum resolution in meters. max_el_ns = 5e3; % maximum resolution nearshore in meters. grade = 0.35; % mesh grade in decimal percent. R = 3; % number of elements to resolve feature width.

%------------------------------------------------------------------------- % STEP 2: specify geographical datasets and process the geographical data % to be used later with other OceanMesh classes...

coastline = 'GSHHS_f_L1'; gdat = geodata('shp',coastline,'bbox',bbox,'h0',min_el);

% STEP 3: create an edge function class fh = edgefx('geodata',gdat,... 'fs',R,'max_el_ns',max_el_ns,... 'max_el',max_el,'g',grade);

% STEP 4: Pass your edgefx class object along with some meshing options and % build the mesh...

mshopts = meshgen('ef',fh,'bou',gdat,'plot_on',1,'nscreen',5,'proj','trans'); mshopts = mshopts.build; m = mshopts.grd; % unpack the mesh object m = make_bc(m,'auto',gdat,'distance'); % make the boundary conditions

m = Calc_f13(m,'Ev');

krober10nd commented 11 months ago

Did you read the docstring for calc_f13? You're calling the function incorrectly.

jalal-90 commented 11 months ago

Did you read the docstring for calc_f13? You're calling the function incorrectly.

I am sorry for the inconvenience caused. Could I have an example script for Calc_f13_inpoly () function?

krober10nd commented 11 months ago

@jalal-90 The calling format is in the docstring for the function. Please read the help documentation we put together and try to figure it out from there. Thanks.