14 #if !defined(KRATOS_LINEAR_SOLVER_FACTORY_H_INCLUDED )
15 #define KRATOS_LINEAR_SOLVER_FACTORY_H_INCLUDED
60 template<
typename TSparseSpace,
typename TLocalSpace>
102 std::string solver_name = Settings[
"solver_type"].
GetString();
105 solver_name = solver_name.substr(solver_name.find(
'.') + 1);
108 <<
"Trying to construct a Linear solver with solver_type:\n\""
109 << solver_name <<
"\" which does not exist.\n"
110 <<
"The list of available options (for currently loaded applications) is:\n"
114 return aux.CreateSolver( Settings );
128 KRATOS_ERROR <<
"Calling the base class LinearSolverFactory" << std::endl;
144 template<
typename TSparseSpace,
typename TLocalSpace>
148 rOStream <<
"LinearSolverFactory" << std::endl;
161 #ifdef KRATOS_REGISTER_LINEAR_SOLVER
162 #undef KRATOS_REGISTER_LINEAR_SOLVER
164 #define KRATOS_REGISTER_LINEAR_SOLVER(name, reference) \
165 KratosComponents<LinearSolverFactoryType>::Add(name, reference);
174 #ifdef KRATOS_REGISTER_COMPLEX_LINEAR_SOLVER
175 #undef KRATOS_REGISTER_COMPLEX_LINEAR_SOLVER
177 #define KRATOS_REGISTER_COMPLEX_LINEAR_SOLVER(name, reference) \
178 KratosComponents<ComplexLinearSolverFactoryType>::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 linear solvers.
Definition: linear_solver_factory.h:62
KRATOS_CLASS_POINTER_DEFINITION(LinearSolverFactory)
Pointer definition of LinearSolverFactory.
virtual bool Has(const std::string SolverType) const
This method checks if the linear solver is registered.
Definition: linear_solver_factory.h:91
LinearSolverFactory< TSparseSpace, TLocalSpace > FactoryType
The definition of the custom class.
Definition: linear_solver_factory.h:68
virtual ~LinearSolverFactory()
Definition: linear_solver_factory.h:77
virtual LinearSolver< TSparseSpace, TLocalSpace >::Pointer CreateSolver(Kratos::Parameters Settings) const
This method is an auxiliar method to create a new solver.
Definition: linear_solver_factory.h:126
virtual LinearSolver< TSparseSpace, TLocalSpace >::Pointer Create(Kratos::Parameters Settings) const
This method creates a new solver.
Definition: linear_solver_factory.h:100
Base class for all the linear solvers in Kratos.
Definition: linear_solver.h:65
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
std::string GetString() const
This method returns the string contained in the current Parameter.
Definition: kratos_parameters.cpp:684
A class template for handling data types, matrices, and vectors in a Ublas space.
Definition: ublas_space.h:121
#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
TUblasSparseSpace< std::complex< double > > ComplexSparseSpaceType
Definition: linear_solver_factory.h:167
LinearSolverFactory< ComplexSparseSpaceType, ComplexLocalSparseSpaceType > ComplexLinearSolverFactoryType
Definition: linear_solver_factory.h:170
TUblasDenseSpace< std::complex< double > > ComplexLocalSparseSpaceType
Definition: linear_solver_factory.h:168
TUblasSparseSpace< double > SparseSpaceType
Definition: linear_solver_factory.h:154
LinearSolverFactory< SparseSpaceType, LocalSparseSpaceType > LinearSolverFactoryType
Definition: linear_solver_factory.h:157
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
string SolverType
Definition: fluid_only_var.py:5