Changeset 13028
- Timestamp:
- 08/14/12 10:08:33 (13 years ago)
- Location:
- issm/trunk-jpl/src/m/parameterization
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/parameterization/setflowequation.m
r13027 r13028 24 24 end 25 25 26 %Process options 27 options=pairoptions(varargin{:}); 28 options=deleteduplicates(options,1); 29 26 30 %Find_out what kind of coupling to use 27 options=pairoptions(varargin{:});28 31 coupling_method=getfieldvalue(options,'coupling','tiling'); 29 32 if (~strcmpi(coupling_method,'tiling') & ~strcmpi(coupling_method,'penalties')), … … 31 34 end 32 35 33 [hutterflag macayealflag pattynflag stokesflag filltype]=recover_areas(md,varargin{:}); 36 %recover elements distribution 37 hutterflag = FlagElements(md,getfieldvalue(options,'hutter','')); 38 macayealflag = FlagElements(md,getfieldvalue(options,'macayeal','')); 39 pattynflag = FlagElements(md,getfieldvalue(options,'pattyn','')); 40 l1l2flag = FlagElements(md,getfieldvalue(options,'l1l2','')); 41 stokesflag = FlagElements(md,getfieldvalue(options,'stokes','')); 42 filltype = getfieldvalue(options,'fill','none'); 34 43 35 44 %Flag the elements that have not been flagged as filltype … … 280 289 error('error coupling domain too irregular'); 281 290 end 282 end283 284 function [hutterflag macayealflag pattynflag stokesflag filltype]=recover_areas(md,varargin); % {{{285 %RECOVER_AREAS - flag the element depending on the physical model that is assigned to them286 %287 % This routine is called by setelementstype, do not use288 %289 % Usage:290 % [hutterflag macayealflag pattynflag stokesflag filltype]=recover_areas(md,varargin);291 292 %go through varargin, extract options and plug them into subtype options, by order of appearance293 options=pairoptions(varargin{:});294 options=deleteduplicates(options,1);295 296 %recover elements distribution297 hutterflag =FlagElements(md,getfieldvalue(options,'hutter',''));298 macayealflag=FlagElements(md,getfieldvalue(options,'macayeal',''));299 pattynflag =FlagElements(md,getfieldvalue(options,'pattyn',''));300 stokesflag =FlagElements(md,getfieldvalue(options,'stokes',''));301 filltype =getfieldvalue(options,'fill','none');302 303 end %end function }}} -
issm/trunk-jpl/src/m/parameterization/setflowequation.py
r13027 r13028 2 2 from model import * 3 3 from pairoptions import * 4 from recover_areas import *5 4 from MatlabFuncs import * 6 5 from FlagElements import * 7 6 8 def recover_areas(md,*args): # {{{9 """10 RECOVER_AREAS - flag the element depending on the physical model that is assigned to them11 12 This routine is called by setelementstype, do not use13 14 Usage:15 [hutterflag macayealflag pattynflag stokesflag filltype]=recover_areas(md,varargin);16 """17 18 #go through varargin, extract options and plug them into subtype options, by order of appearance19 options=pairoptions(*args)20 # options=deleteduplicates(options,1);21 7 22 8 #recover elements distribution 23 hutterflag =FlagElements(md,options.getfieldvalue('hutter','')) 24 macayealflag=FlagElements(md,options.getfieldvalue('macayeal','')) 25 pattynflag =FlagElements(md,options.getfieldvalue('pattyn','')) 26 stokesflag =FlagElements(md,options.getfieldvalue('stokes','')) 27 filltype =options.getfieldvalue('fill','none') 9 28 10 29 11 return hutterflag,macayealflag,pattynflag,stokesflag,filltype … … 34 16 35 17 This routine works like plotmodel: it works with an even number of inputs 36 'hutter','macayeal','pattyn',' stokes' and 'fill' are the possible options18 'hutter','macayeal','pattyn','l1l2','stokes' and 'fill' are the possible options 37 19 that must be followed by the corresponding exp file or flags list 38 20 It can either be a domain file (argus type, .exp extension), or an array of element flags. … … 55 37 raise TypeError("setflowequation error message") 56 38 39 #process options 40 options=pairoptions(*args) 41 # options=deleteduplicates(options,1); 42 57 43 #Find_out what kind of coupling to use 58 options=pairoptions(*args)59 44 coupling_method=options.getfieldvalue('coupling','tiling') 60 45 if not strcmpi(coupling_method,'tiling') and not strcmpi(coupling_method,'penalties'): 61 46 raise TypeError("coupling type can only be: tiling or penalties") 62 47 63 hutterflag,macayealflag,pattynflag,stokesflag,filltype=recover_areas(md,*args) 48 #recover elements distribution 49 hutterflag = FlagElements(md,options.getfieldvalue('hutter','')) 50 macayealflag = FlagElements(md,options.getfieldvalue('macayeal','')) 51 pattynflag = FlagElements(md,options.getfieldvalue('pattyn','')) 52 l1l2flag = FlagElements(md,options.getfieldvalue('l1l2','')) 53 stokesflag = FlagElements(md,options.getfieldvalue('stokes','')) 54 filltype = options.getfieldvalue('fill','none') 64 55 65 56 #Flag the elements that have not been flagged as filltype
Note:
See TracChangeset
for help on using the changeset viewer.