-
Notifications
You must be signed in to change notification settings - Fork 45
Add builtin surface roughness models #1928
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
hhollenb
wants to merge
25
commits into
celeritas-project:develop
Choose a base branch
from
hhollenb:surface-builtin-models
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
549d4b0
Initial draft of surface normals
Hollenbeck-Hayden 65c4f11
Disabled some tests not using ORANGE
Hollenbeck-Hayden dfd419f
Merge branch 'develop' into surface-normal-state
Hollenbeck-Hayden 42e220b
Revert regressions
Hollenbeck-Hayden f58138f
Polished and Smear roughness models
Hollenbeck-Hayden 5a6c4ef
Saving progress after fixing some weird bugs
Hollenbeck-Hayden 0335b15
Refactor RoughnessModel
Hollenbeck-Hayden 03f801c
Switch roughness model to builtin surface model
Hollenbeck-Hayden fa0ac7b
Refined some of builtin roughness models
Hollenbeck-Hayden e9ab07c
Add missing data file from cherry-pick
Hollenbeck-Hayden 0c591a8
Add documentation
Hollenbeck-Hayden b0b4130
Added builtin surface model builder
Hollenbeck-Hayden 8551827
Added surface model view tests
Hollenbeck-Hayden 89e572a
Cleanup surface physics view a bit
Hollenbeck-Hayden 4ff7fa4
Pre PR clean up
Hollenbeck-Hayden 9e2a05f
Revert sincos change in GaussianRoughnessSampler
Hollenbeck-Hayden 966f24f
Added Seth's changes
Hollenbeck-Hayden 29b5a25
Fix failing tests
Hollenbeck-Hayden 71034e2
Merge branch 'develop' into surface-builtin-models
Hollenbeck-Hayden cfddbbf
Reverted sincos using global namespace
Hollenbeck-Hayden 5d9fd4d
Merge branch 'develop' into surface-builtin-models
Hollenbeck-Hayden 7941d43
Added some of Seth's minor suggestions
Hollenbeck-Hayden b9da2db
Refactored builtin surface model input
Hollenbeck-Hayden 735416a
Cache track subsurface traversal direction
Hollenbeck-Hayden c6aa9e1
Re-enabled celer-sim tests involving surface normals
Hollenbeck-Hayden File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| //------------------------------- -*- C++ -*- -------------------------------// | ||
| // Copyright Celeritas contributors: see top-level COPYRIGHT file for details | ||
| // SPDX-License-Identifier: (Apache-2.0 OR MIT) | ||
| //---------------------------------------------------------------------------// | ||
| //! \file celeritas/optical/surface/SurfaceModelView.hh | ||
| //---------------------------------------------------------------------------// | ||
| #pragma once | ||
|
|
||
| #include "celeritas/optical/Types.hh" | ||
| #include "celeritas/phys/SurfacePhysicsMapView.hh" | ||
|
|
||
| namespace celeritas | ||
| { | ||
| namespace optical | ||
| { | ||
| //---------------------------------------------------------------------------// | ||
| /*! | ||
| * Optical surface data for a model. | ||
| * | ||
| * Wraps common behavior for querying the surface model data for a given | ||
| * physics surface interface. | ||
| */ | ||
| class SurfaceModelView | ||
| { | ||
| public: | ||
| //!@{ | ||
| //! \name Type aliases | ||
| using InternalSurfaceId = SurfacePhysicsMapView::InternalSurfaceId; | ||
| //!@} | ||
|
|
||
| public: | ||
| // Construct from map view and materials | ||
| inline CELER_FUNCTION SurfaceModelView(SurfacePhysicsMapView, | ||
| OptMatId pre_mat, | ||
| OptMatId post_mat); | ||
|
|
||
| // Get surface model ID | ||
| inline CELER_FUNCTION SurfaceModelId model_id() const; | ||
|
|
||
| // Get internal surface ID for the model | ||
| inline CELER_FUNCTION InternalSurfaceId internal_surface_id() const; | ||
|
|
||
| // Get pre-volume optical material | ||
| inline CELER_FUNCTION OptMatId pre_material() const; | ||
|
|
||
| // Get post-volume optical material | ||
| inline CELER_FUNCTION OptMatId post_material() const; | ||
|
|
||
| private: | ||
| SurfacePhysicsMapView physics_map_; | ||
| OptMatId pre_material_; | ||
| OptMatId post_material_; | ||
| }; | ||
|
|
||
| //---------------------------------------------------------------------------// | ||
| // INLINE DEFINITIONS | ||
| //---------------------------------------------------------------------------// | ||
| /*! | ||
| * Construct from physics map view and materials. | ||
| */ | ||
| CELER_FUNCTION | ||
| SurfaceModelView::SurfaceModelView(SurfacePhysicsMapView physics_map, | ||
| OptMatId pre_material, | ||
| OptMatId post_material) | ||
| : physics_map_(physics_map) | ||
| , pre_material_(pre_material) | ||
| , post_material_(post_material) | ||
| { | ||
| } | ||
|
|
||
| //---------------------------------------------------------------------------// | ||
| /*! | ||
| * Get the surface model for this physics surface. | ||
| */ | ||
| CELER_FUNCTION SurfaceModelId SurfaceModelView::model_id() const | ||
| { | ||
| return physics_map_.surface_model_id(); | ||
| } | ||
|
|
||
| //---------------------------------------------------------------------------// | ||
| /*! | ||
| * Get the internal surface ID for the physics surface in this model. | ||
| */ | ||
| CELER_FUNCTION auto SurfaceModelView::internal_surface_id() const | ||
| -> InternalSurfaceId | ||
| { | ||
| return physics_map_.internal_surface_id(); | ||
| } | ||
|
|
||
| //---------------------------------------------------------------------------// | ||
| /*! | ||
| * Get the optical material before the interface. | ||
| */ | ||
| CELER_FUNCTION OptMatId SurfaceModelView::pre_material() const | ||
| { | ||
| return pre_material_; | ||
| } | ||
|
|
||
| //---------------------------------------------------------------------------// | ||
| /*! | ||
| * Get the optical material after the interface. | ||
| */ | ||
| CELER_FUNCTION OptMatId SurfaceModelView::post_material() const | ||
| { | ||
| return post_material_; | ||
| } | ||
|
|
||
| //---------------------------------------------------------------------------// | ||
| } // namespace optical | ||
| } // namespace celeritas | ||
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be good to clarify whether this is "internal" as in "implementation" or "sub-surface" (I can't remember what we ended up deciding or postponing...)
EDIT: I remember, originally this was a type alias inside
SurfaceModel, and it's just a local index for the data. I wonder if it'd be better to call it ModelSurfaceId or something after all? :\There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe
PerModelSurfaceId?