[26308] | 1 | class rotational {//{{{
|
---|
| 2 | /**
|
---|
| 3 | * ROTATIONAL class definition
|
---|
| 4 | *
|
---|
| 5 | * Usage:
|
---|
| 6 | * rotational = rotational();
|
---|
| 7 | */
|
---|
| 8 | constructor() {//{{{
|
---|
| 9 | this.equatorialmoi = 0;
|
---|
| 10 | this.polarmoi = 0;
|
---|
| 11 | this.angularvelocity = 0;
|
---|
| 12 |
|
---|
| 13 | let nargs = arguments.length;
|
---|
| 14 | if (nargs == 0) {
|
---|
| 15 | this.setdefaultparameters();
|
---|
| 16 | } else {
|
---|
| 17 | error('constructor not supported');
|
---|
| 18 | }
|
---|
| 19 | } //}}}
|
---|
| 20 |
|
---|
| 21 | disp() {//{{{
|
---|
| 22 | console.log('WARNING: rotational::disp is not yet implemented');
|
---|
| 23 | } //}}}
|
---|
| 24 |
|
---|
| 25 | setdefaultparameters() {//{{{
|
---|
| 26 | // Moment of inertia
|
---|
| 27 | this.equatorialmoi = 8.0077e37; // [kg m^2]
|
---|
| 28 | this.polarmoi = 8.0345e37; // [kg m^2]
|
---|
| 29 |
|
---|
| 30 | // Mean rotational velocity of earth
|
---|
| 31 | this.angularvelocity = 7.2921e-5; // [s^-1]
|
---|
| 32 | } //}}}
|
---|
| 33 |
|
---|
| 34 | checkconsistency(md, solution, analyses) {//{{{
|
---|
| 35 | if (!analyses.includes('SealevelchangeAnalysis') || (solution === 'TransientSolution' && !md.transient.isslc)) {
|
---|
| 36 | return md;
|
---|
| 37 | }
|
---|
| 38 |
|
---|
| 39 | md = checkfield(md, 'fieldname', 'solidearth.rotational.equatorialmoi', 'NaN', 1, 'Inf', 1);
|
---|
| 40 | md = checkfield(md, 'fieldname', 'solidearth.rotational.polarmoi', 'NaN', 1, 'Inf', 1);
|
---|
| 41 | md = checkfield(md, 'fieldname', 'solidearth.rotational.angularvelocity', 'NaN', 1, 'Inf', 1);
|
---|
| 42 |
|
---|
| 43 | return md;
|
---|
| 44 | } //}}}
|
---|
| 45 |
|
---|
| 46 | defaultoutputs(md) {//{{{
|
---|
| 47 | return [];
|
---|
| 48 | } //}}}
|
---|
| 49 |
|
---|
| 50 | marshall(md, prefix, fid) {//{{{
|
---|
| 51 | WriteData(fid, prefix, 'object', this, 'fieldname', 'equatorialmoi', 'name', 'md.solidearth.rotational.equatorialmoi', 'format', 'Double');
|
---|
| 52 | WriteData(fid, prefix, 'object', this, 'fieldname', 'polarmoi', 'name', 'md.solidearth.rotational.polarmoi', 'format', 'Double');
|
---|
| 53 | WriteData(fid, prefix, 'object', this, 'fieldname', 'angularvelocity', 'name', 'md.solidearth.rotational.angularvelocity', 'format', 'Double');
|
---|
| 54 | } //}}}
|
---|
| 55 |
|
---|
| 56 | extrude(md) {//{{{
|
---|
| 57 | } //}}}
|
---|
| 58 | } //}}}
|
---|