Stratimikos Version of the Day
Loading...
Searching...
No Matches
Thyra_AmesosLinearOpWithSolveFactory.hpp
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_AMESOS_LINEAR_OP_WITH_SOLVE_FACTORY_HPP
45#define THYRA_AMESOS_LINEAR_OP_WITH_SOLVE_FACTORY_HPP
46
47#include "Thyra_LinearOpWithSolveFactoryBase.hpp"
48#include "Thyra_AmesosTypes.hpp"
49#include "Amesos_BaseSolver.h"
50#include "Thyra_EpetraOperatorViewExtractorBase.hpp"
51#include "Teuchos_StandardMemberCompositionMacros.hpp"
52#include "Teuchos_StandardCompositionMacros.hpp"
53
54namespace Thyra {
55
82class AmesosLinearOpWithSolveFactory : public LinearOpWithSolveFactoryBase<double> {
83public:
84
87
89 static const std::string SolverType_name;
91 static const std::string RefactorizationPolicy_name;
93 static const std::string ThrowOnPreconditionerInput_name;
95 static const std::string Amesos_Settings_name;
96
98
101
104
108 const Amesos::ESolverType solverType
109#ifdef HAVE_AMESOS_KLU
110 = Amesos::KLU
111#else
112 = Amesos::LAPACK
113#endif
114 ,const Amesos::ERefactorizationPolicy refactorizationPolicy = Amesos::REPIVOT_ON_REFACTORIZATION
115 ,const bool throwOnPrecInput = true
116 );
117
126 STANDARD_COMPOSITION_MEMBERS( EpetraOperatorViewExtractorBase, epetraFwdOpViewExtractor );
127
129
132
136 bool isCompatible( const LinearOpSourceBase<double> &fwdOpSrc ) const;
137
139 Teuchos::RCP<LinearOpWithSolveBase<double> > createOp() const;
140
142 void initializeOp(
143 const Teuchos::RCP<const LinearOpSourceBase<double> > &fwdOpSrc
144 ,LinearOpWithSolveBase<double> *Op
145 ,const ESupportSolveUse supportSolveUse
146 ) const;
147
149 bool supportsPreconditionerInputType(const EPreconditionerInputType precOpType) const;
150
155 const Teuchos::RCP<const LinearOpSourceBase<double> > &fwdOpSrc
156 ,const Teuchos::RCP<const PreconditionerBase<double> > &prec
157 ,LinearOpWithSolveBase<double> *Op
158 ,const ESupportSolveUse supportSolveUse
159 ) const;
160
165 const Teuchos::RCP<const LinearOpSourceBase<double> > &fwdOpSrc
166 ,const Teuchos::RCP<const LinearOpSourceBase<double> > &approxFwdOpSrc
167 ,LinearOpWithSolveBase<double> *Op
168 ,const ESupportSolveUse supportSolveUse
169 ) const;
170
172 void uninitializeOp(
173 LinearOpWithSolveBase<double> *Op
174 ,Teuchos::RCP<const LinearOpSourceBase<double> > *fwdOpSrc
175 ,Teuchos::RCP<const PreconditionerBase<double> > *prec
176 ,Teuchos::RCP<const LinearOpSourceBase<double> > *approxFwdOpSrc
177 ,ESupportSolveUse *supportSolveUse
178 ) const;
179
181
184
186 void setParameterList(Teuchos::RCP<Teuchos::ParameterList> const& paramList);
188 Teuchos::RCP<Teuchos::ParameterList> getNonconstParameterList();
190 Teuchos::RCP<Teuchos::ParameterList> unsetParameterList();
192 Teuchos::RCP<const Teuchos::ParameterList> getParameterList() const;
194 Teuchos::RCP<const Teuchos::ParameterList> getValidParameters() const;
195
197
200
202 std::string description() const;
203
205
206private:
207
208 // /////////////////////////
209 // Private data members
210
211 Amesos::ESolverType solverType_;
212 Amesos::ERefactorizationPolicy refactorizationPolicy_;
213 bool throwOnPrecInput_;
214 Teuchos::RCP<Teuchos::ParameterList> paramList_;
215
216 // /////////////////////////
217 // Private member functions
218
219 static Teuchos::RCP<const Teuchos::ParameterList>
220 generateAndGetValidParameters();
221
222};
223
224} // namespace Thyra
225
226#endif // THYRA_AMESOS_LINEAR_OP_WITH_SOLVE_FACTORY_HPP
Concrete LinearOpWithSolveFactoryBase adapter subclass that uses Amesos direct solvers.
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
STANDARD_COMPOSITION_MEMBERS(EpetraOperatorViewExtractorBase, epetraFwdOpViewExtractor)
Set the strategy object used to extract an Epetra_Operator view of an input forward operator.
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->throwOnPrecInput()==true and calls this->initializeOp(fwdOpSrc,...
Teuchos::RCP< const Teuchos::ParameterList > getParameterList() const
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
bool supportsPreconditionerInputType(const EPreconditionerInputType precOpType) const
Returns false .
Teuchos::RCP< LinearOpWithSolveBase< double > > createOp() const
Teuchos::RCP< Teuchos::ParameterList > unsetParameterList()
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 LinearOpSourceBase< double > > &approxFwdOpSrc, LinearOpWithSolveBase< double > *Op, const ESupportSolveUse supportSolveUse) const
Throws exception if this->throwOnPrecInput()==true and calls this->initializeOp(fwdOpSrc,...
void setParameterList(Teuchos::RCP< Teuchos::ParameterList > const &paramList)
bool isCompatible(const LinearOpSourceBase< double > &fwdOpSrc) const
Returns true if dynamic_cast<const EpetraLinearOpBase*>(fwdOpSrc)!=NULL .
Teuchos::RCP< Teuchos::ParameterList > getNonconstParameterList()

Generated for Stratimikos by doxygen 1.9.6