1 | %PLANET class definition
|
---|
2 | %
|
---|
3 | % Usage:
|
---|
4 | % md = planet(varargin)
|
---|
5 |
|
---|
6 | classdef planet < model
|
---|
7 | properties (SetAccess=public) %Planet fields
|
---|
8 | % {{{1
|
---|
9 | %Planet specific fields
|
---|
10 | r=NaN;
|
---|
11 | theta=NaN;
|
---|
12 | phi=NaN;
|
---|
13 | %}}}
|
---|
14 | end
|
---|
15 | methods
|
---|
16 | function md=planetmesh(md,varargin) % {{{1
|
---|
17 | %PLANETMESH: build 2d shell mesh
|
---|
18 | %
|
---|
19 | % Usage: md=planetmesh(md,'method','mixed','radius',6378000,'angleresol',1);
|
---|
20 | % md=planetmesh(md,'method','tria','shape','iso','radius',6378000,'refinement',5);
|
---|
21 | %
|
---|
22 |
|
---|
23 | %recover options
|
---|
24 | options=pairoptions(varargin{:});
|
---|
25 |
|
---|
26 | method=getfieldvalue(options,'method','mixed');
|
---|
27 |
|
---|
28 | if strcmpi(method,'mixed'),
|
---|
29 | %recover radius and angleresol:
|
---|
30 | radius=getfieldvalue(options,'radius',6378000); %earth radius as default
|
---|
31 | angleresol=getfieldvalue(options,'angleresol',10); %10 degree resolution
|
---|
32 |
|
---|
33 | %call mixed mesh
|
---|
34 | md=planetmixedmesh(md,radius,angleresol);
|
---|
35 | else
|
---|
36 | %recover radius, shape and level of refinmenet
|
---|
37 | radius=getfieldvalue(options,'radius',6378000); %earth radius as default
|
---|
38 | refinement=getfieldvalue(options,'refinement',5); %refine 5 times
|
---|
39 | shape=getfieldvalue(options,'shape','ico');
|
---|
40 |
|
---|
41 | %call triangular mesh
|
---|
42 | md=planettrimesh(md,shape,radius,refinement);
|
---|
43 | end
|
---|
44 |
|
---|
45 | end
|
---|
46 | % }}}
|
---|
47 | end
|
---|
48 | end
|
---|