1 #ifndef ERF_FLOOD_ENGINE_REGISTRY_H
2 #define ERF_FLOOD_ENGINE_REGISTRY_H
11 #include <type_traits>
56 #define ERF_FLOOD_ENGINE_CONCAT_(a, b) a##b
57 #define ERF_FLOOD_ENGINE_CONCAT(a, b) ERF_FLOOD_ENGINE_CONCAT_(a, b)
65 #define ERF_REGISTER_FLOOD_ENGINE(Class, name) \
67 [[maybe_unused]] const bool ERF_FLOOD_ENGINE_CONCAT(erf_flood_engine_registered_, __LINE__) = \
68 register_flood_engine((name), [](const FloodCouplingParams& p) -> std::unique_ptr<FloodEngine> { \
69 if constexpr (std::is_constructible_v<Class, const FloodCouplingParams&>) { \
70 return std::make_unique<Class>(p); \
72 amrex::ignore_unused(p); \
73 return std::make_unique<Class>(); \
The inputs of the atmosphere side of the flood coupling.
std::vector< std::string > flood_engine_names()
Names erf.flood.engine accepts, sorted; empty when no engine is compiled in.
Definition: ERF_FloodEngineRegistry.cpp:15
std::unique_ptr< FloodEngine > make_flood_engine(const std::string &name, const FloodCouplingParams ¶ms)
The engine erf.flood.engine names, or nullptr when no engine has that name.
Definition: ERF_FloodEngineRegistry.cpp:21
std::function< std::unique_ptr< FloodEngine >(const FloodCouplingParams &)> FloodEngineCreator
Creates an engine from the coupling inputs.
Definition: ERF_FloodEngineRegistry.H:40
bool register_flood_engine(const std::string &name, FloodEngineCreator creator)
Add an engine to the registry; aborts on a name registered twice.
Definition: ERF_FloodEngineRegistry.cpp:9
The interface between the flood coupling and a flood engine.
std::string name
Definition: ERF_Plotfile2DCatalog.cpp:139
Definition: ERF_FloodCouplingParams.H:20