KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
trilinos_linear_solver_factory.h
Go to the documentation of this file.
1 // KRATOS _____ _ _ _
2 // |_ _| __(_) (_)_ __ ___ ___
3 // | || '__| | | | '_ \ / _ \/ __|
4 // | || | | | | | | | | (_) \__
5 // |_||_| |_|_|_|_| |_|\___/|___/ APPLICATION
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Vicente Mataix Ferrandiz
11 // Philipp Bucher
12 //
13 
14 #pragma once
15 
16 // System includes
17 
18 // External includes
19 
20 // Project includes
21 #include "includes/define.h"
22 #include "trilinos_space.h"
24 
25 namespace Kratos
26 {
29 
33 
37 
41 
45 
56 template <typename TSparseSpace, typename TLocalSpace, typename TLinearSolverType>
57 class KRATOS_API(TRILINOS_APPLICATION) TrilinosLinearSolverFactory
58  : public LinearSolverFactory<TSparseSpace,TLocalSpace>
59 {
62 
65 
67 protected:
70 
75  typename LinearSolverType::Pointer CreateSolver(Kratos::Parameters settings) const override
76  {
77  return typename LinearSolverType::Pointer(new TLinearSolverType(settings));
78  }
80 };
81 
83 
86 
90 
92 template <typename TSparseSpace, typename TLocalSpace, typename TLinearSolverType>
93 inline std::ostream& operator << (std::ostream& rOStream,
95 {
96  rOStream << "TrilinosLinearSolverFactory" << std::endl;
97  return rOStream;
98 }
99 
102 
104 
106 
109 
111 
112 #ifdef KRATOS_REGISTER_TRILINOS_LINEAR_SOLVER
113 #undef KRATOS_REGISTER_TRILINOS_LINEAR_SOLVER
114 #endif
115 #define KRATOS_REGISTER_TRILINOS_LINEAR_SOLVER(name, reference) ; \
116  KratosComponents<TrilinosLinearSolverFactoryType>::Add(name, reference);
117 
119 
120 } // namespace Kratos.
KratosComponents class encapsulates a lookup table for a family of classes in a generic way.
Definition: kratos_components.h:49
Here we add the functions needed for the registration of linear solvers.
Definition: linear_solver_factory.h:62
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
Here we add the functions needed for the registration of linear solvers.
Definition: trilinos_linear_solver_factory.h:59
LinearSolverType::Pointer CreateSolver(Kratos::Parameters settings) const override
This method is an auxiliar method to create a new solver.
Definition: trilinos_linear_solver_factory.h:75
The space adapted for Trilinos vectors and matrices.
Definition: trilinos_space.h:75
A class template for handling data types, matrices, and vectors in a Ublas space.
Definition: ublas_space.h:121
TrilinosSpace< Epetra_FECrsMatrix, Epetra_FEVector > TrilinosSparseSpaceType
Definition: trilinos_linear_solver_factory.h:107
#define KRATOS_API_EXTERN
Definition: kratos_export_api.h:57
#define KRATOS_API(...)
Definition: kratos_export_api.h:40
LinearSolver< TSpaceType< TDataType >, TLocalSpaceType< TOtherDataType > > TLinearSolverType
Definition: add_linear_solvers_to_python.cpp:50
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
UblasSpace< double, Matrix, Vector > TrilinosLocalSpaceType
Definition: trilinos_linear_solver_factory.h:108
LinearSolverFactory< TrilinosSparseSpaceType, TrilinosLocalSpaceType > TrilinosLinearSolverFactoryType
Definition: trilinos_linear_solver_factory.h:110
void RegisterTrilinosLinearSolvers()
Definition: trilinos_linear_solver_factory.cpp:41
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
LinearSolver< SparseSpaceType, LocalSpaceType > LinearSolverType
Definition: distance_smoothing_process.cpp:23