


Extract open boundary nodes from open boundary cordinate file
Detailed explanation goes here
based on function getOBC
Read fvcom mesh file into Matlab mesh object
[Mobj] = function get_wave_nesting_nodes(nnodes_file )
DESCRIPTION:
Read wave nesting node file & the associated co-ordinate file
Store in a matlab mesh object
INPUT [keyword pairs]:
'nnodes_file' = fvcom nesting node file (for fvcom swave)
OUTPUT:
Mobj = matlab structure containing mesh data
EXAMPLE USAGE
Mobj = get_wave_nesting_nodes('tst_nnodes.dat')
Author(s):
Hakeem Johnson (CH2MHILL, Warrington, UK)
Revision history
Jan 2014 - First version
==============================================================================

0001 function [ Mobj ] = get_HD_nesting_nodes(nnodes_file ) 0002 % Extract open boundary nodes from open boundary cordinate file 0003 % Detailed explanation goes here 0004 % based on function getOBC 0005 % Read fvcom mesh file into Matlab mesh object 0006 % 0007 % [Mobj] = function get_wave_nesting_nodes(nnodes_file ) 0008 % 0009 % DESCRIPTION: 0010 % Read wave nesting node file & the associated co-ordinate file 0011 % Store in a matlab mesh object 0012 % 0013 % INPUT [keyword pairs]: 0014 % 'nnodes_file' = fvcom nesting node file (for fvcom swave) 0015 % 0016 % OUTPUT: 0017 % Mobj = matlab structure containing mesh data 0018 % 0019 % EXAMPLE USAGE 0020 % Mobj = get_wave_nesting_nodes('tst_nnodes.dat') 0021 % 0022 % Author(s): 0023 % Hakeem Johnson (CH2MHILL, Warrington, UK) 0024 % 0025 % Revision history 0026 % Jan 2014 - First version 0027 %============================================================================== 0028 0029 %--------------------------------------------------------- 0030 % read from nnodes_file 0031 %--------------------------------------------------------- 0032 % read no of nesting nodes (nnodes) 0033 %hkj if( ~(exist(nnodes_file,'file')) ) error('File not found'); 0034 checkfile(nnodes_file); 0035 fid_nn = fopen (nnodes_file, 'r'); 0036 C = textscan(fid_nn, '%s %s %s %d', 1); 0037 nnodes = C{4}; 0038 C = textscan(fid_nn, '%s %s %s', 1); 0039 % read seq_no and id_no of nesting nodes 0040 nnvals(1:nnodes,1:2)= zeros(nnodes,2); 0041 for i=1:nnodes 0042 C = textscan(fid_nn,' %d %d %d \n',1); 0043 nnvals(i,1) = C{1}; nnvals(i,2) = C{2}; 0044 end; 0045 0046 fclose(fid_nn); 0047 0048 Mobj.nVerts = nnodes; 0049 Mobj.nnodesID = nnvals(:,2); 0050 0051 end 0052