Changeset 18554


Ignore:
Timestamp:
10/01/14 06:10:21 (10 years ago)
Author:
jbondzio
Message:

ADD: thermal.reltol for python

Location:
issm/trunk-jpl/src/m/classes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/classes/thermal.m

    r18553 r18554  
    9999                                md = checkfield(md,'fieldname','thermal.isdynamicbasalspc','numel', [1],'values',[0 1]);
    100100                                if(md.thermal.isenthalpy)
    101                                         md = checkfield(md,'fieldname','thermal.reltol','>',0.,'message','reltol must be larger than zero');
    102101                                        if isnan(md.stressbalance.reltol),
    103102                                                md = checkmessage(md,['for a steadystate computation, stressbalance.reltol (relative convergence criterion) must be defined!']);
    104103                                        end
     104                                        md = checkfield(md,'fieldname','thermal.reltol','>',0.,'message','reltol must be larger than zero');
    105105                                        md = checkfield(md,'fieldname','thermal.isdynamicbasalspc','numel', [1],'values',[1], 'message',['for enthalpy run thermal.isdynamicbasalspc should be 1']);
    106106                                end
  • issm/trunk-jpl/src/m/classes/thermal.py

    r18068 r18554  
    1818                self.penalty_threshold = 0
    1919                self.stabilization     = 0
     20                self.reltol            = 0
    2021                self.maxiter           = 0
    2122                self.penalty_lock      = 0
     
    3435                string="%s\n%s"%(string,fielddisplay(self,'stabilization','0: no, 1: artificial_diffusivity, 2: SUPG'))
    3536                string="%s\n%s"%(string,fielddisplay(self,'maxiter','maximum number of non linear iterations'))
     37                string="%s\n%s"%(string,fielddisplay(self,'reltol','relative tolerance criterion'))
    3638                string="%s\n%s"%(string,fielddisplay(self,'penalty_lock','stabilize unstable thermal constraints that keep zigzagging after n iteration (default is 0, no stabilization)'))
    3739                string="%s\n%s"%(string,fielddisplay(self,'penalty_threshold','threshold to declare convergence of thermal solution (default is 0)'))
     
    5658                #Type of stabilization used
    5759                self.stabilization=1
     60
     61                #Relative tolerance for the enthalpy convergence
     62                self.reltol=0.01
    5863
    5964                #Maximum number of iterations
     
    8994                        md = checkfield(md,'fieldname','thermal.isdynamicbasalspc','numel',[1],'values',[0,1]);
    9095                        if(md.thermal.isenthalpy):
     96                                if numpy.isnan(md.stressbalance.reltol):
     97                                        md.checkmessage("for a steadystate computation, stressbalance.reltol (relative convergence criterion) must be defined!")
     98                                md = checkfield(md,'fieldname','thermal.reltol','>',0.,'message',"reltol must be larger than zero");
    9199                                md = checkfield(md,'fieldname','thermal.isdynamicbasalspc','numel', [1],'values',[1], 'message',"for enthalpy run thermal.isdynamicbasalspc should be true")
    92100                md = checkfield(md,'fieldname','thermal.requested_outputs','stringrow',1)
     
    98106                WriteData(fid,'object',self,'fieldname','penalty_threshold','format','Integer')
    99107                WriteData(fid,'object',self,'fieldname','stabilization','format','Integer')
     108                WriteData(fid,'object',self,'fieldname','reltol','format','Double');
    100109                WriteData(fid,'object',self,'fieldname','maxiter','format','Integer')
    101110                WriteData(fid,'object',self,'fieldname','penalty_lock','format','Integer')
Note: See TracChangeset for help on using the changeset viewer.