| | 1 | | namespace Morpho25.Settings |
| | 2 | | { |
| | 3 | | /// <summary> |
| | 4 | | /// Timesteps class. |
| | 5 | | /// </summary> |
| | 6 | | public class TimeSteps : Configuration |
| | 7 | | { |
| | 8 | | private double _sunheightStep01; |
| | 9 | | private double _sunheightStep02; |
| | 10 | | private double _dtStep00; |
| | 11 | | private double _dtStep01; |
| | 12 | | private double _dtStep02; |
| | 13 | | /// <summary> |
| | 14 | | /// Sun height for switching dt(0). From 0 deg to 40.00. |
| | 15 | | /// </summary> |
| | 16 | | public double SunheightStep01 { |
| 6 | 17 | | get { return _sunheightStep01; } |
| | 18 | | set |
| 2 | 19 | | { |
| 2 | 20 | | ItIsPositive(value); |
| 2 | 21 | | _sunheightStep01 = value; |
| 2 | 22 | | } |
| | 23 | | } |
| | 24 | | /// <summary> |
| | 25 | | /// Sun height for switching dt(1). From 40.00 deg to 50.00 deg. |
| | 26 | | /// </summary> |
| | 27 | | public double SunheightStep02 |
| | 28 | | { |
| 6 | 29 | | get { return _sunheightStep02; } |
| | 30 | | set |
| 4 | 31 | | { |
| 4 | 32 | | ItIsPositive(value); |
| 3 | 33 | | _sunheightStep02 = value; |
| 3 | 34 | | } |
| | 35 | | } |
| | 36 | | /// <summary> |
| | 37 | | /// Time step (s) for interval 1 dt(0). |
| | 38 | | /// </summary> |
| | 39 | | public double DtStep00 |
| | 40 | | { |
| 3 | 41 | | get { return _dtStep00; } |
| | 42 | | set |
| 2 | 43 | | { |
| 2 | 44 | | ItIsPositive(value); |
| 2 | 45 | | _dtStep00 = value; |
| 2 | 46 | | } |
| | 47 | | } |
| | 48 | | /// <summary> |
| | 49 | | /// Time step (s) for interval 1 dt(1). |
| | 50 | | /// </summary> |
| | 51 | | public double DtStep01 |
| | 52 | | { |
| 3 | 53 | | get { return _dtStep01; } |
| | 54 | | set |
| 2 | 55 | | { |
| 2 | 56 | | ItIsPositive(value); |
| 2 | 57 | | _dtStep01 = value; |
| 2 | 58 | | } |
| | 59 | | } |
| | 60 | | /// <summary> |
| | 61 | | /// Time step (s) for interval 1 dt(2). |
| | 62 | | /// </summary> |
| | 63 | | public double DtStep02 |
| | 64 | | { |
| 3 | 65 | | get { return _dtStep02; } |
| | 66 | | set |
| 2 | 67 | | { |
| 2 | 68 | | ItIsPositive(value); |
| 2 | 69 | | _dtStep02 = value; |
| 2 | 70 | | } |
| | 71 | | } |
| | 72 | | /// <summary> |
| | 73 | | /// Create time step settings. |
| | 74 | | /// </summary> |
| 2 | 75 | | public TimeSteps() |
| 2 | 76 | | { |
| 2 | 77 | | SunheightStep01 = 40.00000; |
| 2 | 78 | | SunheightStep02 = 50.00000; |
| 2 | 79 | | DtStep00 = 2.00000; |
| 2 | 80 | | DtStep01 = 2.00000; |
| 2 | 81 | | DtStep02 = 1.00000; |
| 2 | 82 | | } |
| | 83 | |
|
| | 84 | | /// <summary> |
| | 85 | | /// Title of the XML section |
| | 86 | | /// </summary> |
| 1 | 87 | | public string Title => "TimeSteps"; |
| | 88 | |
|
| | 89 | | /// <summary> |
| | 90 | | /// Values of the XML section |
| | 91 | | /// </summary> |
| 1 | 92 | | public string[] Values => new[] { |
| 1 | 93 | | SunheightStep01.ToString("n5"), |
| 1 | 94 | | SunheightStep02.ToString("n5"), |
| 1 | 95 | | DtStep00.ToString("n5"), |
| 1 | 96 | | DtStep01.ToString("n5"), |
| 1 | 97 | | DtStep02.ToString("n5") |
| 1 | 98 | | }; |
| | 99 | |
|
| | 100 | | /// <summary> |
| | 101 | | /// Tags of the XML section |
| | 102 | | /// </summary> |
| 1 | 103 | | public string[] Tags => new[] { |
| 1 | 104 | | "sunheight_step01", |
| 1 | 105 | | "sunheight_step02", |
| 1 | 106 | | "dt_step00", |
| 1 | 107 | | "dt_step01", |
| 1 | 108 | | "dt_step02" |
| 1 | 109 | | }; |
| | 110 | |
|
| | 111 | | /// <summary> |
| | 112 | | /// String representation of TimeSteps object. |
| | 113 | | /// </summary> |
| | 114 | | /// <returns>String representation.</returns> |
| 0 | 115 | | public override string ToString() => "Config::TimeSteps"; |
| | 116 | | } |
| | 117 | |
|
| | 118 | | } |