Introduce indexed ray transfer APIs and tests#503
Open
munechika-koyo wants to merge 5 commits into
Open
Conversation
… cleaning imports
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces a general index-function-based ray transfer API by adding indexed emitter and integrator classes, replacing mesh-specific naming with functionality-based naming.
Key Changes
Unit Test
test_evaluate_functionIndexedRayTransferEmitterworks correctly withNumericalIntegratorand maps contributions to the correct bins viaindex_function.bins=27. A diagonal ray crosses the volume. The index function maps in-domain points to 0..26 and returns -1 outside.atol=0.001.test_default_integratorIndexedRayTransferEmitteris created without an integrator argument under the same ray/volume setup as above.IndexedRayTransferIntegratorby default, and the resulting spectrum matches the same expected vector (atol=0.001).test_discrete3dmesh_as_index_functionDiscrete3DMeshcan be used as an equivalent index function source.Discrete3DMeshis built from a 4x4x4 vertex grid over 3x3x3 cells; each cube is split into 6 tetrahedra. Cell values follow the same indexing rule as the reference index function.atol=0.001.Executed:
Result:
test_default_integrator: oktest_discrete3dmesh_as_index_function: oktest_evaluate_function: okExample Usage
Compatibility and Risk
Reviewer Notes
Checklist
Benchmark
The appendix in this paper (https://doi.org/10.1063/5.0225703) compared the raytransfer of
Discrete3Dmeshes with that of regular grids, showing that the geometry matrix calculation for rectangular grids' raytransfer was much faster than theDiscrete3Done.