Stratimikos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Thyra_Amesos2LinearOpWithSolveFactory_decl.hpp
Go to the documentation of this file.
1 /*
2 // @HEADER
3 // ***********************************************************************
4 //
5 // Stratimikos: Thyra-based strategies for linear solvers
6 // Copyright (2006) Sandia Corporation
7 //
8 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
9 // license for use of this work by or on behalf of the U.S. Government.
10 //
11 // Redistribution and use in source and binary forms, with or without
12 // modification, are permitted provided that the following conditions are
13 // met:
14 //
15 // 1. Redistributions of source code must retain the above copyright
16 // notice, this list of conditions and the following disclaimer.
17 //
18 // 2. Redistributions in binary form must reproduce the above copyright
19 // notice, this list of conditions and the following disclaimer in the
20 // documentation and/or other materials provided with the distribution.
21 //
22 // 3. Neither the name of the Corporation nor the names of the
23 // contributors may be used to endorse or promote products derived from
24 // this software without specific prior written permission.
25 //
26 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 //
38 // Questions? Contact Roscoe A. Bartlett (rabartl@sandia.gov)
39 //
40 // ***********************************************************************
41 // @HEADER
42 */
43 
44 #ifndef THYRA_AMESOS2_LINEAR_OP_WITH_SOLVE_FACTORY_DECL_HPP
45 #define THYRA_AMESOS2_LINEAR_OP_WITH_SOLVE_FACTORY_DECL_HPP
46 
47 #include "Thyra_LinearOpWithSolveFactoryBase.hpp"
49 #include "Thyra_Amesos2Types.hpp"
50 #include "Amesos2.hpp"
51 #include "Amesos2_Version.hpp"
57 
58 namespace Thyra {
59 
60 template<typename Scalar>
61 class Amesos2LinearOpWithSolveFactory : public LinearOpWithSolveFactoryBase<Scalar> {
62 public:
67 
70 
72  static const std::string SolverType_name;
74  static const std::string RefactorizationPolicy_name;
76  static const std::string ThrowOnPreconditionerInput_name;
78  static const std::string Amesos2_Settings_name;
79 
81 
84 
87 
91  const Amesos2::ESolverType solverType
92 #ifdef HAVE_AMESOS2_KLU2
93  = Amesos2::KLU2,
94 #else
96 #endif
97  const Amesos2::ERefactorizationPolicy refactorizationPolicy
99  const bool throwOnPrecInput = true
100  );
101 
103 
106 
108  bool isCompatible( const LinearOpSourceBase<Scalar> &fwdOpSrc ) const;
109 
112 
114  void initializeOp(
115  const Teuchos::RCP<const LinearOpSourceBase<Scalar> > &fwdOpSrc,
116  LinearOpWithSolveBase<Scalar> *Op,
117  const ESupportSolveUse supportSolveUse
118  ) const;
119 
121  bool supportsPreconditionerInputType(const EPreconditionerInputType precOpType) const;
122 
127  const Teuchos::RCP<const LinearOpSourceBase<Scalar> > &fwdOpSrc,
128  const Teuchos::RCP<const PreconditionerBase<Scalar> > &prec,
129  LinearOpWithSolveBase<Scalar> *Op,
130  const ESupportSolveUse supportSolveUse
131  ) const;
132 
137  const Teuchos::RCP<const LinearOpSourceBase<Scalar> > &fwdOpSrc,
138  const Teuchos::RCP<const LinearOpSourceBase<Scalar> > &approxFwdOpSrc,
139  LinearOpWithSolveBase<Scalar> *Op,
140  const ESupportSolveUse supportSolveUse
141  ) const;
142 
144  void uninitializeOp(
145  LinearOpWithSolveBase<Scalar> *Op,
146  Teuchos::RCP<const LinearOpSourceBase<Scalar> > *fwdOpSrc,
147  Teuchos::RCP<const PreconditionerBase<Scalar> > *prec,
148  Teuchos::RCP<const LinearOpSourceBase<Scalar> > *approxFwdOpSrc,
149  ESupportSolveUse *supportSolveUse
150  ) const;
151 
153 
156 
167 
169 
172 
174  std::string description() const;
175 
177 
178 private:
179 
180  // /////////////////////////
181  // Private data members
182 
187 
188  // /////////////////////////
189  // Private member functions
190 
193 
194 };
195 
196 } // namespace Thyra
197 
198 #endif // THYRA_AMESOS2_LINEAR_OP_WITH_SOLVE_FACTORY_HPP
Teuchos::RCP< Teuchos::ParameterList > getNonconstParameterList()
static Teuchos::RCP< const Teuchos::ParameterList > generateAndGetValidParameters()
Teuchos::RCP< LinearOpWithSolveBase< Scalar > > createOp() const
typename Amesos2LinearOpWithSolve< Scalar >::ConverterT ConverterT
void initializeOp(const Teuchos::RCP< const LinearOpSourceBase< Scalar > > &fwdOpSrc, LinearOpWithSolveBase< Scalar > *Op, const ESupportSolveUse supportSolveUse) const
void initializePreconditionedOp(const Teuchos::RCP< const LinearOpSourceBase< Scalar > > &fwdOpSrc, const Teuchos::RCP< const PreconditionerBase< Scalar > > &prec, LinearOpWithSolveBase< Scalar > *Op, const ESupportSolveUse supportSolveUse) const
Throws exception if this-&gt;throwOnPrecInput()==true and calls this-&gt;initializeOp(fwdOpSrc,Op) otherwise.
Completely new pivoting will be used on refactorizations!
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
ERefactorizationPolicy
The policy used on refactoring a matrix.
typename Amesos2LinearOpWithSolve< Scalar >::MAT MAT
void setParameterList(Teuchos::RCP< Teuchos::ParameterList > const &paramList)
typename Amesos2LinearOpWithSolve< Scalar >::Solver Solver
typename Amesos2LinearOpWithSolve< Scalar >::MV MV
bool isCompatible(const LinearOpSourceBase< Scalar > &fwdOpSrc) const
Teuchos::RCP< const Teuchos::ParameterList > getParameterList() const
bool supportsPreconditionerInputType(const EPreconditionerInputType precOpType) const
Returns false .
Amesos2LinearOpWithSolveFactory(const Amesos2::ESolverType solverType=Amesos2::LAPACK, const Amesos2::ERefactorizationPolicy refactorizationPolicy=Amesos2::REPIVOT_ON_REFACTORIZATION, const bool throwOnPrecInput=true)
Constructor which sets the defaults.
void uninitializeOp(LinearOpWithSolveBase< Scalar > *Op, Teuchos::RCP< const LinearOpSourceBase< Scalar > > *fwdOpSrc, Teuchos::RCP< const PreconditionerBase< Scalar > > *prec, Teuchos::RCP< const LinearOpSourceBase< Scalar > > *approxFwdOpSrc, ESupportSolveUse *supportSolveUse) const