Celeritas 0.7.0-dev.313+develop.1857205b
Loading...
Searching...
No Matches
Public Member Functions | List of all members
celeritas::UniformGrid Class Reference

Interact with a uniform grid of increasing values. More...

#include <UniformGrid.hh>

Public Types

Type aliases
using size_type = ::celeritas::size_type
 
using value_type = ::celeritas::real_type
 

Public Member Functions

 UniformGrid (UniformGridData const &data)
 Construct with data.
 
size_type size () const
 Number of grid points.
 
value_type front () const
 Minimum/first value.
 
value_type back () const
 Maximum/last value.
 
value_type operator[] (size_type i) const
 Get the value at the given grid point.
 
size_type find (value_type value) const
 Find the value bin such that data[result] <= value < data[result + 1].
 
UniformGridData constdata () const
 

Detailed Description

Interact with a uniform grid of increasing values.

This simple class is used by physics vectors and classes that need to do lookups on a uniform grid.

Searching for a grid index with find requires the input value to be in range, because out-of-bounds values often need special treatment (e.g., clipping to the boundary values rather than interpolating). It's easier to check for those exceptional cases outside of the grid view.

Member Function Documentation

◆ data()

UniformGridData const & celeritas::UniformGrid::data ( ) const
inline

Access the data used to construct this class


The documentation for this class was generated from the following file: