1 | %PROGNOSTIC class definition
|
---|
2 | %
|
---|
3 | % Usage:
|
---|
4 | % prognostic=prognostic();
|
---|
5 |
|
---|
6 | classdef prognostic
|
---|
7 | 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');
|
---|
13 | requested_outputs = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',3);
|
---|
14 | end
|
---|
15 | methods
|
---|
16 | function obj = prognostic(varargin) % {{{
|
---|
17 | switch nargin
|
---|
18 | case 0
|
---|
19 | obj=setdefaultparameters(obj);
|
---|
20 | case 1
|
---|
21 | in=varargin{1};
|
---|
22 | if (isa(in,'numeric') & in==0),
|
---|
23 | % requesting templates do nothing
|
---|
24 | else
|
---|
25 | error('constructor not supported');
|
---|
26 | end
|
---|
27 | otherwise
|
---|
28 | error('constructor not supported');
|
---|
29 | end
|
---|
30 | end % }}}
|
---|
31 | function obj = setdefaultparameters(obj) % {{{
|
---|
32 |
|
---|
33 | %first, use the defaults provided by the properties definition above.
|
---|
34 | fieldnames=fields(obj);
|
---|
35 | for i=1:length(fieldnames),
|
---|
36 | fieldname=fieldnames{i};
|
---|
37 | obj.(fieldname)=obj.(fieldname).default;
|
---|
38 | end
|
---|
39 |
|
---|
40 | %Type of stabilization to use 0:nothing 1:artificial_diffusivity 3:Discontinuous Galerkin
|
---|
41 | obj.stabilization=1;
|
---|
42 |
|
---|
43 | %Factor applied to compute the penalties kappa=max(stiffness matrix)*10^penalty_factor
|
---|
44 | obj.penalty_factor=3;
|
---|
45 |
|
---|
46 | %Hydrostatic adjustment
|
---|
47 | obj.hydrostatic_adjustment='Absolute';
|
---|
48 | end % }}}
|
---|
49 | function disp(obj) % {{{
|
---|
50 | disp(sprintf(' Prognostic solution parameters:'));
|
---|
51 |
|
---|
52 | disp(sprintf('\n transient:'));
|
---|
53 | fielddisplay(obj,'stabilization','0->no, 1->artificial_diffusivity, 3->discontinuous Galerkin');
|
---|
54 |
|
---|
55 | disp(sprintf('\n boundary conditions:'));
|
---|
56 | fielddisplay(obj,'spcthickness','thickness constraints (NaN means no constraint)');
|
---|
57 |
|
---|
58 | end % }}}
|
---|
59 | end
|
---|
60 | end
|
---|