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

NREL / SolTrace / 18544749821

15 Oct 2025 10:47PM UTC coverage: 89.946% (+45.8%) from 44.166%
18544749821

push

github

web-flow
Restructured backend for SolTrace (#63)

* Initial API for refactored SolTrace

* Updates to various APIs; first pass at element/ray source container implementation

* Use existing matrix-vector code as backend for matrix and vector classes; start implementing APIs

* Created new test on power tower example file with 50000 rays. Changed CMake to use cpp 17.

* Added ground results csv to new folder in google-tests directory

* Removed register prefix from variables in mtrand.h. More errors to come.

* Removed lines in CMakeLists causing linux failure, fixed bug in power tower test

* Created parabola.stinput test and a test using powertower optimization on the powertower sample

* Commented out parabola test for now, added nonexistent branch to CI to see how it runs

* Fixed syntax error

* Changed tests based on PR feedback

* Fixed error in CMakeLists that caused failure on windows

* Removed output messages from st_sim_run_test

* Fixed silly mistake in previous commit

* Added comments and removed unused libraries

* Changed naming conventions of tests

* Added high flux solar furnace test changes, changed parabola test file name

* Fixed typo

* Move refactored data to its own directory; add to refactored classes to build

* Add missed files

* Add unit tests for basic linear algebra and container template

* More tests; Start implementation of composite element

* Add more unit tests on element

* Add missed headers

* Remove target from cmake build command in CI

* Initial virtual element implementation; smoke test for virtual element

* Correct aperture spelling; add tests for virtual elements

* Add some unit tests for simulation data

* Move to static library for simulation data (temporary); update cmake files to get correct mac architecture

* Attempt to fix coverage failure

* Attempt to capture inline functions in code coverage; add a few more explicit tests

* Fix build

* Separate storage of CompositeElement and SingleElement; update te... (continued)

4357 of 4844 new or added lines in 62 files covered. (89.95%)

4357 of 4844 relevant lines covered (89.95%)

8565975.82 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 "error_distributions.hpp"
14

15
namespace SolTrace::Data {
16

17
enum InteractionType
18
{
19
    REFLECTION,
20
    REFRACTION
21
};
22

23
struct OpticalProperties
24
{
25
    InteractionType my_type;
26
    DistributionType error_distribution_type;
27
    double transmitivity;
28
    double reflectivity;
29
    double slope_error;
30
    double specularity_error;
31
    double refraction_index_front;
32
    double refraction_index_back;
33

34
    OpticalProperties() : my_type(REFLECTION),
128✔
35
                          error_distribution_type(GAUSSIAN),
128✔
36
                          transmitivity(0.0),
128✔
37
                          reflectivity(0.0),
128✔
38
                          slope_error(0.0),
128✔
39
                          specularity_error(0.0),
128✔
40
                          refraction_index_front(0.0),
128✔
41
                          refraction_index_back(0.0)
128✔
42
    {
43
    }
128✔
44

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

61
    // TODO: What should the error settings be with the below?
62

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

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

106
} // namespace SolTrace::Data
107

108
#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