Ignore:
Timestamp:
08/04/10 08:42:15 (15 years ago)
Author:
Mathieu Morlighem
Message:

Added constrained ice shelf

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/utils/BC/SetIceShelfBC.m

    r3994 r4962  
    1 function md=SetIceShelfBC(md,icefrontfile)
     1function md=SetIceShelfBC(md,varargin)
    22%SETICESHELFBC - Create the boundary conditions for diagnostic and thermal models for a  Ice Shelf with Ice Front
    33%
     
    77%
    88%   Usage:
    9 %      md=SetIceShelfBC(md,icefrontfile)
     9%      md=SetIceShelfBC(md,varargin)
    1010%
    1111%   Example:
     12%      md=SetIceShelfBC(md);
    1213%      md=SetIceShelfBC(md,'Front.exp');
    1314%
     
    1516
    1617%grid on Dirichlet (boundary and ~icefront)
    17 if ~exist(icefrontfile)
    18         error(['SetIceShelfBC error message: ice front file ' icefrontfile ' not found']);
     18if nargin==2,
     19        icefrontfile=varargin{1};
     20        if ~exist(icefrontfile), error(['SetIceShelfBC error message: ice front file ' icefrontfile ' not found']); end
     21        gridinsideicefront=ContourToMesh(md.elements,md.x,md.y,expread(icefrontfile,1),'node',2);
     22        gridonicefront=double(md.gridonboundary & gridinsideicefront);
     23elseif nargin==1,
     24        gridonicefront=zeros(md.numberofgrids,1);
     25else
     26        help SetIceShelfBC
     27        error('bad usage');
    1928end
    20 gridinsideicefront=ContourToMesh(md.elements,md.x,md.y,expread(icefrontfile,1),'node',2);
    21 gridonicefront=double(md.gridonboundary & gridinsideicefront);
    2229pos=find(md.gridonboundary & ~gridonicefront);
    2330md.spcvelocity=zeros(md.numberofgrids,6);
Note: See TracChangeset for help on using the changeset viewer.