-
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
base: develop
Are you sure you want to change the base?
Changes from 20 commits
549d4b0
65c4f11
dfd419f
42e220b
f58138f
5a6c4ef
0335b15
03f801c
fa0ac7b
e9ab07c
0c591a8
b0b4130
8551827
89e572a
4ff7fa4
9e2a05f
966f24f
29b5a25
71034e2
cfddbbf
5d9fd4d
7941d43
b9da2db
735416a
c6aa9e1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,126 @@ | ||
| //------------------------------- -*- 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 a direction, map view, and materials | ||
| inline CELER_FUNCTION SurfaceModelView(SubsurfaceDirection, | ||
| SurfacePhysicsMapView, | ||
| OptMatId pre_mat, | ||
| OptMatId post_mat); | ||
|
|
||
| // Get subsurface track direction | ||
| inline CELER_FUNCTION SubsurfaceDirection direction() const; | ||
|
|
||
| // Get surface model ID | ||
| inline CELER_FUNCTION SurfaceModelId surface_model() const; | ||
|
|
||
| // Get internal surface ID for the model | ||
| inline CELER_FUNCTION InternalSurfaceId internal_surface_id() const; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe |
||
|
|
||
| // 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: | ||
| SubsurfaceDirection dir_; | ||
| SurfacePhysicsMapView physics_map_; | ||
| OptMatId pre_material_; | ||
| OptMatId post_material_; | ||
| }; | ||
|
|
||
| //---------------------------------------------------------------------------// | ||
| // INLINE DEFINITIONS | ||
| //---------------------------------------------------------------------------// | ||
| /*! | ||
| * Construct from track direction, physics map view, and materials. | ||
| */ | ||
| CELER_FUNCTION | ||
| SurfaceModelView::SurfaceModelView(SubsurfaceDirection dir, | ||
| SurfacePhysicsMapView physics_map, | ||
| OptMatId pre_material, | ||
| OptMatId post_material) | ||
| : dir_(dir) | ||
| , physics_map_(physics_map) | ||
| , pre_material_(pre_material) | ||
| , post_material_(post_material) | ||
| { | ||
| } | ||
|
|
||
| //---------------------------------------------------------------------------// | ||
| /*! | ||
| * Get the subsurface track direction pointing to this surface. | ||
| */ | ||
| CELER_FUNCTION SubsurfaceDirection SurfaceModelView::direction() const | ||
| { | ||
| return dir_; | ||
| } | ||
|
|
||
| //---------------------------------------------------------------------------// | ||
| /*! | ||
| * Get the surface model for this physics surface. | ||
| */ | ||
| CELER_FUNCTION SurfaceModelId SurfaceModelView::surface_model() 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 | ||
Uh oh!
There was an error while loading. Please reload this page.