14 #if !defined(KRATOS_PRECONDITIONER_FACTORY_H_INCLUDED )
15 #define KRATOS_PRECONDITIONER_FACTORY_H_INCLUDED
60 template<
typename TSparseSpace,
typename TLocalSpace>
94 virtual bool Has(
const std::string& rSolverType)
const
103 virtual typename PreconditionerType::Pointer
Create(
const std::string& rPreconditionerType)
const
107 const std::string raw_precond_name = rPreconditionerType.substr(rPreconditionerType.find(
'.') + 1);
110 <<
"Trying to construct a preconditioner with preconditioner_type:\n\""
111 << raw_precond_name <<
"\" which does not exist.\n"
112 <<
"The list of available options (for currently loaded applications) is:\n"
116 return aux.CreatePreconditioner();
129 KRATOS_ERROR <<
"calling the base class PreconditionerFactory" << std::endl;
142 template<
typename TSparseSpace,
typename TLocalSpace>
146 rOStream <<
"PreconditionerFactory" << std::endl;
160 #ifdef KRATOS_REGISTER_PRECONDITIONER
161 #undef KRATOS_REGISTER_PRECONDITIONER
163 #define KRATOS_REGISTER_PRECONDITIONER(name, reference) \
164 KratosComponents<PreconditionerFactoryType>::Add(name, reference);
KratosComponents class encapsulates a lookup table for a family of classes in a generic way.
Definition: kratos_components.h:49
static bool Has(const std::string &rName)
Check if the given name exists in the set of components.
Definition: kratos_components.h:161
static const TComponentType & Get(const std::string &rName)
Retrieves a component with the specified name.
Definition: kratos_components.h:114
Here we add the functions needed for the registration of preconditioners.
Definition: preconditioner_factory.h:62
virtual ~PreconditionerFactory()
Definition: preconditioner_factory.h:80
virtual bool Has(const std::string &rSolverType) const
This method checks if the linear solver is registered.
Definition: preconditioner_factory.h:94
virtual PreconditionerType::Pointer CreatePreconditioner() const
This method is an auxiliar method to create a new solver.
Definition: preconditioner_factory.h:127
PreconditionerFactory< TSparseSpace, TLocalSpace > FactoryType
The definition of the custom class.
Definition: preconditioner_factory.h:68
KRATOS_CLASS_POINTER_DEFINITION(PreconditionerFactory)
Pointer definition of PreconditionerFactory.
virtual PreconditionerType::Pointer Create(const std::string &rPreconditionerType) const
This method creates a new solver.
Definition: preconditioner_factory.h:103
Preconditioner< TSparseSpace, TLocalSpace > PreconditionerType
The definition of the preconditioner.
Definition: preconditioner_factory.h:71
Preconditioner class.
Definition: preconditioner.h:75
#define KRATOS_ERROR
Definition: exception.h:161
#define KRATOS_ERROR_IF_NOT(conditional)
Definition: exception.h:163
#define KRATOS_API_EXTERN
Definition: kratos_export_api.h:57
#define KRATOS_API(...)
Definition: kratos_export_api.h:40
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
PreconditionerFactory< SparseSpaceType, LocalSparseSpaceType > PreconditionerFactoryType
Definition: preconditioner_factory.h:156
TUblasSparseSpace< double > SparseSpaceType
Definition: linear_solver_factory.h:154
TUblasDenseSpace< double > LocalSparseSpaceType
Definition: linear_solver_factory.h:155
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432