Skip to content

Element groups - #139

Open
nickmedwards wants to merge 103 commits into
NLR-SolTrace:developfrom
nickmedwards:element_groups
Open

Element groups#139
nickmedwards wants to merge 103 commits into
NLR-SolTrace:developfrom
nickmedwards:element_groups

Conversation

@nickmedwards

@nickmedwards nickmedwards commented May 13, 2026

Copy link
Copy Markdown
  1. added --level and --verbose to simdriver\main.cpp. for main, --level changes the file printing behavior. i haven't actually implemented --verbose yet
  2. added group to elements to programmatically track groups of elements. i tried to make this backwards compatible, so simulations without groups wouldn't need to be changed. currently groups must be added through the JSON file. elements are given a group by the "group" key. groups must be non-negative integers.
  3. default group for single elements is -1 (ie ungrouped) set in single_element.cpp, composite/stage/etc elements are given -2 because they don't interact with the trace
  4. created struct SolTrace::Result::GroupResult to hold the counts for a given group. right now it just has basic counts (ie absorbs/reflects), but i will write a function for comparing GroupResult structs to get stuff like efficiencies.
  5. added a vector of GroupResults to SimulationResult and created SimulationResult::write_group_json_file to write those structs to a json file
  6. i think that it would be potentially useful to used group information in the trace itself, so i added the groups to OptixRunner. haven't added groups to the other runners, yet.
  7. added enum SolTrace::Runner::RunnerStatistics to toggle between different reporting behavior, ie does runner.report_simulation(&result, level) return the ray record data, the group results, or both?
  8. created some tests to cover my bases, all are in \unit-tests, added some json files for testing file io behavior

@nickmedwards
nickmedwards marked this pull request as ready for review May 13, 2026 15:05

@jmaack24 jmaack24 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this feature. I think forcing a group to be an interval of element ids is too rigid though. It would make grouping difficult to use in a python script and nearly impossible to use with the GUI.

There is also no implementation done for the NativeRunner or EmbreeRunner. At a minimum, there should be some sort of error printed or thrown for those two runners that say this feature has not been implemented. From the user survey results, I expect these are going to be the most commonly used runners by users.

Comment thread .vscode/settings.json Outdated
Comment thread coretrace/simulation_data/composite_element.hpp Outdated
Comment thread coretrace/simulation_data/element.cpp Outdated
Comment thread coretrace/simulation_data/element.cpp Outdated
Comment thread coretrace/simulation_data/element.hpp Outdated
Comment thread coretrace/simulation_runner/optix_runner/OptixCSP/src/core/soltrace_system.cpp Outdated
Comment thread google-tests/unit-tests/simulation_results/CMakeLists.txt Outdated
Comment thread google-tests/unit-tests/simulation_results/grouped_results_test.cpp Outdated
Comment thread google-tests/unit-tests/simulation_results/grouped_results_test.cpp Outdated
Comment thread google-tests/unit-tests/simulation_runner/optix_runner/two_plate_test.cpp Outdated
@taylorbrown75

taylorbrown75 commented May 13, 2026

Copy link
Copy Markdown
Collaborator

Should we change the JSON schema with this pull request? That process is not defined, but it seems like adding json variables would be a good time to increment it. @jmaack24

@jmaack24

Copy link
Copy Markdown
Collaborator

Should we change the JSON schema with this pull request? That process is not defined, but it seems like adding json variables would be a good time to increment it. @jmaack24

We probably should come up with a process for changing the JSON schema or some sort of versioning for it. What were you thinking of adding?

@taylorbrown75

Copy link
Copy Markdown
Collaborator

Should we change the JSON schema with this pull request? That process is not defined, but it seems like adding json variables would be a good time to increment it. @jmaack24

We probably should come up with a process for changing the JSON schema or some sort of versioning for it. What were you thinking of adding?

I don't have a plan in mind. I'll add a note so we remember to discuss it at the next meeting.

@nickmedwards nickmedwards left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@taylorbrown75 Here is what I got going for friend access for a test. I didn't want to use the FRIEND_TEST marco because it involved changing the CMakeLists.txt to build non-test builds with gtest, and I didn't want to get into all that.

@nickmedwards
nickmedwards force-pushed the element_groups branch 2 times, most recently from 6995024 to a875bcf Compare June 29, 2026 20:23

@jmaack24 jmaack24 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Fix the failing CI tests and then it should be ready to merge.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes don't seem to be needed.

nicholasbl and others added 15 commits August 13, 2026 09:05
* Source cleanups

* Clean up load

* Fixes NLR-SolTrace#155

Added massive flux mapping improvements. Yay!

* Source cleanup and documentation

* Binding licenses (#213)

* Initial

* Renames

* Bindings refactor

* Build in licenses to the UI

* Reduce ambiguity on the ray stats

* Fit all in view

* Some instance editor improvements

Fix rotation gimbal lock

* Fix the busted cmake for linux

* Comment pass

---------

Co-authored-by: RiannaSantivong <107436905+RiannaSantivong@users.noreply.github.com>
* Update High Flux Solar Furnace.stinput

* added power tower with tower files

---------

Co-authored-by: Hartlaub <chartlau@nrel.gov>
…ar Furnace (NLR-SolTrace#169)

* Initial plan

* Add spherical surface support to GPU (OptiX) runner for HFSF file

- Add SPHERICAL surface type to OptixCSP SurfaceType enum
- Add SurfaceSpherical class to OptixCSP Surface.h
- Add spherical geometry data structs to GeometryDataST.h for all 6 aperture types
- Add HEXAGON_SPHERICAL and other spherical variants to OpticalEntityType enum
- Add spherical ray-intersection helpers and kernels to intersection.cu
- Update geometry_manager.cpp to handle SPHERICAL surface type
- Update CspElement.cpp to convert spherical elements to GPU geometry data
- Update pipeline_manager.cpp to register new spherical intersection programs
- Map SurfaceType::SPHERE to OptixCSP::SPHERICAL in optix_runner.cpp
- Add GPU regression test for High Flux Solar Furnace file

* Remove unused variables in rectangle_spherical intersection shader

* Add validation of surface and aperture data fields

* Changes to OptixRunner sphere implementation

* Add basic spherical intersection tests for optix runner; refactor tests to use common code

* Test fixes

* Fix test and tighten tolerance; address copilot comments

* Relax test tolerance

* Move test to relative error test

* Return to 10 percent tolerance

* Rename parabola_ray_to_local function

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Jonathan Maack <jonathan.maack@nrel.gov>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants