ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_ReadBndryPlanes.cpp File Reference
#include "AMReX_Gpu.H"
#include "ERF_Constants.H"
#include "AMReX_ParmParse.H"
#include <AMReX_PlotFileUtil.H>
#include "ERF_ReadBndryPlanes.H"
#include "ERF_IndexDefines.H"
#include "AMReX_MultiFabUtil.H"
#include "ERF_EOS.H"
Include dependency graph for ERF_ReadBndryPlanes.cpp:

Functions

AMREX_FORCE_INLINE int closest_index (const Vector< double > &vec, const double value)
 
AMREX_FORCE_INLINE IntVect offset (const int face_dir, const int normal)
 

Function Documentation

◆ closest_index()

AMREX_FORCE_INLINE int closest_index ( const Vector< double > &  vec,
const double  value 
)

Return closest index (from lower) of value in vector

20 {
21  auto const it = std::upper_bound(vec.begin(), vec.end(), value);
22  if (it == vec.end()) {
23  // A value equal to the last entry lies in the final interval
24  AMREX_ALWAYS_ASSERT(!vec.empty() && value <= vec.back());
25  return std::max(static_cast<int>(vec.size()) - 2, 0);
26  }
27 
28  const int idx = static_cast<int>(std::distance(vec.begin(), it));
29  return std::max(idx - 1, 0);
30 }
AMREX_ALWAYS_ASSERT(bx.length()[2]==khi+1)
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int idx(int i, int j, int k, int nx, int ny)
Definition: ERF_InitForEnsemble.cpp:404

Referenced by ReadBndryPlanes::read_input_files().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ offset()

AMREX_FORCE_INLINE IntVect offset ( const int  face_dir,
const int  normal 
)