|
ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
|
The fire engines compiled into this executable. More...
#include <ERF_FireCouplingParams.H>#include <ERF_FireEngine.H>#include <AMReX.H>#include <functional>#include <memory>#include <string>#include <type_traits>#include <vector>

Go to the source code of this file.
Macros | |
| #define | ERF_FIRE_ENGINE_CONCAT_(a, b) a##b |
| #define | ERF_FIRE_ENGINE_CONCAT(a, b) ERF_FIRE_ENGINE_CONCAT_(a, b) |
| #define | ERF_REGISTER_FIRE_ENGINE(Class, name) |
| Register engine class Class under name: erf.fire.engine = name selects it. Class is constructed from the coupling inputs, Class(const FireCouplingParams&), or default-constructed when it has no such constructor. More... | |
Typedefs | |
| using | FireEngineCreator = std::function< std::unique_ptr< FireEngine >(const FireCouplingParams &)> |
| Creates an engine from the coupling inputs. More... | |
Functions | |
| bool | register_fire_engine (const std::string &name, FireEngineCreator creator) |
| Add an engine to the registry; aborts on a name registered twice. More... | |
| std::vector< std::string > | fire_engine_names () |
| Names erf.fire.engine accepts, sorted; empty when no engine is compiled in. More... | |
| std::unique_ptr< FireEngine > | make_fire_engine (const std::string &name, const FireCouplingParams ¶ms) |
| The engine erf.fire.engine names, or nullptr when no engine has that name. More... | |
The fire engines compiled into this executable.
ERF lists no engine itself. Each engine registers itself from its own .cpp with
ERF_REGISTER_FIRE_ENGINE(MyEngine, "myengine")
at namespace scope, and erf.fire.engine then selects it by that name. The engine's directory (FIRE_HOME in GNU make, ERF_FIRE_ENGINE_DIRS in CMake) adds that .cpp to the build, so adding an engine changes no file of ERF.
The registration runs during static initialisation, so the .cpp that holds it must be linked as an object file: inside a static archive (.a) that nothing else references, the linker drops it and the engine is missing. ERF's CMake build compiles engines into its OBJECT library, and GNU make links every object, so both keep it; an engine that ships a prebuilt library keeps its registering .cpp as source (LSFIRE's wrapper does).
| #define ERF_FIRE_ENGINE_CONCAT | ( | a, | |
| b | |||
| ) | ERF_FIRE_ENGINE_CONCAT_(a, b) |
| #define ERF_FIRE_ENGINE_CONCAT_ | ( | a, | |
| b | |||
| ) | a##b |
| #define ERF_REGISTER_FIRE_ENGINE | ( | Class, | |
| name | |||
| ) |
Register engine class Class under name: erf.fire.engine = name selects it. Class is constructed from the coupling inputs, Class(const FireCouplingParams&), or default-constructed when it has no such constructor.
| using FireEngineCreator = std::function<std::unique_ptr<FireEngine>(const FireCouplingParams&)> |
Creates an engine from the coupling inputs.
| std::vector<std::string> fire_engine_names | ( | ) |
Names erf.fire.engine accepts, sorted; empty when no engine is compiled in.
Referenced by FireCouplingParams::read().

| std::unique_ptr<FireEngine> make_fire_engine | ( | const std::string & | name, |
| const FireCouplingParams & | params | ||
| ) |
The engine erf.fire.engine names, or nullptr when no engine has that name.
Referenced by ERF::initializeFire().

| bool register_fire_engine | ( | const std::string & | name, |
| FireEngineCreator | creator | ||
| ) |
Add an engine to the registry; aborts on a name registered twice.
Called by ERF_REGISTER_FIRE_ENGINE; returns true so the macro can hold the result in a static variable.