forked from celeritas-project/celeritas
/
GenericGridData.hh
35 lines (31 loc) · 1.16 KB
/
GenericGridData.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//----------------------------------*-C++-*----------------------------------//
// Copyright 2024 UT-Battelle, LLC, and other Celeritas developers.
// See the top-level COPYRIGHT file for details.
// SPDX-License-Identifier: (Apache-2.0 OR MIT)
//---------------------------------------------------------------------------//
//! \file celeritas/grid/GenericGridData.hh
//---------------------------------------------------------------------------//
#pragma once
#include "corecel/Types.hh"
#include "corecel/data/Collection.hh"
#include "celeritas/Types.hh"
namespace celeritas
{
//---------------------------------------------------------------------------//
/*!
* A grid of increasing, sorted 1D data with linear-linear interpolation.
*
* \todo Rename to GenericGridRecord
*/
struct GenericGridData
{
ItemRange<real_type> grid; //!< x grid
ItemRange<real_type> value; //!< f(x) value
//! Whether the record is initialized and valid
explicit CELER_FUNCTION operator bool() const
{
return grid.size() >= 2 && value.size() == grid.size();
}
};
//---------------------------------------------------------------------------//
} // namespace celeritas