Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.py =================================================================== --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.py (revision 13027) +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.py (revision 13028) @@ -1,31 +1,13 @@ import numpy from model import * from pairoptions import * -from recover_areas import * from MatlabFuncs import * from FlagElements import * -def recover_areas(md,*args): # {{{ - """ - RECOVER_AREAS - flag the element depending on the physical model that is assigned to them - This routine is called by setelementstype, do not use + #recover elements distribution - Usage: - [hutterflag macayealflag pattynflag stokesflag filltype]=recover_areas(md,varargin); - """ - #go through varargin, extract options and plug them into subtype options, by order of appearance - options=pairoptions(*args) -# options=deleteduplicates(options,1); - - #recover elements distribution - hutterflag =FlagElements(md,options.getfieldvalue('hutter','')) - macayealflag=FlagElements(md,options.getfieldvalue('macayeal','')) - pattynflag =FlagElements(md,options.getfieldvalue('pattyn','')) - stokesflag =FlagElements(md,options.getfieldvalue('stokes','')) - filltype =options.getfieldvalue('fill','none') - return hutterflag,macayealflag,pattynflag,stokesflag,filltype #}}} def setflowequation(md,*args): @@ -33,7 +15,7 @@ SETELEMENTSTYPE - associate a solution type to each element This routine works like plotmodel: it works with an even number of inputs - 'hutter','macayeal','pattyn','stokes' and 'fill' are the possible options + 'hutter','macayeal','pattyn','l1l2','stokes' and 'fill' are the possible options that must be followed by the corresponding exp file or flags list It can either be a domain file (argus type, .exp extension), or an array of element flags. If user wants every element outside the domain to be @@ -54,13 +36,22 @@ if not isinstance(md,model) or not len(args): raise TypeError("setflowequation error message") + #process options + options=pairoptions(*args) +# options=deleteduplicates(options,1); + #Find_out what kind of coupling to use - options=pairoptions(*args) coupling_method=options.getfieldvalue('coupling','tiling') if not strcmpi(coupling_method,'tiling') and not strcmpi(coupling_method,'penalties'): raise TypeError("coupling type can only be: tiling or penalties") - hutterflag,macayealflag,pattynflag,stokesflag,filltype=recover_areas(md,*args) + #recover elements distribution + hutterflag = FlagElements(md,options.getfieldvalue('hutter','')) + macayealflag = FlagElements(md,options.getfieldvalue('macayeal','')) + pattynflag = FlagElements(md,options.getfieldvalue('pattyn','')) + l1l2flag = FlagElements(md,options.getfieldvalue('l1l2','')) + stokesflag = FlagElements(md,options.getfieldvalue('stokes','')) + filltype = options.getfieldvalue('fill','none') #Flag the elements that have not been flagged as filltype if strcmpi(filltype,'hutter'): Index: /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.m =================================================================== --- /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.m (revision 13027) +++ /u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/parameterization/setflowequation.m (revision 13028) @@ -23,14 +23,23 @@ error('setflowequation error message'); end +%Process options +options=pairoptions(varargin{:}); +options=deleteduplicates(options,1); + %Find_out what kind of coupling to use -options=pairoptions(varargin{:}); coupling_method=getfieldvalue(options,'coupling','tiling'); if (~strcmpi(coupling_method,'tiling') & ~strcmpi(coupling_method,'penalties')), error('coupling type can only be: tiling or penalties'); end -[hutterflag macayealflag pattynflag stokesflag filltype]=recover_areas(md,varargin{:}); +%recover elements distribution +hutterflag = FlagElements(md,getfieldvalue(options,'hutter','')); +macayealflag = FlagElements(md,getfieldvalue(options,'macayeal','')); +pattynflag = FlagElements(md,getfieldvalue(options,'pattyn','')); +l1l2flag = FlagElements(md,getfieldvalue(options,'l1l2','')); +stokesflag = FlagElements(md,getfieldvalue(options,'stokes','')); +filltype = getfieldvalue(options,'fill','none'); %Flag the elements that have not been flagged as filltype if strcmpi(filltype,'hutter'), @@ -279,25 +288,3 @@ if any(md.flowequation.borderstokes) & any(md.flowequation.borderpattyn) & any(md.flowequation.borderpattyn + md.flowequation.borderstokes~=1), error('error coupling domain too irregular'); end -end - -function [hutterflag macayealflag pattynflag stokesflag filltype]=recover_areas(md,varargin); % {{{ -%RECOVER_AREAS - flag the element depending on the physical model that is assigned to them -% -% This routine is called by setelementstype, do not use -% -% Usage: -% [hutterflag macayealflag pattynflag stokesflag filltype]=recover_areas(md,varargin); - - %go through varargin, extract options and plug them into subtype options, by order of appearance - options=pairoptions(varargin{:}); - options=deleteduplicates(options,1); - - %recover elements distribution - hutterflag =FlagElements(md,getfieldvalue(options,'hutter','')); - macayealflag=FlagElements(md,getfieldvalue(options,'macayeal','')); - pattynflag =FlagElements(md,getfieldvalue(options,'pattyn','')); - stokesflag =FlagElements(md,getfieldvalue(options,'stokes','')); - filltype =getfieldvalue(options,'fill','none'); - -end %end function }}}