Celeritas 0.7.0-dev.252+develop.478e7a17
Loading...
Searching...
No Matches
Classes | Functions
SurfacePhysicsUtils.hh File Reference
#include "corecel/data/Collection.hh"
#include "corecel/math/Algorithms.hh"
#include "corecel/math/ArrayOperators.hh"
#include "corecel/math/ArrayUtils.hh"
#include "celeritas/optical/Types.hh"

Classes

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

Functions

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

Function Documentation

◆ is_entering_surface()

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()

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

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.