Ignore:
Timestamp:
11/29/11 16:03:56 (13 years ago)
Author:
Mathieu Morlighem
Message:

Improvement: marshall is now a method of all model fields, removed unnecessary model fields (numcontrols... etc)

File:
1 edited

Legend:

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

    r9862 r10969  
    66classdef prognostic
    77        properties (SetAccess=public)
    8                  spcthickness           = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',1);
    9                  hydrostatic_adjustment = modelfield('default',0,'marshall',true,'preprocess','StringToEnum','format','Integer');
    10                  stabilization          = modelfield('default',0,'marshall',true,'format','Integer');
    11                  vertex_pairing         = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',3);
    12                  penalty_factor         = modelfield('default',0,'marshall',true,'format','Double');
     8                 spcthickness           = NaN;
     9                 hydrostatic_adjustment = 0;
     10                 stabilization          = 0;
     11                 vertex_pairing         = NaN;
     12                 penalty_factor         = 0;
    1313        end
    1414        methods
     
    2929                end % }}}
    3030                function obj = setdefaultparameters(obj) % {{{
    31 
    32                         %first, use the defaults provided by the properties definition above.
    33                         fieldnames=fields(obj);
    34                         for i=1:length(fieldnames),
    35                                 fieldname=fieldnames{i};
    36                                 obj.(fieldname)=obj.(fieldname).default;
    37                         end
    3831
    3932                        %Type of stabilization to use 0:nothing 1:artificial_diffusivity 3:Discontinuous Galerkin
     
    6760
    6861                end % }}}
     62                function marshall(obj,fid) % {{{
     63                        WriteData(fid,'object',obj,'fieldname','spcthickness','format','DoubleMat','mattype',1);
     64                        WriteData(fid,'data',StringToEnum(obj.hydrostatic_adjustment),'format','Integer','enum',PrognosticHydrostaticAdjustmentEnum);
     65                        WriteData(fid,'object',obj,'fieldname','stabilization','format','Integer');
     66                        WriteData(fid,'object',obj,'fieldname','vertex_pairing','format','DoubleMat','mattype',3);
     67                        WriteData(fid,'object',obj,'fieldname','penalty_factor','format','Double');
     68                end % }}}
    6969        end
    7070end
Note: See TracChangeset for help on using the changeset viewer.