< Summary

Information
Class: Morpho25.Settings.FullForcing
Assembly: Morpho25
File(s): D:\a\Morpho\Morpho\project\Morpho\Morpho25\Settings\FullForcing.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 53
Coverable lines: 53
Total lines: 136
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
get_FileName()100%10%
get_LimitWind2500()100%10%
get_MaxWind2500()100%10%
get_MinFlowsteps()100%10%
get_ForceTemperature()100%10%
get_ForceWind()100%10%
get_ForceRelativeHumidity()100%10%
get_ForcePrecipitation()100%10%
get_ForceRadClouds()100%10%
.ctor(...)100%10%
get_Title()100%10%
get_Values()100%10%
get_Tags()100%10%
ToString()100%10%

File(s)

D:\a\Morpho\Morpho\project\Morpho\Morpho25\Settings\FullForcing.cs

#LineLine coverage
 1using Morpho25.IO;
 2using Morpho25.Management;
 3
 4
 5namespace Morpho25.Settings
 6{
 7    /// <summary>
 8    /// FullForcing class.
 9    /// </summary>
 10    public class FullForcing
 11    {
 12        /// <summary>
 13        /// File name of simulation file.
 14        /// </summary>
 015        public string FileName { get; }
 16
 17        public const string INTERPOLATION_METHOD = "linear";
 18        public const string NUDGING = "1";
 19        public const string NUNDGING_FACTOR = "1.00000";
 20        public const string Z_0 = "0.10000";
 21
 22        /// <summary>
 23        /// Limit of wind speed at 2500 meters.
 24        /// </summary>
 025        public double LimitWind2500 { get; set; }
 26        /// <summary>
 27        /// Max wind speed at 2500 meter.
 28        /// </summary>
 029        public double MaxWind2500 { get; set; }
 30
 31        /// <summary>
 32        /// Adjust the minimum interal for updating
 33        /// the Full Forcing inflow.
 34        /// </summary>
 035        public uint MinFlowsteps { get; set; }
 36
 37        /// <summary>
 38        /// Use temperature values of EPW as boundary condition.
 39        /// </summary>
 040        public Active ForceTemperature { get; set; }
 41
 42        /// <summary>
 43        /// Use wind speed and direction values of EPW
 44        /// as boundary condition.
 45        /// </summary>
 046        public Active ForceWind { get; set; }
 47
 48        /// <summary>
 49        /// Use relative humidity values
 50        /// of EPW as boundary condition.
 51        /// </summary>
 052        public Active ForceRelativeHumidity { get; set; }
 53
 54        /// <summary>
 55        /// Use precipitation values
 56        /// of EPW as boundary condition.
 57        /// </summary>
 058        public Active ForcePrecipitation { get; set; }
 59
 60        /// <summary>
 61        /// Use radiation and cloudiness
 62        /// values of EPW as boundary condition.
 63        /// </summary>
 064        public Active ForceRadClouds { get; set; }
 65
 66        /// <summary>
 67        /// Create a new FullForcing settings.
 68        /// Force boundary condition using EPW file.
 69        /// </summary>
 70        /// <param name="epw">EPW file to use.</param>
 71        /// <param name="workspace">Inx Workspace object of your current project.</param>
 072        public FullForcing(string epw, Workspace workspace)
 073        {
 074            FileName = FoxBatch.GetFoxFile(epw, workspace);
 075            LimitWind2500 = 0;
 076            MaxWind2500 = 999.00000;
 077            MinFlowsteps = 30;
 078            ForceTemperature = Active.YES;
 079            ForceWind = Active.YES;
 080            ForceRelativeHumidity = Active.YES;
 081            ForcePrecipitation = Active.NO;
 082            ForceRadClouds = Active.YES;
 083        }
 84
 85        /// <summary>
 86        /// Title of the XML section
 87        /// </summary>
 088        public string Title => "FullForcing";
 89
 90        /// <summary>
 91        /// Values of the XML section
 92        /// TODO: It will be updated soon
 93        /// </summary>
 094        public string[] Values => new[] {
 095            FileName,
 096            ((int)ForceTemperature).ToString(),
 097            ((int)ForceRelativeHumidity).ToString(),
 098            ((int)ForceWind).ToString(),
 099            ((int)ForcePrecipitation).ToString(),
 0100            ((int)ForceRadClouds).ToString(),
 0101            INTERPOLATION_METHOD,
 0102            NUDGING,
 0103            FullForcing.NUNDGING_FACTOR,
 0104            MinFlowsteps.ToString(),
 0105            LimitWind2500.ToString(),
 0106            MaxWind2500.ToString("n5"),
 0107            Z_0
 0108        };
 109
 110        /// <summary>
 111        /// Tags of the XML section
 112        /// </summary>
 0113        public string[] Tags => new[] {
 0114            "fileName",
 0115            "forceT",
 0116            "forceQ",
 0117            "forceWind",
 0118            "forcePrecip",
 0119            "forceRadClouds",
 0120            "interpolationMethod",
 0121            "nudging",
 0122            "nudgingFactor",
 0123            "minFlowsteps",
 0124            "limitWind2500",
 0125            "maxWind2500",
 0126            "z_0"
 0127        };
 128
 129        /// <summary>
 130        /// String representation of tthread object.
 131        /// </summary>
 132        /// <returns>String representation.</returns>
 0133        public override string ToString() => $"Config::FullForcing::{FileName}";
 134    }
 135
 136}