A factory function to select and create a screening model.
This function returns a std::unique_ptr to a concrete implementation of the ScreeningModel abstract base class, based on the specified ScreeningType. This allows for easy switching between different screening prescriptions at runtime.
- Parameters
-
| type | The ScreeningType enum value specifying which model to create. |
- Returns
- A
std::unique_ptr<ScreeningModel> holding an instance of the requested screening model.
Algorithm The function uses a switch statement to determine which concrete model to instantiate. If the provided type does not match a known case, it defaults to creating a BareScreeningModel to ensure safe behavior.
Post-conditions
Usage
std::vector<double> factors = screening_model->calculateScreeningFactors(
reactions, species, Y, T9, rho
);
std::unique_ptr< ScreeningModel > selectScreeningModel(ScreeningType type)
A factory function to select and create a screening model.
Definition screening_types.cpp:9
@ WEAK
Weak screening model (Salpeter, 1954).