File indexing completed on 2026-11-07 10:11:39
0001
0002
0003
0004
0005
0006
0007 #pragma once
0008
0009 #include "celeritas/optical/CoreTrackView.hh"
0010 #include "celeritas/optical/surface/GaussianRoughnessSampler.hh"
0011
0012 #include "GaussianRoughnessData.hh"
0013
0014 namespace celeritas
0015 {
0016 namespace optical
0017 {
0018
0019
0020
0021
0022 struct GaussianRoughnessExecutor
0023 {
0024 NativeCRef<GaussianRoughnessData> data;
0025
0026
0027 CELER_FUNCTION void operator()(CoreTrackView& track) const
0028 {
0029 auto s_phys = track.surface_physics();
0030 auto sub_model_id
0031 = s_phys.interface(SurfacePhysicsOrder::roughness).internal_surface_id();
0032 CELER_ASSERT(sub_model_id < data.sigma_alpha.size());
0033 EnteringSurfaceNormalSampler<GaussianRoughnessSampler> sample_facet{
0034 track.geometry().dir(),
0035 s_phys.global_normal(),
0036 data.sigma_alpha[sub_model_id]};
0037 auto rng = track.rng();
0038 s_phys.facet_normal(sample_facet(rng));
0039 }
0040 };
0041
0042
0043 }
0044 }