76 const auto d = 1 + exp(-(
b1 * mc_pct + ConstantPart));
111static constexpr Duff SphagnumUpper{12.4, 21.8, -8.8306, -0.0608, 0.8095, 0.2735};
119static constexpr Duff FeatherMoss{18.1, 42.7, 9.0970, -0.1040, 0.1165, -0.0646};
123static constexpr Duff Reindeer{26.1, 56.3, 8.0359, -0.0393, -0.0591, -0.0340};
135static constexpr Duff WhiteSpruce{35.9, 122.0, 332.5604, -1.2220, -2.1024, -1.2619};
139static constexpr Duff Peat{9.4, 222.0, -19.8198, -0.1169, 1.0414, 0.0782};
143static constexpr Duff PeatMuck{34.9, 203.0, 37.2276, -0.1876, -0.2833, -0.0951};
151static constexpr Duff PineSeney{36.5, 190.0, 45.1778, -0.3227, -0.3644, -0.0362};
155static constexpr Duff SprucePine{30.7, 116.0, 58.6921, -0.2737, -0.5413, -0.1246};
175template <
class TypeA,
class TypeB>
180 const logging::level log_level = logging::level::info
183 static constexpr int RESOLUTION = 10000;
184 static constexpr MathSize RANGE = 250.0;
186 static constexpr auto EPSILON =
static_cast<MathSize
>(1e-1);
187 std::ignore = logging::output(log_level,
"Checking {:s}", name);
188 logging::check_equal_verbose(logging::level::debug, a.ash, b.ash,
"ash");
189 logging::check_equal_verbose(logging::level::debug, a.rho, b.rho,
"rho");
190 logging::check_equal_verbose(logging::level::debug, a.b0, b.b0,
"b0");
191 logging::check_equal_verbose(logging::level::debug, a.b1, b.b1,
"b1");
192 logging::check_equal_verbose(logging::level::debug, a.b2, b.b2,
"b2");
193 logging::check_equal_verbose(logging::level::debug, a.b3, b.b3,
"b3");
194 for (
auto i = 0; i < RESOLUTION; ++i)
196 const MathSize mc = RANGE * i / RESOLUTION;
197 const auto msg = std::format(
"probability of survival (mc = {})", mc);
198 logging::check_tolerance(
199 EPSILON, a.probabilityOfSurvival(mc), b.probabilityOfSurvival(mc), msg.c_str()
206int test_duff(
const int argc,
const char*
const argv[]);
A specific type of Duff layer, and the associated smouldering coefficients.
Definition Duff.h:40
constexpr bool operator!=(const Duff &rhs) const
Inequality operator.
Definition Duff.h:98
MathSize rho
Organic bulk density (kg/m^3)
Definition Duff.h:48
MathSize ash
Inorganic content, percentage oven dry weight.
Definition Duff.h:44
ThresholdSize probabilityOfSurvival(const MathSize mc_pct) const noexcept
Probability of survival (% / 100) [eq Ig-1].
Definition Duff.h:70
MathSize b2
B_2 [table 2].
Definition Duff.h:60
MathSize b3
B_3 [table 2].
Definition Duff.h:64
MathSize b1
B_1 [table 2].
Definition Duff.h:56
constexpr bool operator==(const Duff &rhs) const
Equality operator.
Definition Duff.h:88
MathSize b0
B_0 [table 2].
Definition Duff.h:52