Celeritas 0.7.0-dev.127+develop.e63889793
Loading...
Searching...
No Matches
Classes | Functions
SurfacePhysicsUtils.hh File Reference
#include "corecel/data/Collection.hh"
#include "corecel/math/Algorithms.hh"
#include "corecel/math/ArrayUtils.hh"
#include "celeritas/optical/Types.hh"
This graph shows which files directly or indirectly include this file:

Classes

class  celeritas::optical::EnteringSurfaceNormalSampler< Calculator >
 Sample a valid facet normal by wrapping a roughness calculator. More...
 

Functions

CELER_FUNCTION bool celeritas::optical::is_entering_surface (Real3 const &dir, Real3 const &normal)
 Whether a track is entering the surface defined by the given normal.
 
CELER_FORCEINLINE_FUNCTION SurfaceTrackPosition celeritas::optical::next_subsurface_position (SurfaceTrackPosition pos, SubsurfaceDirection dir)
 Get the next track surface position in the given direction.
 
CELER_FUNCTION SubsurfaceDirection celeritas::optical::calc_subsurface_direction (Real3 const &geo_dir, Real3 const &normal)
 Calculate subsurface direction from a track's geometry direction.
 

Function Documentation

◆ is_entering_surface()

CELER_FUNCTION bool celeritas::optical::is_entering_surface ( Real3 const dir,
Real3 const normal 
)
inline

Whether a track is entering the surface defined by the given normal.

The surface normal convention used in Celeritas optical physics is that the normal direction points opposite the incident track direction. This function makes checks for this condition explicit in the code.

◆ next_subsurface_position()

CELER_FORCEINLINE_FUNCTION SurfaceTrackPosition celeritas::optical::next_subsurface_position ( SurfaceTrackPosition  pos,
SubsurfaceDirection  dir 
)

Get the next track surface position in the given direction.

Type-safe operation to ensure direction is only added in track-local frames. Uses unsigned underflow when moving reverse (dir = -1) while on a pre-surface (pos = 0) to wrap to an invalid position value.