ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
erf_sbm::remap_detail Namespace Reference

Classes

struct  RemapCellStateView
 

Enumerations

enum class  ProductStatus { Ok , Underflow , Invalid }
 
enum class  QuotientStatus { Ok , Underflow , Invalid }
 

Functions

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool finite_nonnegative (const amrex::Real value) noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE ProductStatus checked_product (const amrex::Real left, const amrex::Real right, amrex::Real &result) noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE QuotientStatus checked_quotient (const amrex::Real numerator, const amrex::Real denominator, amrex::Real &result) noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool finite_product (const amrex::Real left, const amrex::Real right, amrex::Real &result) noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE RemapStatus remap_product_status (const ProductStatus status) noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE RemapStatus remap_quotient_status (const QuotientStatus status) noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool within_boundary_roundoff (const amrex::Real value, const amrex::Real endpoint, const bool lower_boundary) noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool route_plan_is_consistent (const PopulationRemapView &population, const PacketRoutingPlan &plan) noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool canonical_two_moment_moments (const PopulationRemapView &population, const int bin, const amrex::Real number, const amrex::Real mass) noexcept
 
template<typename StateView >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool canonical_two_moment_bin_state_view (const PopulationRemapView &population, const int bin, const StateView &state, const int state_count) noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool canonical_two_moment_bin_state (const PopulationRemapView &population, const int bin, const amrex::Real *state, const int state_count) noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool canonical_two_moment_bin_state (const PopulationRemapView &population, const int bin, const RemapCellStateView &state, const int state_count) noexcept
 
template<typename StateView >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool canonical_one_moment_bin_state_view (const PopulationRemapView &population, const int bin, const StateView &state, const int state_count) noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool canonical_one_moment_bin_state (const PopulationRemapView &population, const int bin, const amrex::Real *state, const int state_count) noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool canonical_one_moment_bin_state (const PopulationRemapView &population, const int bin, const RemapCellStateView &state, const int state_count) noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool canonical_persisted_bin_state (const PopulationRemapView &population, const int bin, const amrex::Real *state, const int state_count) noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool canonical_persisted_bin_state (const PopulationRemapView &population, const int bin, const RemapCellStateView &state, const int state_count) noexcept
 

Enumeration Type Documentation

◆ ProductStatus

◆ QuotientStatus

Enumerator
Ok 
Underflow 
Invalid 
162 { Ok, Underflow, Invalid };

Function Documentation

◆ canonical_one_moment_bin_state() [1/2]

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool erf_sbm::remap_detail::canonical_one_moment_bin_state ( const PopulationRemapView &  population,
const int  bin,
const amrex::Real *  state,
const int  state_count 
)
noexcept
459 {
460  if (state == nullptr) return false;
461  return canonical_one_moment_bin_state_view(population, bin, state, state_count);
462 }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool canonical_one_moment_bin_state_view(const PopulationRemapView &population, const int bin, const StateView &state, const int state_count) noexcept
Definition: ERF_SBMRemapping.H:427

Referenced by canonical_persisted_bin_state().

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

◆ canonical_one_moment_bin_state() [2/2]

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool erf_sbm::remap_detail::canonical_one_moment_bin_state ( const PopulationRemapView &  population,
const int  bin,
const RemapCellStateView &  state,
const int  state_count 
)
noexcept
469 {
470  return canonical_one_moment_bin_state_view(population, bin, state, state_count);
471 }
Here is the call graph for this function:

◆ canonical_one_moment_bin_state_view()

template<typename StateView >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool erf_sbm::remap_detail::canonical_one_moment_bin_state_view ( const PopulationRemapView &  population,
const int  bin,
const StateView &  state,
const int  state_count 
)
noexcept

Strict persisted-state test for a one-moment bin and its attached inventories.

430 {
431  if (!valid_population_remap_context(population) ||
432  state_count != population.state_components || bin < 0 || bin >= population.nbins ||
433  population.moment_mode != MomentMode::OneMoment) return false;
434  const amrex::Real mass = state[population.mass_offset + bin];
435  if (!finite_nonnegative(mass)) return false;
436  amrex::Real number = amrex::Real(0.0);
437  if (checked_quotient(mass, population.pivots[bin], number) != QuotientStatus::Ok) {
438  return false;
439  }
440  for (int property = 0; property < population.property_count; ++property) {
441  const amrex::Real amount = state[population.property_component_offsets[property] + bin];
442  if (!finite_nonnegative(amount)) return false;
443  if (number == amrex::Real(0.0)) {
444  if (amount != amrex::Real(0.0)) return false;
445  } else {
446  amrex::Real per_particle = amrex::Real(0.0);
447  if (checked_quotient(amount, number, per_particle) != QuotientStatus::Ok) {
448  return false;
449  }
450  }
451  }
452  return true;
453 }
amrex::Real Real
Definition: ERF_ShocInterface.H:19
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool finite_nonnegative(const amrex::Real value) noexcept
Definition: ERF_SBMRemapping.H:165
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE QuotientStatus checked_quotient(const amrex::Real numerator, const amrex::Real denominator, amrex::Real &result) noexcept
Definition: ERF_SBMRemapping.H:183
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool valid_population_remap_context(const PopulationRemapView &population) noexcept
Definition: ERF_SBMRemapping.H:53

Referenced by canonical_one_moment_bin_state().

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

◆ canonical_persisted_bin_state() [1/2]

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool erf_sbm::remap_detail::canonical_persisted_bin_state ( const PopulationRemapView &  population,
const int  bin,
const amrex::Real *  state,
const int  state_count 
)
noexcept

Shared admission rule for every persisted bin accepted by reconstruction.

478 {
479  return population.moment_mode == MomentMode::OneMoment ?
480  canonical_one_moment_bin_state(population, bin, state, state_count) :
481  canonical_two_moment_bin_state(population, bin, state, state_count);
482 }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool canonical_one_moment_bin_state(const PopulationRemapView &population, const int bin, const RemapCellStateView &state, const int state_count) noexcept
Definition: ERF_SBMRemapping.H:465
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool canonical_two_moment_bin_state(const PopulationRemapView &population, const int bin, const RemapCellStateView &state, const int state_count) noexcept
Definition: ERF_SBMRemapping.H:416

Referenced by erf_sbm::SBMTransport::advance_stage(), erf_sbm::authoritative_state_admissible(), erf_sbm::reconstruct_bin_core(), and erf_sbm::validate_fixture_initial_state_canonicality().

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

◆ canonical_persisted_bin_state() [2/2]

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool erf_sbm::remap_detail::canonical_persisted_bin_state ( const PopulationRemapView &  population,
const int  bin,
const RemapCellStateView &  state,
const int  state_count 
)
noexcept
489 {
490  return population.moment_mode == MomentMode::OneMoment ?
491  canonical_one_moment_bin_state(population, bin, state, state_count) :
492  canonical_two_moment_bin_state(population, bin, state, state_count);
493 }
Here is the call graph for this function:

◆ canonical_two_moment_bin_state() [1/2]

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool erf_sbm::remap_detail::canonical_two_moment_bin_state ( const PopulationRemapView &  population,
const int  bin,
const amrex::Real *  state,
const int  state_count 
)
noexcept
410 {
411  if (state == nullptr) return false;
412  return canonical_two_moment_bin_state_view(population, bin, state, state_count);
413 }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool canonical_two_moment_bin_state_view(const PopulationRemapView &population, const int bin, const StateView &state, const int state_count) noexcept
Definition: ERF_SBMRemapping.H:379

Referenced by erf_sbm::authoritative_state_admissible(), canonical_persisted_bin_state(), and erf_sbm::reconstruct_bin_core().

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

◆ canonical_two_moment_bin_state() [2/2]

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool erf_sbm::remap_detail::canonical_two_moment_bin_state ( const PopulationRemapView &  population,
const int  bin,
const RemapCellStateView &  state,
const int  state_count 
)
noexcept
420 {
421  return canonical_two_moment_bin_state_view(population, bin, state, state_count);
422 }
Here is the call graph for this function:

◆ canonical_two_moment_bin_state_view()

template<typename StateView >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool erf_sbm::remap_detail::canonical_two_moment_bin_state_view ( const PopulationRemapView &  population,
const int  bin,
const StateView &  state,
const int  state_count 
)
noexcept

Strict persisted-state test shared by reconstruction, restart, and fixtures.

382 {
383  if (!valid_population_remap_context(population) ||
384  state_count != population.state_components || bin < 0 || bin >= population.nbins ||
385  population.moment_mode != MomentMode::TwoMoment) return false;
386  const amrex::Real mass = state[population.mass_offset + bin];
387  const amrex::Real number = state[population.number_offset + bin];
388  if (!canonical_two_moment_moments(population, bin, number, mass)) return false;
389  if (number == amrex::Real(0.0)) {
390  for (int property = 0; property < population.property_count; ++property) {
391  if (state[population.property_component_offsets[property] + bin] != amrex::Real(0.0)) {
392  return false;
393  }
394  }
395  }
396  for (int property = 0; property < population.property_count; ++property) {
397  const amrex::Real amount = state[population.property_component_offsets[property] + bin];
398  if (!finite_nonnegative(amount)) return false;
399  if (number == amrex::Real(0.0)) continue;
400  amrex::Real per_particle = amrex::Real(0.0);
401  if (checked_quotient(amount, number, per_particle) != QuotientStatus::Ok) return false;
402  }
403  return true;
404 }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool canonical_two_moment_moments(const PopulationRemapView &population, const int bin, const amrex::Real number, const amrex::Real mass) noexcept
Definition: ERF_SBMRemapping.H:345

Referenced by canonical_two_moment_bin_state().

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

◆ canonical_two_moment_moments()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool erf_sbm::remap_detail::canonical_two_moment_moments ( const PopulationRemapView &  population,
const int  bin,
const amrex::Real  number,
const amrex::Real  mass 
)
noexcept
348 {
349  if (!valid_population_remap_context(population) ||
350  population.moment_mode != MomentMode::TwoMoment || bin < 0 || bin >= population.nbins ||
351  !finite_nonnegative(number) || !finite_nonnegative(mass)) return false;
352  if (number == amrex::Real(0.0)) return mass == amrex::Real(0.0);
353  if (mass <= amrex::Real(0.0)) return false;
354  amrex::Real mean = amrex::Real(0.0);
355  if (checked_quotient(mass, number, mean) != QuotientStatus::Ok) return false;
356  const amrex::Real lower = population.edges[bin];
357  const amrex::Real upper = population.edges[bin + 1];
358  return amrex::Math::isfinite(mean) && mean >= lower &&
359  (mean < upper || (bin == population.nbins - 1 && mean <= upper));
360 }

Referenced by erf_sbm::apply_packet_routing_core(), canonical_two_moment_bin_state_view(), and erf_sbm::project_reconstruction_bin_core().

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

◆ checked_product()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE ProductStatus erf_sbm::remap_detail::checked_product ( const amrex::Real  left,
const amrex::Real  right,
amrex::Real &  result 
)
noexcept
173 {
174  if (!finite_nonnegative(left) || !finite_nonnegative(right)) return ProductStatus::Invalid;
175  result = left * right;
176  if (!amrex::Math::isfinite(result)) return ProductStatus::Invalid;
177  if (left > amrex::Real(0.0) && right > amrex::Real(0.0) &&
178  result == amrex::Real(0.0)) return ProductStatus::Underflow;
179  return ProductStatus::Ok;
180 }

Referenced by erf_sbm::apply_packet_routing_core(), and finite_product().

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

◆ checked_quotient()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE QuotientStatus erf_sbm::remap_detail::checked_quotient ( const amrex::Real  numerator,
const amrex::Real  denominator,
amrex::Real &  result 
)
noexcept
186 {
187  if (!finite_nonnegative(numerator) || !amrex::Math::isfinite(denominator) ||
188  !(denominator > amrex::Real(0.0))) return QuotientStatus::Invalid;
189  result = numerator / denominator;
190  if (!amrex::Math::isfinite(result)) return QuotientStatus::Invalid;
191  if (numerator > amrex::Real(0.0) && result == amrex::Real(0.0)) {
192  return QuotientStatus::Underflow;
193  }
194  return QuotientStatus::Ok;
195 }

Referenced by erf_sbm::apply_packet_routing_core(), canonical_one_moment_bin_state_view(), canonical_two_moment_bin_state_view(), canonical_two_moment_moments(), erf_sbm::plan_packet_routing(), erf_sbm::project_reconstruction_bin_core(), erf_sbm::reconstruct_bin_core(), and route_plan_is_consistent().

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

◆ finite_nonnegative()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool erf_sbm::remap_detail::finite_nonnegative ( const amrex::Real  value)
noexcept

◆ finite_product()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool erf_sbm::remap_detail::finite_product ( const amrex::Real  left,
const amrex::Real  right,
amrex::Real &  result 
)
noexcept
200 {
201  return checked_product(left, right, result) == ProductStatus::Ok;
202 }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE ProductStatus checked_product(const amrex::Real left, const amrex::Real right, amrex::Real &result) noexcept
Definition: ERF_SBMRemapping.H:171

Referenced by erf_sbm::integrate_interval_core(), and erf_sbm::project_reconstruction_bin_core().

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

◆ remap_product_status()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE RemapStatus erf_sbm::remap_detail::remap_product_status ( const ProductStatus  status)
noexcept
206 {
207  return status == ProductStatus::Underflow ? RemapStatus::NumericalUnderflow :
208  status == ProductStatus::Ok ? RemapStatus::Ok : RemapStatus::Invalid;
209 }

Referenced by erf_sbm::apply_packet_routing_core().

Here is the caller graph for this function:

◆ remap_quotient_status()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE RemapStatus erf_sbm::remap_detail::remap_quotient_status ( const QuotientStatus  status)
noexcept
213 {
214  return status == QuotientStatus::Underflow ? RemapStatus::NumericalUnderflow :
215  status == QuotientStatus::Ok ? RemapStatus::Ok : RemapStatus::Invalid;
216 }

Referenced by erf_sbm::apply_packet_routing_core(), and erf_sbm::plan_packet_routing().

Here is the caller graph for this function:

◆ route_plan_is_consistent()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool erf_sbm::remap_detail::route_plan_is_consistent ( const PopulationRemapView &  population,
const PacketRoutingPlan &  plan 
)
noexcept

Validate a route against its local claimed bin(s), without searching.

237 {
238  if (!valid_population_remap_context(population) ||
239  !same_population_context(population, plan.population) ||
240  !amrex::Math::isfinite(plan.packet_number) ||
241  !amrex::Math::isfinite(plan.packet_particle_mass) ||
242  plan.packet_number < amrex::Real(0.0) || plan.packet_particle_mass < amrex::Real(0.0) ||
243  plan.destination_count < 0 || plan.destination_count > 2 ||
244  !finite_nonnegative(plan.residual_number_weight) ||
245  plan.residual_number_weight > amrex::Real(1.0)) return false;
246 
247  if (plan.packet_number == amrex::Real(0.0)) {
248  return plan.status == RemapStatus::Ok && plan.destination_count == 0 &&
249  plan.residual_number_weight == amrex::Real(0.0) &&
250  !plan.normalized_roundoff;
251  }
252 
253  if (population.moment_mode == MomentMode::TwoMoment) {
254  if (plan.packet_particle_mass == amrex::Real(0.0)) {
255  return plan.status == RemapStatus::ZeroWaterResidual &&
256  plan.destination_count == 0 &&
257  plan.residual_number_weight == amrex::Real(1.0) &&
258  !plan.normalized_roundoff;
259  }
260  const amrex::Real lower = population.edges[0];
261  const amrex::Real top = population.edges[population.nbins];
262  int required_bin = -1;
263  amrex::Real expected_mass = plan.packet_particle_mass;
264  bool normalized = false;
265  if (plan.packet_particle_mass < lower) {
266  if (!within_boundary_roundoff(plan.packet_particle_mass, lower, true)) return false;
267  required_bin = 0;
268  expected_mass = lower;
269  normalized = true;
270  } else if (plan.packet_particle_mass > top) {
271  if (!within_boundary_roundoff(plan.packet_particle_mass, top, false)) return false;
272  required_bin = population.nbins - 1;
273  expected_mass = top;
274  normalized = true;
275  }
276  if (plan.status != RemapStatus::Ok || plan.destination_count != 1 ||
277  plan.residual_number_weight != amrex::Real(0.0) ||
278  plan.normalized_roundoff != normalized) return false;
279  const auto& route = plan.destinations[0];
280  return (required_bin < 0 || route.bin == required_bin) &&
281  route.number_weight == amrex::Real(1.0) &&
282  route.particle_mass == expected_mass && route.bin >= 0 &&
283  route.bin < population.nbins && expected_mass >= population.edges[route.bin] &&
284  (expected_mass < population.edges[route.bin + 1] ||
285  (route.bin == population.nbins - 1 &&
286  expected_mass <= population.edges[route.bin + 1]));
287  }
288 
289  const amrex::Real first = population.pivots[0];
290  const amrex::Real last = population.pivots[population.nbins - 1];
291  if (plan.packet_particle_mass == amrex::Real(0.0)) {
292  return plan.status == RemapStatus::ZeroWaterResidual &&
293  plan.destination_count == 0 &&
294  plan.residual_number_weight == amrex::Real(1.0) &&
295  !plan.normalized_roundoff;
296  }
297  if (plan.packet_particle_mass < first) {
298  amrex::Real wet_weight = amrex::Real(0.0);
299  if (checked_quotient(plan.packet_particle_mass, first, wet_weight) !=
300  QuotientStatus::Ok) return false;
301  return plan.status == RemapStatus::ZeroWaterResidual && !plan.normalized_roundoff &&
302  plan.destination_count == 1 && plan.residual_number_weight ==
303  amrex::Real(1.0) - wet_weight && plan.destinations[0].bin == 0 &&
304  plan.destinations[0].number_weight == wet_weight &&
305  plan.destinations[0].particle_mass == first;
306  }
307  if (plan.packet_particle_mass > last || plan.status == RemapStatus::ZeroWaterResidual) {
308  return false;
309  }
310  if (plan.destination_count == 1) {
311  const int pivot_bin = plan.destinations[0].bin;
312  if (pivot_bin < 0 || pivot_bin >= population.nbins) return false;
313  return plan.status == RemapStatus::Ok && !plan.normalized_roundoff &&
314  plan.destination_count == 1 && plan.residual_number_weight == amrex::Real(0.0) &&
315  plan.packet_particle_mass == population.pivots[pivot_bin] &&
316  plan.destinations[0].bin == pivot_bin &&
317  plan.destinations[0].number_weight == amrex::Real(1.0) &&
318  plan.destinations[0].particle_mass == population.pivots[pivot_bin];
319  }
320  if (plan.destination_count != 2) return false;
321  const int lower_bin = plan.destinations[0].bin;
322  if (lower_bin < 0 || lower_bin + 1 >= population.nbins ||
323  plan.destinations[1].bin != lower_bin + 1) return false;
324  const amrex::Real lower = population.pivots[lower_bin];
325  const amrex::Real upper = population.pivots[lower_bin + 1];
326  if (!(plan.packet_particle_mass > lower && plan.packet_particle_mass < upper)) return false;
327  const amrex::Real width = upper - lower;
328  amrex::Real lower_weight = amrex::Real(0.0);
329  amrex::Real upper_weight = amrex::Real(0.0);
330  if (checked_quotient(upper - plan.packet_particle_mass, width, lower_weight) !=
331  QuotientStatus::Ok ||
332  checked_quotient(plan.packet_particle_mass - lower, width, upper_weight) !=
333  QuotientStatus::Ok) return false;
334  return plan.status == RemapStatus::Ok && !plan.normalized_roundoff &&
335  plan.destination_count == 2 && plan.residual_number_weight == amrex::Real(0.0) &&
336  plan.destinations[0].bin == lower_bin &&
337  plan.destinations[0].number_weight == lower_weight &&
338  plan.destinations[0].particle_mass == lower &&
339  plan.destinations[1].bin == lower_bin + 1 &&
340  plan.destinations[1].number_weight == upper_weight &&
341  plan.destinations[1].particle_mass == upper;
342 }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool within_boundary_roundoff(const amrex::Real value, const amrex::Real endpoint, const bool lower_boundary) noexcept
Definition: ERF_SBMRemapping.H:220
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool same_population_context(const PopulationRemapView &left, const PopulationRemapView &right) noexcept
Definition: ERF_SBMRemapping.H:127

Referenced by erf_sbm::apply_packet_routing_core().

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

◆ within_boundary_roundoff()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool erf_sbm::remap_detail::within_boundary_roundoff ( const amrex::Real  value,
const amrex::Real  endpoint,
const bool  lower_boundary 
)
noexcept

Accept at most four representable steps outward from a global endpoint.

222 {
223  const amrex::Real direction = lower_boundary ?
224  -std::numeric_limits<amrex::Real>::infinity() :
225  std::numeric_limits<amrex::Real>::infinity();
226  amrex::Real allowance = endpoint;
227  for (int step = 0; step < 4; ++step) {
228  allowance = std::nextafter(allowance, direction);
229  }
230  return lower_boundary ? value >= allowance : value <= allowance;
231 }
Definition: ERF_ConsoleIO.cpp:17

Referenced by erf_sbm::plan_packet_routing(), and route_plan_is_consistent().

Here is the caller graph for this function: