42 #ifndef STRATIMIKOS_DEFAULT_LINEAR_SOLVER_BUILDING_BASE 43 #define STRATIMIKOS_DEFAULT_LINEAR_SOLVER_BUILDING_BASE 45 #include "Stratimikos_ConfigDefs.hpp" 46 #include "Thyra_LinearSolverBuilderBase.hpp" 47 #include "Teuchos_AbstractFactory.hpp" 48 #include "Teuchos_StandardMemberCompositionMacros.hpp" 49 #include "Teuchos_StandardParameterEntryValidators.hpp" 52 #include "Thyra_EpetraThyraWrappers.hpp" 53 #include "Thyra_EpetraLinearOp.hpp" 54 #include "Thyra_LinearOpWithSolveFactoryHelpers.hpp" 55 #include "Thyra_LinearOpWithSolveBase.hpp" 56 #include "Thyra_PreconditionerFactoryHelpers.hpp" 57 #include "Thyra_DefaultScaledAdjointLinearOp.hpp" 58 #include "Thyra_DefaultPreconditioner.hpp" 59 #include "Thyra_MultiVectorStdOps.hpp" 60 #include "Thyra_VectorStdOps.hpp" 61 #include "Thyra_VectorBase.hpp" 64 namespace Teuchos {
class CommandLineProcessor; }
75 using Teuchos::AbstractFactory;
77 using Teuchos::ParameterList;
117 :
public Thyra::LinearSolverBuilderBase<double>
132 const std::string ¶msXmlFileName =
"" 133 ,
const std::string &extraParamsXmlString =
"" 134 ,
const std::string ¶msUsedXmlOutFileName =
"" 135 ,
const std::string ¶msXmlFileNameOption =
"linear-solver-params-file" 136 ,
const std::string &extraParamsXmlStringOption =
"extra-linear-solver-params" 137 ,
const std::string ¶msUsedXmlOutFileNameOption =
"linear-solver-params-used-file" 175 const RCP<
const AbstractFactory<Thyra::LinearOpWithSolveFactoryBase<double> > >
176 &solveStrategyFactory,
177 const std::string &solveStrategyName,
178 const bool makeDefault =
false 183 const std::string &solveStrategyName);
187 const RCP<
const AbstractFactory<Thyra::PreconditionerFactoryBase<double> > >
188 &precStrategyFactory,
189 const std::string &precStrategyName,
190 const bool makeDefault =
false 195 const std::string &precStrategyName);
213 void setupCLP( Teuchos::CommandLineProcessor *clp );
251 const Thyra::LinearOpWithSolveFactoryBase<double> &lowsFactory,
252 const std::string &outputXmlFileName =
"" 287 RCP<Thyra::LinearOpWithSolveFactoryBase<double> >
289 const std::string &linearSolveStrategyName
292 RCP<Thyra::PreconditionerFactoryBase<double> >
294 const std::string &preconditioningStrategyName
304 typedef RCP<const AbstractFactory<Thyra::LinearOpWithSolveFactoryBase<double> > >
306 typedef RCP<const AbstractFactory<Thyra::PreconditionerFactoryBase<double> > >
312 RCP<ParameterList> paramList_;
313 Array<std::string> validLowsfNames_;
314 Array<lowsf_fcty_t> lowsfArray_;
315 std::string defaultLOWSF_;
316 Array<std::string> validPfNames_;
317 Array<pf_fcty_t> pfArray_;
318 std::string defaultPF_;
319 bool enableDelayedSolverConstruction_;
320 mutable RCP<const ParameterList> validParamList_;
321 mutable RCP<const Teuchos::StringToIntegralParameterEntryValidator<int> > lowsfValidator_;
322 mutable RCP<const Teuchos::StringToIntegralParameterEntryValidator<int> > pfValidator_;
327 void initializeDefaults();
328 void justInTimeInitialize()
const;
336 #endif // STRATIMIKOS_DEFAULT_LINEAR_SOLVER_BUILDING_BASE RCP< Thyra::PreconditionerFactoryBase< double > > createPreconditioningStrategy(const std::string &preconditioningStrategyName) const
void setPreconditioningStrategyFactory(const RCP< const AbstractFactory< Thyra::PreconditionerFactoryBase< double > > > &precStrategyFactory, const std::string &precStrategyName, const bool makeDefault=false)
Set a new preconditioner strategy factory object.
RCP< const ParameterList > getValidParameters() const
STANDARD_MEMBER_COMPOSITION_MEMBERS(std::string, paramsXmlFileName)
The name an XML file that will be read to get XML parameters (if not "").
void setupCLP(Teuchos::CommandLineProcessor *clp)
Setup the command-line processor to read in the needed data to extra the parameters from...
void setDefaultLinearSolveStrategyFactoryName(const std::string &solveStrategyName)
Set the default linear solver factory name.
RCP< Thyra::LinearOpWithSolveFactoryBase< double > > createLinearSolveStrategy(const std::string &linearSolveStrategyName) const
void setParameterList(RCP< ParameterList > const ¶mList)
void readParameters(std::ostream *out)
Force the parameters to be read from a file and/or an extra XML string.
std::string getPreconditionerStrategyName() const
Get the name of the preconditioner strategy that will be created on the next call to this->createPrec...
RCP< const ParameterList > getParameterList() const
Concrete subclass of Thyra::LinearSolverBuilderBase for creating LinearOpWithSolveFactoryBase objects...
RCP< ParameterList > unsetParameterList()
~DefaultLinearSolverBuilder()
RCP< ParameterList > getNonconstParameterList()
void writeParamsFile(const Thyra::LinearOpWithSolveFactoryBase< double > &lowsFactory, const std::string &outputXmlFileName="") const
Write the parameters list for a LinearOpWithSolveFactoryBase object to a file after the parameters ar...
DefaultLinearSolverBuilder(const std::string ¶msXmlFileName="", const std::string &extraParamsXmlString="", const std::string ¶msUsedXmlOutFileName="", const std::string ¶msXmlFileNameOption="linear-solver-params-file", const std::string &extraParamsXmlStringOption="extra-linear-solver-params", const std::string ¶msUsedXmlOutFileNameOption="linear-solver-params-used-file")
Construct with default parameters.
void setLinearSolveStrategyFactory(const RCP< const AbstractFactory< Thyra::LinearOpWithSolveFactoryBase< double > > > &solveStrategyFactory, const std::string &solveStrategyName, const bool makeDefault=false)
Set a new linear solver strategy factory object.
std::string getLinearSolveStrategyName() const
Get the name of the linear solver strategy that will be created on the next call to this->createLinea...
void setDefaultPreconditioningStrategyFactoryName(const std::string &precStrategyName)
Set the default linear solver factory name.