Thyra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Thyra_LinearSolverBuilderBase.hpp
1 // @HEADER
2 // *****************************************************************************
3 // Thyra: Interfaces and Support for Abstract Numerical Algorithms
4 //
5 // Copyright 2004 NTESS and the Thyra contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef THYRA_LINEAR_SOLVER_BUILDING_BASE
11 #define THYRA_LINEAR_SOLVER_BUILDING_BASE
12 
13 #include "Teuchos_ParameterListAcceptor.hpp"
14 #include "Thyra_LinearOpWithSolveFactoryBase.hpp"
15 
16 
17 namespace Thyra {
18 
19 
27 template<class Scalar>
29 {
30 public:
31 
45  const std::string &linearSolveStrategyName ) const = 0;
46 
61  const std::string &preconditioningStrategyName ) const = 0;
62 
63  /* \brief Create a new LinearOpWithSolveFactory object given a typical
64  * forward linear operator and a typical solve criteria.
65  *
66  * \param typicalFwdOp
67  * [in] A typical forward linear operator that represents the types of
68  * operator that will be used to solve linear system.
69  * \param typicalSolveCriteria
70  * [in] A typical solve criteria that will be used to solve for linear
71  * systems.
72  * \param typicalSolveUse
73  * [in] Determines how the solver will be used.
74  * \param solveStrategy
75  * [out] The LOWSF object that was determined to be the best suited for solving
76  * the typical system given above.
77  * \param initialLOWS
78  * [out] The LOWS object that was created that is consistent with the returned
79  * solve strategy. If <tt>initialLOWS->get()==NULL</tt> on return then there is no
80  * such object returned.
81  * \param setupTime
82  * [out] The amount of time it took to setup the solver <tt>*initalLOWS</tt> before
83  * a solve was performed.
84  * \param solveTime
85  * [out] The amount of time it took to solve a typical linear system for the
86  * returned <tt>*initalLOWS</tt> object.
87  *
88  * ToDo: Finish documentation!
89  */
90  /*
91  virtual void createSmartSolveStrategy(
92  const Teuchos::RCP<LinearOpBase<Scalar> &typicalFwdOp
93  ,const SolveCritiera<Scalar> &typicalSolveCriteria
94  ,const ESupportSolveUse &typicalSolveUse
95  ,Teuchos::RCP<LinearOpWithSolveFactoryBase<Scalar> > *solveStrategy
96  ,Teuchos::RCP<Teuchos::ParameterList> *solveStrategyParameters
97  ,Teuchos::RCP<LinearOpWithSolveBase<Scalar> > *initialLOWS
98  ,double *setupTime
99  ,double *solveTime
100  ) const = 0;
101  */
102 
103 private:
104 
105  // Not defined and not to be called
107  operator=(const LinearSolverBuilderBase<Scalar>&);
108 
109 };
110 
111 
116 template<class Scalar>
119  const LinearSolverBuilderBase<Scalar> &linearSolverBuilder,
120  const std::string &linearSolveStrategyName = ""
121  )
122 {
123  return linearSolverBuilder.createLinearSolveStrategy(
124  linearSolveStrategyName );
125 }
126 
127 
132 template<class Scalar>
135  const LinearSolverBuilderBase<Scalar> &linearSolverBuilder,
136  const std::string &preconditioningStrategyName = ""
137  )
138 {
139  return linearSolverBuilder.createPreconditioningStrategy(
140  preconditioningStrategyName );
141 }
142 
143 
144 } // namespace Thyra
145 
146 #endif // THYRA_LINEAR_SOLVER_BUILDING_BASE
virtual Teuchos::RCP< LinearOpWithSolveFactoryBase< Scalar > > createLinearSolveStrategy(const std::string &linearSolveStrategyName) const =0
Create a new LinearOpWithSolveFactoryBase object purely specified by the parameter list...
Teuchos::RCP< PreconditionerFactoryBase< Scalar > > createPreconditioningStrategy(const LinearSolverBuilderBase< Scalar > &linearSolverBuilder, const std::string &preconditioningStrategyName="")
virtual Teuchos::RCP< PreconditionerFactoryBase< Scalar > > createPreconditioningStrategy(const std::string &preconditioningStrategyName) const =0
Create a new PreconditionerFactoryBase object purely specified by the parameter list.
Teuchos::RCP< LinearOpWithSolveFactoryBase< Scalar > > createLinearSolveStrategy(const LinearSolverBuilderBase< Scalar > &linearSolverBuilder, const std::string &linearSolveStrategyName="")
Abstract interface for an object that can create LinearOpWithSolveFactoryBase objects on demand...