include/pops/amr/hierarchy/refinement_ratio.hpp Source FileΒΆ

adc_cpp: include/pops/amr/hierarchy/refinement_ratio.hpp Source File
adc_cpp 0.3.0
Model-free C++23 core for coupled hyperbolic-elliptic systems on adaptive (AMR) meshes, with MPI and GPU (Kokkos) backends
refinement_ratio.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <stdexcept>
4#include <string>
5
26namespace pops {
27
30inline constexpr int kAmrRefRatio = 2;
31
35inline void require_supported_ref_ratio(int ratio) {
36 if (ratio != kAmrRefRatio) {
37 throw std::invalid_argument("pops: AMR refinement ratio " + std::to_string(ratio) +
38 " is not supported; the native AMR hierarchy only supports ratio " +
39 std::to_string(kAmrRefRatio) +
40 " (centralized in include/pops/amr/refinement_ratio.hpp)");
41 }
42}
43
44} // namespace pops
Definition amr_hierarchy.hpp:29
void require_supported_ref_ratio(int ratio)
Validates a requested AMR refinement ratio at the hierarchy boundary.
Definition refinement_ratio.hpp:35
constexpr int kAmrRefRatio
The native AMR refinement ratio between two consecutive levels.
Definition refinement_ratio.hpp:30