• 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

82.14
/coretrace/simulation_runner/native_runner/calculator_factory.cpp
1

2
#include "calculator_factory.hpp"
3

4
#include "cylinder_calculator.hpp"
5
#include "flat_calculator.hpp"
6
#include "native_runner_types.hpp"
7
#include "newton_calculator.hpp"
8
#include "parabola_calculator.hpp"
9
#include "sphere_calculator.hpp"
10
#include "simulation_data_export.hpp"
11
#include "surface.hpp"
12

13
#include <stdexcept>
14
#include <sstream>
15

16
namespace SolTrace::NativeRunner {
17

18
CalculatorFactory *CalculatorFactory::instance = nullptr;
19

20
calculator_ptr CalculatorFactory::make_calculator(
8,363✔
21
    aperture_ptr ap,
22
    surface_ptr surf,
23
    const ElementParameters &eparams)
24
{
25
    // Input validation
26
    if (surf == nullptr)
8,363✔
27
    {
28
        throw std::invalid_argument(
29
            "CalculatorFactory::make_calculator: Surface pointer cannot be null");
2✔
30
    }
31

32
    if (ap == nullptr)
8,361✔
33
    {
34
        throw std::invalid_argument(
35
            "CalculatorFactory::make_calculator: Aperture pointer cannot be null");
2✔
36
    }
37

38
    SurfaceType st = surf->get_type();
8,359✔
39
    calculator_ptr calc = nullptr;
8,359✔
40

41
    if (st == SurfaceType::PARABOLA)
8,359✔
42
    {
43
        calc = std::make_shared<ParabolaCalculator>(surf);
6,333✔
44
    }
45
    else if (st == SurfaceType::FLAT)
2,026✔
46
    {
47
        calc = std::make_shared<FlatCalculator>(surf);
1,981✔
48
    }
49
    else if (st == SurfaceType::CYLINDER)
45✔
50
    {
51
        calc = std::make_shared<CylinderCalculator>(surf, ap);
14✔
52
    }
53
    else if (st == SurfaceType::SPHERE)
31✔
54
    {
55
        calc = std::make_shared<SphereCalculator>(surf);
29✔
56
    }
57
    else
58
    {
59
        std::stringstream ss;
2✔
60
        ss << "CalculatorFactory::make_calculator: Unsupported surface type: "
2✔
61
           << static_cast<int>(st);
2✔
62
        throw std::invalid_argument(ss.str());
2✔
63
    }
2✔
64

65
    // This should never happen but just in case...
66
    if (calc == nullptr)
8,357✔
67
    {
NEW
68
        std::stringstream ss;
×
NEW
69
        ss << "CalculatorFactory::make_calculator: Failed to create calculator for surface type "
×
NEW
70
           << static_cast<int>(st);
×
NEW
71
        throw std::runtime_error(ss.str());
×
NEW
72
    }
×
73

74
    return calc;
8,357✔
75
}
2✔
76

77
} // namespace SolTrace::NativeRunner
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