Home > fvcom_prepro > get_HD_OBC.m

get_HD_OBC

PURPOSE ^

Extract open boundary nodes from open boundary cordinate file

SYNOPSIS ^

function [ Mobj ] = get_HD_OBC(nnodes_file )

DESCRIPTION ^

 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
==============================================================================

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [ Mobj ] = get_HD_OBC(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 fid_nn = fopen (nnodes_file, 'r');
0034 C = textscan(fid_nn, '%s %s %s %s %d', 1); 
0035 nnodes = C{5};
0036 
0037 % read seq_no and id_no of nesting nodes
0038 nnvals(1:nnodes,1:2)= zeros(nnodes,2);
0039 for i=1:nnodes
0040   C = textscan(fid_nn,' %d %d %d \n',1);
0041   nnvals(i,1) = C{1};  nnvals(i,2) = C{2}; 
0042 end;
0043 
0044 fclose(fid_nn);
0045 
0046 Mobj.nVerts = nnodes;
0047 Mobj.nnodesID  = nnvals(:,2);
0048 
0049 end
0050

Generated on Wed 10-Aug-2016 16:44:39 by m2html © 2005