model

PURPOSE ^

MODEL - constructor for a model

SYNOPSIS ^

function md = model(varargin)

DESCRIPTION ^

MODEL - constructor for a model

   Usage:
      md = model(varargin)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function md = model(varargin)
0002 %MODEL - constructor for a model
0003 %
0004 %   Usage:
0005 %      md = model(varargin)
0006 
0007 switch nargin
0008 
0009 case 0
0010     % if no input arguments, create a default object
0011 
0012     %Model general information
0013     md.notes='';
0014     md.name='';
0015     md.counter=0; %1 mesh, 2 geography, 3 parameterize
0016     md.domainoutline=NaN;
0017     md.riftoutline=NaN;
0018     md.iceshelfoutline=NaN;
0019     md.icesheetoutline=NaN;
0020     md.parameterfile=NaN;
0021     
0022     %Mesh
0023     md.type='2d';
0024     md.numberofelements=0;
0025     md.numberofgrids=0;
0026     md.elements=NaN;
0027     md.elements_type=NaN;
0028     md.x=NaN;
0029     md.y=NaN;
0030     md.z=NaN;
0031     md.bed_slopex=NaN;
0032     md.bed_slopey=NaN;
0033     md.surface_slopex=NaN;
0034     md.surface_slopey=NaN;
0035 
0036     %Initial 2d mesh
0037     md.numberofelements2d=0;
0038     md.numberofgrids2d=0;
0039     md.elements2d=NaN;
0040     md.elements_type2d=NaN;
0041     md.x2d=NaN;
0042     md.y2d=NaN;
0043     md.z2d=NaN;
0044         
0045     %Elements
0046     md.elementonhutter=NaN;
0047     md.elementonmacayeal=NaN;
0048     md.elementonpattyn=NaN;
0049     md.elementonstokes=NaN;
0050 
0051     %Nodes
0052     md.gridonhutter=NaN;
0053     md.gridonmacayeal=NaN;
0054     md.gridonpattyn=NaN;
0055     md.gridonstokes=NaN;
0056 
0057     %Stokes mesh
0058     md.stokesreconditioning=10^13;
0059     
0060     %Penalties
0061     md.penalties=NaN;
0062     md.penalty_offset=3;   %penalty=Kmax*10^penalty_offset
0063     md.penalty_melting=10^7;%penalty used to keep T<Tpmp
0064     md.penalty_lock=10;
0065     md.segments=NaN;       %private member, not displayed
0066     md.segmentmarkers=NaN; %private member, not displayed
0067     md.rifts=NaN;
0068     md.numrifts=0;
0069 
0070     %Projections
0071     md.uppergrids=NaN;
0072     md.lowergrids=NaN;
0073     md.deadgrids=NaN;
0074     
0075     %Extrusion
0076     md.numlayers=0;
0077     md.elementonbed=NaN;
0078     md.elementonsurface=NaN;
0079     md.gridonbed=NaN;
0080     md.gridonsurface=NaN;
0081     md.minh=1;
0082     md.firn_layer=NaN;
0083     md.dof=NaN;
0084 
0085     %Extraction
0086     md.extractedgrids=NaN;
0087     md.extractedelements=NaN;
0088     
0089     %Materials parameters
0090     md.rho_ice=0;
0091     md.rho_water=0;
0092     md.heatcapacity=2093;
0093     md.latentheat=3.34*10^5; %(J/kg);
0094     md.thermalconductivity=2.4; %(W/m/K)
0095     md.meltingpoint=273.15; %The melting point of ice at 1 atmosphere of pressure in K
0096     md.beta=9.8*10^-8; %dependence of melting on pressure.
0097     md.mixed_layer_capacity=3974; %J/kg/K
0098     md.thermal_exchange_velocity=1.00*10^-4; %m/s
0099     
0100     %Physical parameters
0101     md.g=0;
0102     md.yts=365*24*3600;
0103     md.drag=NaN;
0104     md.drag_type=2;
0105     md.p=NaN;
0106     md.q=NaN;
0107     md.B=NaN;
0108     md.n=NaN;
0109 
0110     %Geometrical parameters
0111     md.elementoniceshelf=NaN;
0112     md.elementonicesheet=NaN;
0113     md.gridoniceshelf=NaN;
0114     md.gridonicesheet=NaN;
0115     md.surface=NaN;
0116     md.thickness=NaN;
0117     md.new_thickness=NaN;
0118     md.bed=NaN;
0119 
0120     %Boundary conditions
0121     md.gridonboundary=NaN;
0122     %Diagnostic
0123     md.segmentonneumann_diag=NaN;
0124     md.neumannvalues_diag=NaN;
0125     md.gridondirichlet_diag=NaN;
0126     md.dirichletvalues_diag=NaN;
0127 
0128     %Thermal
0129     md.min_thermal_constraints=0; %minimum number of unstable thermal constraints
0130     md.gridondirichlet_thermal=NaN;
0131     md.dirichletvalues_thermal=NaN;
0132 
0133     %Transient
0134     md.segmentonneumann_prog=NaN;
0135     md.neumannvalues_prog=NaN;
0136     md.segmentonneumann_prog2=NaN;
0137     md.neumannvalues_prog2=NaN;
0138     md.gridondirichlet_prog=NaN;
0139     md.dirichletvalues_prog=NaN;
0140 
0141     %Observations
0142     md.vx_obs=NaN;
0143     md.vy_obs=NaN;
0144     md.vel_obs=NaN;
0145     md.accumulation=NaN;
0146     md.geothermalflux=NaN;
0147     md.observed_temperature=NaN;
0148 
0149     %Statics parameters
0150     md.eps_rel=0;
0151     md.eps_abs=0;
0152     md.acceleration=0;
0153     md.sparsity=0;
0154     md.connectivity=10;
0155     md.lowmem=0;
0156     md.viscosity_overshoot=0.3;
0157     
0158     %Transient parameters
0159     md.dt=0;
0160     md.ndt=0;
0161     md.artificial_diffusivity=0;
0162     md.transient_results=NaN;
0163     md.thermaltransient_results=NaN;
0164     md.timestepping=0; %no adaptative time stepping by default.
0165     md.deltaH=10^-2; %meters
0166     md.DeltaH=50; %meters
0167     md.deltaT=10^-2; %K
0168     md.DeltaT=1; %K
0169     md.timeacc=2;
0170     md.timedec=.5;
0171 
0172 
0173     %Control
0174     md.control_type={'drag'};
0175     md.cont_vx=NaN;
0176     md.cont_vy=NaN;
0177     md.cont_vz=NaN;
0178     md.cont_vel=NaN;
0179     md.cont_parameters=NaN;
0180     md.cont_J=[];
0181     md.nsteps=0;
0182     md.maxiter=[];
0183     md.tolx=0;
0184     md.optscal=[];
0185     md.mincontrolconstraint=0;
0186     md.maxcontrolconstraint=2000;
0187     md.fit=[];
0188     md.epsvel=eps;
0189     md.meanvel=0;
0190     
0191     %Output parameters
0192     md.parameteroutput={};
0193     md.viscousheating=NaN;
0194     md.pressure_elem=NaN;
0195     md.stress=NaN;
0196     md.stress_surface=NaN;
0197     md.stress_bed=NaN;
0198     md.deviatoricstress=NaN;
0199     md.strainrate=NaN;
0200     md.plot=1;
0201     
0202     %debugging
0203     md.debug=1;
0204     md.element_debug=0;
0205     md.element_debugid=NaN;
0206 
0207     %Results fields
0208     md.vx=NaN;
0209     md.vy=NaN;
0210     md.vz=NaN;
0211     md.vel=NaN;
0212     md.temperature=NaN; %temperature solution vector
0213     md.melting=NaN;
0214     md.pressure=NaN;
0215 
0216     %Parallelisation parameters
0217     md.cluster='none';
0218     md.np=0;
0219     md.time=0;
0220     md.queue='';
0221     md.exclusive=0;
0222     md.scheduler_configuration='local';
0223     md.outlog=' ';
0224     md.errlog=' ';
0225     md.alloc_cleanup=1;
0226     md.waitonlock=0;
0227 
0228     %mesh2grid
0229     md.mesh2grid_parameters={'vel'};
0230     md.mesh2grid_interpolation={'node'};
0231     md.mesh2grid_filter={'average'};
0232     md.mesh2grid_cornereast=0;
0233     md.mesh2grid_cornernorth=0;
0234     md.mesh2grid_xposting=1000;
0235     md.mesh2grid_yposting=1000;
0236     md.mesh2grid_nlines=1000;
0237     md.mesh2grid_ncolumns=1000;
0238     md.mesh2grid_windowsize=1;
0239     md.mesh2grid_results=NaN;
0240     md.dummy=NaN;
0241 
0242     %mesh
0243     md.mesh_domainoutline='';
0244     md.mesh_riftoutline='';
0245     md.mesh_resolution=NaN;
0246 
0247     %Cielo parameters
0248     md.solverstring=' -mat_type aijmumps -ksp_type preonly -pc_type lu -mat_mumps_icntl_14 40 ';
0249     
0250     %Trash, still to organize
0251     md.analysis_type='';
0252 
0253     %management of large models
0254     md.repository='';
0255 
0256     %radar power images
0257     md.sarpwr=NaN;
0258     md.sarxm=NaN;
0259     md.sarym=NaN;
0260 
0261     %qmu
0262     md.variables=struct([]);
0263     md.responses=struct([]);
0264     md.dakotaresults=NaN;
0265     md.dakotain =NaN;
0266     md.dakotaout=NaN;
0267     md.dakotadat=NaN;
0268 %    md.method               ='sampling';
0269     md.seed                 =1234;
0270     md.samples              =10;
0271     md.sample_type          ='lhs';
0272     md.method               ='local reliability';
0273     md.interval_type        ='forward';
0274     md.fd_gradient_step_size= 0.01;
0275     md.evaluation_concurrency= 2;
0276     md.npart                 = 1;
0277 
0278     md.analysis_driver    ='';
0279     md.analysis_components='';
0280 
0281     %Solver options
0282     %ice
0283     md.solver_type='general';
0284     %output
0285     md=class(md,'model');
0286                 
0287 case 1
0288     %If single argument of class model, we have a copy constructor.
0289     if (isa(varargin{1},'model'))
0290         md = varargin{1};
0291     elseif (isa(varargin{1},'char'))
0292         %user gave us the name of the repository, this model is going to be large!
0293         md=model;
0294         md.repository=varargin{1};
0295         md=activaterepository(md);
0296     else
0297         error('model constructor error message: copy constructor called on a non ''model'' class object');
0298     end 
0299 otherwise
0300     error('model constructor error message: 0 of 1 argument only in input.');
0301 end

Generated on Sun 29-Mar-2009 20:22:55 by m2html © 2003