• 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

66.67
/coretrace/simulation_data/ray_source.hpp
1
/**
2
 * @file ray_source.hpp
3
 * @brief Ray source definitions and solar models
4
 *
5
 * Defines ray source properties including sun shape models,
6
 * solar disk properties, and ray generation parameters. Provides
7
 * base classes for different types of ray sources used in
8
 * concentrated solar power simulations.
9
 */
10

11
#ifndef SOLTRACE_RAY_SOURCE_H
12
#define SOLTRACE_RAY_SOURCE_H
13

14
#include <limits>
15
#include <map>
16

17
#include "container.hpp"
18
#include "datetime.hpp"
19
#include "error_distributions.hpp"
20
#include "vector3d.hpp"
21

22
namespace SolTrace::Data {
23

24
class RaySource
25
{
26
public:
NEW
27
    RaySource() {}
×
NEW
28
    virtual ~RaySource() {}
×
29

30
    virtual const Vector3d &get_position() const = 0;
31
    virtual Vector3d &get_position() = 0;
32
    virtual void set_position(const Vector3d &) = 0;
33
    virtual void set_position(double, double, double) = 0;
34
    virtual void set_position(const DateTime &, double lat, double long) = 0;
35
    virtual DistributionType get_shape() const = 0;
36
    virtual void set_shape(DistributionType shape, double _sigma, double _half_width,
37
        std::vector<double> _user_angle = {}, std::vector<double> _user_intensity = {}) = 0;
38

39
    double get_sigma()
6✔
40
    {
41
        return this->sigma;
6✔
42
    }
43
    double get_half_width()
12✔
44
    {
45
        return this->half_width;
12✔
46
    }
47
    void get_user_data(std::vector<double> &angle, std::vector<double> &intensity)
1✔
48
    {
49
        angle = this->user_angle;
1✔
50
        intensity = this->user_intensity;
1✔
51
        return;
1✔
52
    }
53

54
protected:
55
    double sigma = std::numeric_limits<double>::quiet_NaN();
56
    double half_width = std::numeric_limits<double>::quiet_NaN();
57
    std::vector<double> user_angle;
58
    std::vector<double> user_intensity;
59
};
60

61
using ray_source_id = std::int_fast64_t;
62
// using ray_source_ptr = typename std::shared_ptr<RaySource>;
63
// using RaySourceContainer = typename std::map<ray_source_id, ray_source_ptr>;
64
using RaySourceContainer = Container<ray_source_id, RaySource>;
65
using ray_source_ptr = RaySourceContainer::value_pointer;
66

67
template<typename C, typename... Args>
NEW
68
inline auto make_ray_source(Args&&... args)
×
69
{
NEW
70
    return RaySourceContainer::make_pointer<C>(std::forward<Args>(args)...);
×
71
}
72

73
} // namespace SolTrace::Data
74

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