Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-22 10:31:23

0001 //----------------------------------*-C++-*----------------------------------//
0002 // Copyright 2024 UT-Battelle, LLC, and other Celeritas developers.
0003 // See the top-level COPYRIGHT file for details.
0004 // SPDX-License-Identifier: (Apache-2.0 OR MIT)
0005 //---------------------------------------------------------------------------//
0006 //! \file celeritas/grid/GenericGridData.hh
0007 //---------------------------------------------------------------------------//
0008 #pragma once
0009 
0010 #include "corecel/Types.hh"
0011 #include "corecel/data/Collection.hh"
0012 #include "celeritas/Types.hh"
0013 
0014 namespace celeritas
0015 {
0016 //---------------------------------------------------------------------------//
0017 /*!
0018  * A grid of increasing, sorted 1D data with linear-linear interpolation.
0019  */
0020 struct GenericGridRecord
0021 {
0022     ItemRange<real_type> grid;  //!< x grid
0023     ItemRange<real_type> value;  //!< f(x) value
0024 
0025     //! Whether the record is initialized and valid
0026     explicit CELER_FUNCTION operator bool() const
0027     {
0028         return grid.size() >= 2 && value.size() == grid.size();
0029     }
0030 };
0031 
0032 //---------------------------------------------------------------------------//
0033 }  // namespace celeritas