./
Coverage:
low: ≥ 0%
medium: ≥ 75.0%
high: ≥ 90.0%
Lines:
3 / 3
100.0%
Branches:
2 / 5
40.0%
Functions:
1 / 1, 1 excl
100.0%

include/terraingen/layers/craters/profiles/fassett_thomson.h
Line Branch Exec Source
1 // SPDX-License-Identifier: BSD-3-Clause
2
3 /// @file
4 /// @brief The fresh simple-crater profile of Fassett and Thomson (2014) and its rim variants.
5 #pragma once
6
7 #include "terraingen/layers/craters/profiles/profile.h"
8
9 namespace terraingen {
10
11 /// How a `FassettThomsonProfile` joins its interior and exterior fits at the rim.
12 enum class FassettThomsonRim {
13 Original, ///< The published fits, which meet within 1e-5 D at 0.98 radii.
14 AtOneRadius, ///< Interior extended to 1.0 radii (synthterrain `FT_Crater`); 0.0076 D step.
15 /// Fassett et al. (2022) Table 3 (synthterrain `FTmod_Crater`): flat at the fresh rim height
16 /// from 0.98 to 1.02 radii.
17 Plateau,
18 };
19
20 /// Fresh simple-crater profile of Fassett and Thomson (2014, eq. 4), cubic fits in r / R reaching
21 /// 1.5 radii; the floor follows the current depth but the rim keeps its fitted height.
22
2/5
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
784 class FassettThomsonProfile final : public CraterProfile {
23 public:
24 /// @param rim How the interior and exterior fits are joined at the rim.
25 explicit FassettThomsonProfile(FassettThomsonRim rim = FassettThomsonRim::Original);
26
27 /// Reads the fresh rim height and current depth of `state`; `FassettThomsonShape` in single
28 /// precision.
29 double Height(double distance, double diameter, const CraterState& state) const override;
30
31 519575 double ReachRadii() const override {
32 519575 return 1.5;
33 }
34
35 /// The profile as the crater kernel evaluates it.
36 const CraterProfileKernel& Kernel() const {
37 return m_kernel;
38 }
39
40 private:
41 CraterProfileKernel m_kernel;
42 };
43
44 } // namespace terraingen
45