• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

NREL / SolTrace / 19040526713

03 Nov 2025 03:50PM UTC coverage: 90.052% (+0.4%) from 89.643%
19040526713

push

github

web-flow
Merge pull request #77 from NREL/74-fix-parabola-intersection-missed-case

74 fix parabola intersection missed case

959 of 994 new or added lines in 28 files covered. (96.48%)

2 existing lines in 1 file now uncovered.

4508 of 5006 relevant lines covered (90.05%)

10596530.27 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

70.59
/coretrace/simulation_data/optical_properties.hpp
1
/**
2
 * @file optical_properties.hpp
3
 * @brief Optical properties definitions for materials
4
 *
5
 * Defines optical properties (reflectivity, transmissivity, refractive index)
6
 * and interaction types for optical surfaces and materials. Includes error
7
 * distribution parameters for modeling surface imperfections and optical errors.
8
 */
9

10
#ifndef SOLTRACE_OPTICAL_PROPERTIES_H
11
#define SOLTRACE_OPTICAL_PROPERTIES_H
12

13
#include <iostream>
14

15
#include "error_distributions.hpp"
16

17
namespace SolTrace::Data
18
{
19

20
    enum class InteractionType
21
    {
22
        REFLECTION,
23
        REFRACTION
24
    };
25

26
    struct OpticalProperties
27
    {
28
        InteractionType my_type;
29
        DistributionType error_distribution_type;
30
        double transmitivity;
31
        double reflectivity;
32
        double slope_error;
33
        double specularity_error;
34
        double refraction_index_front;
35
        double refraction_index_back;
36

37
        OpticalProperties() : my_type(InteractionType::REFLECTION),
192✔
38
                              error_distribution_type(DistributionType::GAUSSIAN),
192✔
39
                              transmitivity(0.0),
192✔
40
                              reflectivity(0.0),
192✔
41
                              slope_error(0.0),
192✔
42
                              specularity_error(0.0),
192✔
43
                              refraction_index_front(0.0),
192✔
44
                              refraction_index_back(0.0)
192✔
45
        {
46
        }
192✔
47

48
        OpticalProperties(InteractionType itype,
8✔
49
                          DistributionType dtype,
50
                          double trans, double refl,
51
                          double slope_err, double spec_err,
52
                          double ri_front, double ri_back)
53
            : my_type(itype),
8✔
54
              error_distribution_type(dtype),
8✔
55
              transmitivity(trans),
8✔
56
              reflectivity(refl),
8✔
57
              slope_error(slope_err),
8✔
58
              specularity_error(spec_err),
8✔
59
              refraction_index_front(ri_front),
8✔
60
              refraction_index_back(ri_back)
8✔
61
        {
62
        }
8✔
63

64
        // TODO: What should the error settings be with the below?
65

66
        void set_ideal_absorption()
184✔
67
        {
68
            this->my_type = InteractionType::REFLECTION;
184✔
69
            this->transmitivity = 0.0;
184✔
70
            this->reflectivity = 0.0;
184✔
71
            return;
184✔
72
        }
NEW
73
        void set_ideal_reflection()
×
74
        {
NEW
75
            this->my_type = InteractionType::REFLECTION;
×
NEW
76
            this->transmitivity = 0.0;
×
NEW
77
            this->reflectivity = 1.0;
×
NEW
78
            return;
×
79
        }
NEW
80
        void set_ideal_transmission()
×
81
        {
NEW
82
            this->my_type = InteractionType::REFRACTION;
×
NEW
83
            this->transmitivity = 1.0;
×
NEW
84
            this->reflectivity = 0.0;
×
NEW
85
            return;
×
86
        }
87
        void set_ideal_transmission(double refraction_index_front,
88
                                    double refraction_index_back)
89
        {
90
            this->set_ideal_transmission();
91
            this->refraction_index_front = refraction_index_front;
92
            this->refraction_index_back = refraction_index_back;
93
            return;
94
        }
95

96
        // OpticalProperties &operator=(const OpticalProperties &rhs)
97
        // {
98
        //     this->my_type = rhs.my_type;
99
        //     this->transmitivity = rhs.transmitivity;
100
        //     this->reflectivity = rhs.reflectivity;
101
        //     this->slope_error = rhs.slope_error;
102
        //     this->specularity_error = rhs.specularity_error;
103
        //     this->refraction_index_front = rhs.refraction_index_front;
104
        //     this->refraction_index_back = rhs.refraction_index_back;
105
        //     return *this;
106
        // }
107

108
        friend std::ostream &operator<<(std::ostream &os,
109
                                        const OpticalProperties &op);
110
    };
111

112
} // namespace SolTrace::Data
113

114
#endif
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc