Ignore:
Timestamp:
01/29/15 08:44:39 (10 years ago)
Author:
Mathieu Morlighem
Message:

NEW: extrude is now a method of each class so that model.m does not need to know what class is being used

File:
1 edited

Legend:

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

    r19040 r19048  
    1111        end
    1212        methods
    13         function createxml(self,fid) % {{{
    14             fprintf(fid, '\n\n');
    15             fprintf(fid, '%s\n', '<!-- Friction: Sigma= drag^2 * Neff ^r * u ^s, with Neff=rho_ice*g*thickness+rho_water*g*bed, r=q/p and s=1/p -->');
    16             fprintf(fid,'%s\n%s\n%s\n','<frame key="1" label="Friction: Sigma= drag^2 * Neff ^r * u ^s, with Neff=rho_ice*g*thickness+rho_water*g*bed, r=q/p and s=1/p">','<section name="friction" />');   
    17             fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n',    '<parameter key ="coefficient" type="',          class(self.coefficient),'" default="',          convert2str(self.coefficient),'">',              '     <section name="friction" />','     <help> friction coefficient [SI] </help>','</parameter>');
    18             fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n',    '<parameter key ="p" type="',               class(self.p),'" default="',                 convert2str(self.p),'">',   '     <section name="friction" />','     <help> p exponent </help>','</parameter>');
    19             fprintf(fid,'%s%s%s%s%s\n%s\n%s\n',        '<parameter key ="q" type="',               class(self.q),'" default="',                 convert2str(self.q),'">',            '     <section name="friction" />','     <help> q exponent </help>','</parameter>');
    20             fprintf(fid,'%s\n%s\n','</frame>');
    21         end % }}}
     13                function createxml(self,fid) % {{{
     14                        fprintf(fid, '\n\n');
     15                        fprintf(fid, '%s\n', '<!-- Friction: Sigma= drag^2 * Neff ^r * u ^s, with Neff=rho_ice*g*thickness+rho_water*g*bed, r=q/p and s=1/p -->');
     16                        fprintf(fid,'%s\n%s\n%s\n','<frame key="1" label="Friction: Sigma= drag^2 * Neff ^r * u ^s, with Neff=rho_ice*g*thickness+rho_water*g*bed, r=q/p and s=1/p">','<section name="friction" />');   
     17                        fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n',    '<parameter key ="coefficient" type="',      class(self.coefficient),'" default="',          convert2str(self.coefficient),'">',              '     <section name="friction" />','     <help> friction coefficient [SI] </help>','</parameter>');
     18                        fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n',    '<parameter key ="p" type="',               class(self.p),'" default="',                 convert2str(self.p),'">',   '     <section name="friction" />','     <help> p exponent </help>','</parameter>');
     19                        fprintf(fid,'%s%s%s%s%s\n%s\n%s\n',        '<parameter key ="q" type="',               class(self.q),'" default="',                 convert2str(self.q),'">',            '     <section name="friction" />','     <help> q exponent </help>','</parameter>');
     20                        fprintf(fid,'%s\n%s\n','</frame>');
     21                end % }}}
     22                function self = extrude(self,md) % {{{
     23                        self.coefficient=project3d(md,'vector',self.coefficient,'type','node','layer',1);
     24                        self.p=project3d(md,'vector',self.p,'type','element');
     25                        self.q=project3d(md,'vector',self.q,'type','element');
     26                end % }}}
    2227                function self = friction(varargin) % {{{
    2328                        switch nargin
Note: See TracChangeset for help on using the changeset viewer.