Changeset 421
- Timestamp:
- 05/14/09 09:53:05 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/m/utils/BC/SetMarineIceSheetBC.m
r40 r421 1 function md=SetMarineIceSheetBC(md, icefrontfile)1 function md=SetMarineIceSheetBC(md,varargin) 2 2 %SETICEMARINESHEETBC - Create the boundary conditions for diagnostic and thermal models for a Marine Ice Sheet with Ice Front 3 3 % 4 % Neumann BC are used on the ice front (an A NRGUS contour around the ice front5 % must be given in input)4 % Neumann BC are used on the ice front (an ARGUS contour around the ice front 5 % can be given in input, or it will be deduced as oniceshelf & onboundary) 6 6 % Dirichlet BC are used elsewhere for diagnostic 7 7 % 8 8 % Usage: 9 9 % md=SetMarineIceSheetBC(md,icefrontfile) 10 % md=SetMarineIceSheetBC(md) 10 11 % 11 12 % Example: 12 13 % md=SetMarineIceSheetBC(md,'Front.exp') 14 % md=SetMarineIceSheetBC(md) 13 15 % 14 16 % See also: SETICESHELFBC, SETMARINEICESHEETBC 15 17 16 18 %grid on Dirichlet (boundary and ~icefront) 17 if ~exist(icefrontfile) 18 error(['SetMarineIceSheetBC error message: ice front file ' icefrontfile ' not found']); 19 if nargin==2, 20 %User provided Front.exp, use it 21 icefrontfile=varargin{1}; 22 if ~exist(icefrontfile) 23 error(['SetMarineIceSheetBC error message: ice front file ' icefrontfile ' not found']); 24 end 25 gridinsideicefront=ContourToMesh(md.elements,md.x,md.y,expread(icefrontfile,1),'node',2); 26 gridonicefront=double(md.gridonboundary & gridinsideicefront); 27 28 else 29 %Guess where the ice front is 30 pos=find(md.gridonboundary & md.gridoniceshelf); 31 md.gridondirichlet_diag=zeros(md.numberofgrids,1); 32 md.gridondirichlet_diag(pos)=1; 19 33 end 20 gridinsideicefront=ContourToMesh(md.elements,md.x,md.y,expread(icefrontfile,1),'node',2);21 gridonicefront=double(md.gridonboundary & gridinsideicefront);22 34 pos=find(md.gridonboundary & ~gridonicefront); 35 if isempty(pos), 36 error('SetMarineIceSheetBC error message: ice front all around the glacier, no dirichlet found. Set BC manually') 37 end 23 38 md.gridondirichlet_diag=zeros(md.numberofgrids,1); 24 39 md.gridondirichlet_diag(pos)=1;
Note:
See TracChangeset
for help on using the changeset viewer.