![]() |
Hex
1.0
Hydrogen-electron collision solver
|
Preconditioner traits. More...
#include <preconditioners.h>
Public Types | |
typedef std::tuple < ILUCGPreconditioner, NoPreconditioner, CGPreconditioner, JacobiCGPreconditioner, GPUCGPreconditioner, SSORCGPreconditioner > | AvailableTypes |
List of available preconditioners. More... | |
Static Public Member Functions | |
static size_t | size () |
Number of available preconditioners. More... | |
template<int i = 0> | |
static std::enable_if<(i < std::tuple_size < AvailableTypes >::value), PreconditionerBase * >::type | choose (Parallel const &par, InputFile const &inp, std::vector< std::pair< int, int >> const &ll, Bspline const &bspline, CommandLine const &cmd) |
Return pointer to new preconditioner object. More... | |
template<int i = 0> | |
static std::enable_if<(i==std::tuple_size < AvailableTypes >::value), PreconditionerBase * >::type | choose (Parallel const &par, InputFile const &inp, std::vector< std::pair< int, int >> const &ll, Bspline const &bspline, CommandLine const &cmd) |
template<int i = 0> | |
static std::enable_if<(i < std::tuple_size < AvailableTypes >::value), int >::type | findByName (std::string name) |
Find preconditioner by name. More... | |
template<int i = 0> | |
static std::enable_if<(i==std::tuple_size < AvailableTypes >::value), int >::type | findByName (std::string name) |
template<int i = 0> | |
static std::enable_if<(i < std::tuple_size < AvailableTypes >::value), std::string >::type | name (unsigned idx) |
Get name of the preconditioner. More... | |
template<int i = 0> | |
static std::enable_if<(i==std::tuple_size < AvailableTypes >::value), std::string >::type | name (unsigned idx) |
template<int i = 0> | |
static std::enable_if<(i < std::tuple_size < AvailableTypes >::value), std::string >::type | description (unsigned idx) |
Get description of the preconditioner. More... | |
template<int i = 0> | |
static std::enable_if<(i==std::tuple_size < AvailableTypes >::value), std::string >::type | description (unsigned idx) |
This class is used for accessing all available preconditioners. Preconditioner types and objects are never accessed in any other way than by calling the member functions of this class or through the pointer retrieved from the method "choose".
For this reason, addition of a new preconditioner is very simple. One just needs to derive the new preconditioner class from PreconditionerBase, specify a name to be used on command line as static attribute (see code below) and add the class name to the tuple AvailableTypes.
typedef std::tuple< ILUCGPreconditioner, NoPreconditioner, CGPreconditioner, JacobiCGPreconditioner, GPUCGPreconditioner, SSORCGPreconditioner > Preconditioners::AvailableTypes |
First one (ILUCGPreconditioner at the moment) is considered default. This tuple is the only place that has to be modified when adding a new preconditioner to Hex-ECS (besides the obvious declaration and definition somewhere in reach, ideally in "preconditioners.h" and "preconditioners.cpp").
|
inlinestatic |
The preconditioner index from CommandLine::preconditioner is used to choose the correct preconditioner.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Return index of the corresponding preconditioner in AvailableTypes or (-1) if none such exists. "Corresponding preconditioner" is such type that has a static member
equal to the argument of this function.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |