Ignore:
Timestamp:
11/14/13 14:50:13 (11 years ago)
Author:
Eric.Larour
Message:

CHG: checkfield could not run for massatfluggate or misfit classes, because these classes do not
have access to their own fields through the model! So we modified checkfield.m and checkfield.py to accept
either directly a field, or indirectly a fieldname which then is used to retrieve from the model.

File:
1 edited

Legend:

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

    r16304 r16764  
    8080                function md = checkconsistency(obj,md,solution,analyses) % {{{
    8181                       
    82                         md = checkfield(md,'damage.D','>=',0,'<=',obj.max_damage,'size',[md.mesh.numberofvertices 1]);
    83                         md = checkfield(md,'damage.max_damage','<',1,'>=',0);
    84                         md = checkfield(md,'damage.law','values',{'undamaged','pralong'});
    85                         md = checkfield(md,'damage.spcdamage','forcing',1);
     82                        md = checkfield(md,'fieldname','damage.D','>=',0,'<=',obj.max_damage,'size',[md.mesh.numberofvertices 1]);
     83                        md = checkfield(md,'fieldname','damage.max_damage','<',1,'>=',0);
     84                        md = checkfield(md,'fieldname','damage.law','values',{'undamaged','pralong'});
     85                        md = checkfield(md,'fieldname','damage.spcdamage','forcing',1);
    8686                       
    87                         md = checkfield(md,'damage.stabilization','numel',[1],'values',[0 1 2]);
    88                         md = checkfield(md,'damage.maxiter','>=0',0);
    89                         md = checkfield(md,'damage.penalty_factor','>=0',0);
    90                         md = checkfield(md,'damage.penalty_lock','>=0',0);
    91                         md = checkfield(md,'damage.penalty_threshold','>=0',0);
     87                        md = checkfield(md,'fieldname','damage.stabilization','numel',[1],'values',[0 1 2]);
     88                        md = checkfield(md,'fieldname','damage.maxiter','>=0',0);
     89                        md = checkfield(md,'fieldname','damage.penalty_factor','>=0',0);
     90                        md = checkfield(md,'fieldname','damage.penalty_lock','>=0',0);
     91                        md = checkfield(md,'fieldname','damage.penalty_threshold','>=0',0);
    9292
    9393                        if strcmpi(obj.law,'pralong'),
    94                                 md = checkfield(md,'damage.healing','>=',0);
    95                                 md = checkfield(md,'damage.c1','>=',0);
    96                                 md = checkfield(md,'damage.c2','>=',0);
    97                                 md = checkfield(md,'damage.c3','>=',0);
    98                                 md = checkfield(md,'damage.c4','>=',0);
    99                                 md = checkfield(md,'damage.stress_threshold','>=',0);
     94                                md = checkfield(md,'fieldname','damage.healing','>=',0);
     95                                md = checkfield(md,'fieldname','damage.c1','>=',0);
     96                                md = checkfield(md,'fieldname','damage.c2','>=',0);
     97                                md = checkfield(md,'fieldname','damage.c3','>=',0);
     98                                md = checkfield(md,'fieldname','damage.c4','>=',0);
     99                                md = checkfield(md,'fieldname','damage.stress_threshold','>=',0);
    100100                        elseif strcmpi(obj.law,'undamaged'),
    101101                                if (solution==DamageEvolutionSolutionEnum),
Note: See TracChangeset for help on using the changeset viewer.