ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
UnionListIF< F > Class Template Reference

#include <ERF_EBIF.H>

Collaboration diagram for UnionListIF< F >:

Public Member Functions

 UnionListIF (const amrex::Vector< F > &a_ifs)
 
bool is_empty () const
 
amrex::Real operator() (const amrex::RealArray &p) const
 

Private Attributes

amrex::Vector< Fm_ifs
 
bool empty
 

Constructor & Destructor Documentation

◆ UnionListIF()

template<class F >
UnionListIF< F >::UnionListIF ( const amrex::Vector< F > &  a_ifs)
inline
22  : m_ifs(a_ifs),
23  empty(!a_ifs.empty())
24  {}
amrex::Vector< F > m_ifs
Definition: ERF_EBIF.H:56
bool empty
Definition: ERF_EBIF.H:57

Member Function Documentation

◆ is_empty()

template<class F >
bool UnionListIF< F >::is_empty ( ) const
inline
27  {
28  return empty;
29  }

◆ operator()()

template<class F >
amrex::Real UnionListIF< F >::operator() ( const amrex::RealArray &  p) const
inline
32  {
33 
34  // NOTE: this assumes that m_ifs is not empty
35  amrex::Real vmax = m_ifs[0](p);
36  for(int i = 1; i < m_ifs.size(); i++)
37  {
38  amrex::Real vcur = m_ifs[i](p);
39  if(vmax < vcur)
40  vmax = vcur;
41  }
42 
43  return vmax;
44 
45  // NOTE: this would have been nice, but for some reason it does not work :(
46  // even though according to https://en.cppreference.com/w/cpp/algorithm/max
47  // it should ... ?
48  //F & f_max = std::max( m_ifs,
49  // [&](const F & f1, const F & f2) {
50  // return f1(p) < f2(p);
51  // });
52  //return f_max(p);
53  }

Member Data Documentation

◆ empty

template<class F >
bool UnionListIF< F >::empty
private

◆ m_ifs

template<class F >
amrex::Vector<F> UnionListIF< F >::m_ifs
private

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