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

NREL / SolTrace / 18757590279

23 Oct 2025 06:04PM UTC coverage: 88.943% (-1.0%) from 89.946%
18757590279

Pull #75

github

web-flow
Merge 1c15e794a into f6f121007
Pull Request #75: New sun models

72 of 133 new or added lines in 8 files covered. (54.14%)

5 existing lines in 2 files now uncovered.

4384 of 4929 relevant lines covered (88.94%)

8585596.28 hits per line

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

57.14
/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 "vector3d.hpp"
20

21
namespace SolTrace::Data {
22

23
enum class SunShape
24
{
25
    GAUSSIAN,
26
    PILLBOX,
27
    LIMBDARKENED,
28
    BUIE_CSR,
29
    USER_DEFINED
30
};
31

32
class RaySource
33
{
34
public:
35
    RaySource() {}
×
36
    virtual ~RaySource() {}
×
37

38
    virtual const Vector3d &get_position() const = 0;
39
    virtual Vector3d &get_position() = 0;
40
    virtual void set_position(const Vector3d &) = 0;
41
    virtual void set_position(double, double, double) = 0;
42
    virtual void set_position(const DateTime &, double lat, double long) = 0;
43
    virtual SunShape get_shape() const = 0;
44
    virtual void set_shape(SunShape shape, double _sigma, double _half_width, double _csr,
45
        std::vector<double> _user_angle = {}, std::vector<double> _user_intensity = {}) = 0;
46

47
    double get_sigma()
6✔
48
    {
49
        return this->sigma;
6✔
50
    }
51
    double get_half_width()
12✔
52
    {
53
        return this->half_width;
12✔
54
    }
NEW
55
    double get_circumsolar_ratio()
×
56
    {
NEW
57
        return this->circumsolar_ratio;
×
58
    }
59
    void get_user_data(std::vector<double> &angle, std::vector<double> &intensity)
2✔
60
    {
61
        angle = this->user_angle;
2✔
62
        intensity = this->user_intensity;
2✔
63
        return;
2✔
64
    }
65

66
protected:
67
    double sigma = std::numeric_limits<double>::quiet_NaN();
68
    double half_width = std::numeric_limits<double>::quiet_NaN();
69
    double circumsolar_ratio = std::numeric_limits<double>::quiet_NaN();
70
    std::vector<double> user_angle;
71
    std::vector<double> user_intensity;
72
};
73

74
using ray_source_id = std::int_fast64_t;
75
// using ray_source_ptr = typename std::shared_ptr<RaySource>;
76
// using RaySourceContainer = typename std::map<ray_source_id, ray_source_ptr>;
77
using RaySourceContainer = Container<ray_source_id, RaySource>;
78
using ray_source_ptr = RaySourceContainer::value_pointer;
79

80
template<typename C, typename... Args>
81
inline auto make_ray_source(Args&&... args)
×
82
{
83
    return RaySourceContainer::make_pointer<C>(std::forward<Args>(args)...);
×
84
}
85

86
} // namespace SolTrace::Data
87

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