Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-11-07 10:11:39

0001 //------------------------------- -*- C++ -*- -------------------------------//
0002 // Copyright Celeritas contributors: see top-level COPYRIGHT file for details
0003 // SPDX-License-Identifier: (Apache-2.0 OR MIT)
0004 //---------------------------------------------------------------------------//
0005 //! \file celeritas/optical/surface/model/OnlyReflectionData.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include "corecel/Macros.hh"
0010 #include "corecel/data/Collection.hh"
0011 #include "celeritas/optical/Types.hh"
0012 
0013 namespace celeritas
0014 {
0015 namespace optical
0016 {
0017 //---------------------------------------------------------------------------//
0018 /*!
0019  * Data for only reflections interaction model.
0020  */
0021 template<Ownership W, MemSpace M>
0022 struct OnlyReflectionData
0023 {
0024     //!@{
0025     //! \name Type aliases
0026     template<class T>
0027     using SurfaceItems = Collection<T, W, M, SubModelId>;
0028     //!@}
0029 
0030     SurfaceItems<ReflectionMode> modes;
0031 
0032     //! Whether data are assigned and valid
0033     explicit CELER_FUNCTION operator bool() const { return !modes.empty(); }
0034 
0035     //! Assign from another set of data
0036     template<Ownership W2, MemSpace M2>
0037     OnlyReflectionData<W, M>& operator=(OnlyReflectionData<W2, M2> const& other)
0038     {
0039         CELER_EXPECT(other);
0040         modes = other.modes;
0041         CELER_ENSURE(*this);
0042         return *this;
0043     }
0044 };
0045 
0046 //---------------------------------------------------------------------------//
0047 }  // namespace optical
0048 }  // namespace celeritas