Thyra_DefaultRealLinearSolverBuilder.hpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef THYRA_DEFAULT_REAL_LINEAR_SOLVER_BUILDING_BASE
00030 #define THYRA_DEFAULT_REAL_LINEAR_SOLVER_BUILDING_BASE
00031
00032 #include "Stratimikos_ConfigDefs.hpp"
00033 #include "Thyra_LinearSolverBuilderBase.hpp"
00034 #include "Teuchos_AbstractFactory.hpp"
00035 #include "Teuchos_StandardMemberCompositionMacros.hpp"
00036
00037 namespace Teuchos { class CommandLineProcessor; }
00038
00039 namespace Thyra {
00040
00069 class DefaultRealLinearSolverBuilder : public LinearSolverBuilderBase<double>
00070 {
00071 public:
00072
00075
00083 DefaultRealLinearSolverBuilder(
00084 const std::string ¶msXmlFileName = ""
00085 ,const std::string &extraParamsXmlString = ""
00086 ,const std::string ¶msUsedXmlOutFileName = ""
00087 ,const std::string ¶msXmlFileNameOption = "linear-solver-params-file"
00088 ,const std::string &extraParamsXmlStringOption = "extra-linear-solver-params"
00089 ,const std::string ¶msUsedXmlOutFileNameOption = "linear-solver-params-used-file"
00090 );
00091
00093 ~DefaultRealLinearSolverBuilder();
00094
00098 STANDARD_MEMBER_COMPOSITION_MEMBERS(std::string,paramsXmlFileName);
00099
00103 STANDARD_MEMBER_COMPOSITION_MEMBERS(std::string,extraParamsXmlString);
00104
00108 STANDARD_MEMBER_COMPOSITION_MEMBERS(std::string,paramsUsedXmlOutFileName);
00109
00113 STANDARD_MEMBER_COMPOSITION_MEMBERS(std::string,paramsXmlFileNameOption);
00114
00118 STANDARD_MEMBER_COMPOSITION_MEMBERS(std::string,extraParamsXmlStringOption);
00119
00123 STANDARD_MEMBER_COMPOSITION_MEMBERS(std::string,paramsUsedXmlOutFileNameOption);
00124
00126 void setLinearSolveStrategyFactory(
00127 const Teuchos::RCP<const Teuchos::AbstractFactory<LinearOpWithSolveFactoryBase<double> > > &solveStrategyFactory
00128 ,const std::string &solveStrategyName
00129 );
00130
00132 void setPreconditioningStrategyFactory(
00133 const Teuchos::RCP<const Teuchos::AbstractFactory<PreconditionerFactoryBase<double> > > &precStrategyFactory
00134 ,const std::string &precStrategyName
00135 );
00136
00153 void setupCLP( Teuchos::CommandLineProcessor *clp );
00154
00173 void readParameters( std::ostream *out );
00174
00190 void writeParamsFile(
00191 const LinearOpWithSolveFactoryBase<double> &lowsFactory
00192 ,const std::string &outputXmlFileName = ""
00193 ) const;
00194
00198 std::string getLinearSolveStrategyName() const;
00199
00203 std::string getPreconditionerStrategyName() const;
00204
00206
00209
00211 void setParameterList(Teuchos::RCP<Teuchos::ParameterList> const& paramList);
00213 Teuchos::RCP<Teuchos::ParameterList> getParameterList();
00215 Teuchos::RCP<Teuchos::ParameterList> unsetParameterList();
00217 Teuchos::RCP<const Teuchos::ParameterList> getParameterList() const;
00219 Teuchos::RCP<const Teuchos::ParameterList> getValidParameters() const;
00220
00222
00225
00227 Teuchos::RCP<LinearOpWithSolveFactoryBase<double> >
00228 createLinearSolveStrategy(
00229 const std::string &linearSolveStrategyName
00230 ) const;
00232 Teuchos::RCP<PreconditionerFactoryBase<double> >
00233 createPreconditioningStrategy(
00234 const std::string &preconditioningStrategyName
00235 ) const;
00236
00238
00239 private:
00240
00241
00242
00243
00244 typedef Teuchos::RCP<const Teuchos::AbstractFactory<LinearOpWithSolveFactoryBase<double> > > lowsf_fcty_t;
00245 typedef Teuchos::RCP<const Teuchos::AbstractFactory<PreconditionerFactoryBase<double> > > pf_fcty_t;
00246
00247
00248
00249
00250 Teuchos::RCP<Teuchos::ParameterList> paramList_;
00251 mutable Teuchos::RCP<const Teuchos::ParameterList> validParamList_;
00252 Teuchos::Array<std::string> validLowsfNames_;
00253 Teuchos::Array<lowsf_fcty_t> lowsfArray_;
00254 std::string defaultLOWSF_;
00255 Teuchos::Array<std::string> validPfNames_;
00256 Teuchos::Array<pf_fcty_t> pfArray_;
00257 std::string defaultPF_;
00258 bool enableDelayedSolverConstruction_;
00259
00260
00261
00262
00263 void initializeDefaults();
00264
00265 };
00266
00267 }
00268
00269 #endif // THYRA_DEFAULT_REAL_LINEAR_SOLVER_BUILDING_BASE