Stratimikos  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Thyra_AmesosLinearOpWithSolveFactory.hpp
1 // @HEADER
2 // *****************************************************************************
3 // Stratimikos: Thyra-based strategies for linear solvers
4 //
5 // Copyright 2006 NTESS and the Stratimikos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef THYRA_AMESOS_LINEAR_OP_WITH_SOLVE_FACTORY_HPP
11 #define THYRA_AMESOS_LINEAR_OP_WITH_SOLVE_FACTORY_HPP
12 
13 #include "Thyra_LinearOpWithSolveFactoryBase.hpp"
14 #include "Thyra_AmesosTypes.hpp"
15 #include "Amesos_BaseSolver.h"
16 #include "Thyra_EpetraOperatorViewExtractorBase.hpp"
17 #include "Teuchos_StandardMemberCompositionMacros.hpp"
18 #include "Teuchos_StandardCompositionMacros.hpp"
19 
20 namespace Thyra {
21 
49 public:
50 
53 
55  static const std::string SolverType_name;
57  static const std::string RefactorizationPolicy_name;
59  static const std::string ThrowOnPreconditionerInput_name;
61  static const std::string Amesos_Settings_name;
62 
64 
67 
70 
74  const Amesos::ESolverType solverType
75 #ifdef HAVE_AMESOS_KLU
76  = Amesos::KLU
77 #else
78  = Amesos::LAPACK
79 #endif
80  ,const Amesos::ERefactorizationPolicy refactorizationPolicy = Amesos::REPIVOT_ON_REFACTORIZATION
81  ,const bool throwOnPrecInput = true
82  );
83 
93 
95 
98 
102  bool isCompatible( const LinearOpSourceBase<double> &fwdOpSrc ) const;
103 
106 
108  void initializeOp(
109  const Teuchos::RCP<const LinearOpSourceBase<double> > &fwdOpSrc
111  ,const ESupportSolveUse supportSolveUse
112  ) const;
113 
115  bool supportsPreconditionerInputType(const EPreconditionerInputType precOpType) const;
116 
121  const Teuchos::RCP<const LinearOpSourceBase<double> > &fwdOpSrc
122  ,const Teuchos::RCP<const PreconditionerBase<double> > &prec
124  ,const ESupportSolveUse supportSolveUse
125  ) const;
126 
131  const Teuchos::RCP<const LinearOpSourceBase<double> > &fwdOpSrc
132  ,const Teuchos::RCP<const LinearOpSourceBase<double> > &approxFwdOpSrc
134  ,const ESupportSolveUse supportSolveUse
135  ) const;
136 
138  void uninitializeOp(
140  ,Teuchos::RCP<const LinearOpSourceBase<double> > *fwdOpSrc
142  ,Teuchos::RCP<const LinearOpSourceBase<double> > *approxFwdOpSrc
143  ,ESupportSolveUse *supportSolveUse
144  ) const;
145 
147 
150 
161 
163 
166 
168  std::string description() const;
169 
171 
172 private:
173 
174  // /////////////////////////
175  // Private data members
176 
177  Amesos::ESolverType solverType_;
178  Amesos::ERefactorizationPolicy refactorizationPolicy_;
179  bool throwOnPrecInput_;
181 
182  // /////////////////////////
183  // Private member functions
184 
186  generateAndGetValidParameters();
187 
188 };
189 
190 } // namespace Thyra
191 
192 #endif // THYRA_AMESOS_LINEAR_OP_WITH_SOLVE_FACTORY_HPP
Concrete LinearOpWithSolveFactoryBase adapter subclass that uses Amesos direct solvers.
bool supportsPreconditionerInputType(const EPreconditionerInputType precOpType) const
Returns false .
bool isCompatible(const LinearOpSourceBase< double > &fwdOpSrc) const
Returns true if dynamic_cast&lt;const EpetraLinearOpBase*&gt;(fwdOpSrc)!=NULL .
Teuchos::RCP< const Teuchos::ParameterList > getParameterList() const
void setParameterList(Teuchos::RCP< Teuchos::ParameterList > const &paramList)
Teuchos::RCP< Teuchos::ParameterList > getNonconstParameterList()
void uninitializeOp(LinearOpWithSolveBase< double > *Op, Teuchos::RCP< const LinearOpSourceBase< double > > *fwdOpSrc, Teuchos::RCP< const PreconditionerBase< double > > *prec, Teuchos::RCP< const LinearOpSourceBase< double > > *approxFwdOpSrc, ESupportSolveUse *supportSolveUse) const
ESupportSolveUse
Teuchos::RCP< LinearOpWithSolveBase< double > > createOp() const
void initializeOp(const Teuchos::RCP< const LinearOpSourceBase< double > > &fwdOpSrc, LinearOpWithSolveBase< double > *Op, const ESupportSolveUse supportSolveUse) const
void initializePreconditionedOp(const Teuchos::RCP< const LinearOpSourceBase< double > > &fwdOpSrc, const Teuchos::RCP< const PreconditionerBase< double > > &prec, LinearOpWithSolveBase< double > *Op, const ESupportSolveUse supportSolveUse) const
Throws exception if this-&gt;throwOnPrecInput()==true and calls this-&gt;initializeOp(fwdOpSrc,Op) otherwise.
AmesosLinearOpWithSolveFactory(const Amesos::ESolverType solverType=Amesos::LAPACK, const Amesos::ERefactorizationPolicy refactorizationPolicy=Amesos::REPIVOT_ON_REFACTORIZATION, const bool throwOnPrecInput=true)
Constructor which sets the defaults.
EPreconditionerInputType
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
STANDARD_COMPOSITION_MEMBERS(EpetraOperatorViewExtractorBase, epetraFwdOpViewExtractor)
Set the strategy object used to extract an Epetra_Operator view of an input forward operator...
Teuchos::RCP< Teuchos::ParameterList > unsetParameterList()

Generated on Thu Nov 21 2024 09:22:16 for Stratimikos by doxygen 1.8.5