Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-13 08:53:32

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/grid/XsGridData.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include "corecel/Types.hh"
0010 #include "corecel/grid/UniformGridData.hh"
0011 #include "celeritas/Types.hh"
0012 #include "celeritas/UnitTypes.hh"
0013 
0014 namespace celeritas
0015 {
0016 //---------------------------------------------------------------------------//
0017 /*!
0018  * Tabulated cross section as a function of energy on a 1D grid.
0019  *
0020  * The upper grid values are expected to be pre-scaled by a factor of 1 / E.
0021  *
0022  * Interpolation is linear-linear or spline after transforming from log-E space
0023  * and before scaling the value by E (if the grid point is in the upper grid).
0024  */
0025 struct XsGridRecord
0026 {
0027     using EnergyUnits = units::Mev;
0028     using XsUnits = units::Native;
0029 
0030     UniformGridRecord lower;
0031     UniformGridRecord upper;  //!< Values scaled by 1/E
0032 
0033     //! Whether the record is initialized and valid
0034     explicit CELER_FUNCTION operator bool() const
0035     {
0036         return (lower || upper)
0037                && (!lower || !upper || lower.grid.back == upper.grid.front);
0038     }
0039 };
0040 
0041 //---------------------------------------------------------------------------//
0042 }  // namespace celeritas