Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 08:53:40

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/UniformGridInserter.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include "corecel/Types.hh"
0010 #include "corecel/data/Collection.hh"
0011 #include "corecel/data/CollectionBuilder.hh"
0012 #include "corecel/data/DedupeCollectionBuilder.hh"
0013 #include "corecel/grid/UniformGridData.hh"
0014 #include "celeritas/Types.hh"
0015 #include "celeritas/inp/Grid.hh"
0016 
0017 #include "XsGridData.hh"
0018 
0019 namespace celeritas
0020 {
0021 //---------------------------------------------------------------------------//
0022 /*!
0023  * Manage data and help construction of physics value grids.
0024  */
0025 class UniformGridInserter
0026 {
0027   public:
0028     //!@{
0029     //! \name Type aliases
0030     using GridId = ItemId<UniformGridRecord>;
0031     using GridValues
0032         = Collection<UniformGridRecord, Ownership::value, MemSpace::host>;
0033     using Values = Collection<real_type, Ownership::value, MemSpace::host>;
0034     //!@}
0035 
0036   public:
0037     // Construct with a reference to mutable host data
0038     UniformGridInserter(Values* reals, GridValues* grids);
0039 
0040     // Add a grid of uniform log-grid data
0041     GridId operator()(inp::UniformGrid const& grid);
0042 
0043   private:
0044     Values* values_;
0045     DedupeCollectionBuilder<real_type> reals_;
0046     CollectionBuilder<UniformGridRecord, MemSpace::host, GridId> grids_;
0047 };
0048 
0049 //---------------------------------------------------------------------------//
0050 }  // namespace celeritas