10 #ifndef STRATIMIKOS_LINEAR_SOLVER_BUILDING_BASE
11 #define STRATIMIKOS_LINEAR_SOLVER_BUILDING_BASE
13 #include "Stratimikos_ConfigDefs.hpp"
14 #include "Thyra_LinearSolverBuilderBase.hpp"
15 #include "Teuchos_AbstractFactory.hpp"
16 #include "Teuchos_StandardMemberCompositionMacros.hpp"
17 #include "Teuchos_StandardParameterEntryValidators.hpp"
20 #ifdef HAVE_STRATIMIKOS_THYRAEPETRAADAPTERS
22 #include "Thyra_EpetraLinearOp.hpp"
24 #include "Thyra_LinearOpWithSolveFactoryHelpers.hpp"
25 #include "Thyra_LinearOpWithSolveBase.hpp"
26 #include "Thyra_PreconditionerFactoryHelpers.hpp"
27 #include "Thyra_DefaultScaledAdjointLinearOp.hpp"
28 #include "Thyra_DefaultPreconditioner.hpp"
29 #include "Thyra_MultiVectorStdOps.hpp"
30 #include "Thyra_VectorStdOps.hpp"
31 #include "Thyra_VectorBase.hpp"
34 namespace Teuchos {
class CommandLineProcessor; }
37 namespace Stratimikos {
86 template <
class Scalar =
double>
103 const std::string ¶msXmlFileName =
"",
104 const std::string &extraParamsXmlString =
"",
105 const std::string ¶msUsedXmlOutFileName =
"",
106 const std::string ¶msXmlFileNameOption =
"linear-solver-params-file",
107 const std::string &extraParamsXmlStringOption =
"extra-linear-solver-params",
108 const std::string ¶msUsedXmlOutFileNameOption =
"linear-solver-params-used-file",
109 const bool &replaceDuplicateFactories =
true
153 &solveStrategyFactory,
154 const std::string &solveStrategyName,
155 const bool makeDefault =
false
160 const std::string &solveStrategyName);
165 &precStrategyFactory,
166 const std::string &precStrategyName,
167 const bool makeDefault =
false
172 const std::string &precStrategyName);
229 const std::string &outputXmlFileName =
""
266 const std::string &linearSolveStrategyName
271 const std::string &preconditioningStrategyName
292 std::string defaultLOWSF_;
295 std::string defaultPF_;
296 bool enableDelayedSolverConstruction_;
304 void initializeDefaults();
305 void justInTimeInitialize()
const;
307 int getAndAssertExistingFactoryNameIdx(
const std::string &setFunctionName,
313 namespace LinearSolverBuilderHelpers {
323 int existingNameIndex(
333 #endif // STRATIMIKOS_LINEAR_SOLVER_BUILDING_BASE
RCP< ParameterList > getNonconstParameterList()
RCP< ParameterList > unsetParameterList()
RCP< const ParameterList > getParameterList() const
STANDARD_MEMBER_COMPOSITION_MEMBERS(std::string, paramsXmlFileName)
The name an XML file that will be read to get XML parameters (if not "").
LinearSolverBuilder(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", const bool &replaceDuplicateFactories=true)
Construct with default parameters.
void setLinearSolveStrategyFactory(const RCP< const AbstractFactory< Thyra::LinearOpWithSolveFactoryBase< Scalar > > > &solveStrategyFactory, const std::string &solveStrategyName, const bool makeDefault=false)
Set a new linear solver strategy factory object.
void setDefaultLinearSolveStrategyFactoryName(const std::string &solveStrategyName)
Set the default linear solver factory name.
RCP< Thyra::PreconditionerFactoryBase< Scalar > > createPreconditioningStrategy(const std::string &preconditioningStrategyName) const
std::string getPreconditionerStrategyName() const
Get the name of the preconditioner strategy that will be created on the next call to this->createPrec...
void readParameters(std::ostream *out)
Force the parameters to be read from a file and/or an extra XML string.
void setPreconditioningStrategyFactory(const RCP< const AbstractFactory< Thyra::PreconditionerFactoryBase< Scalar > > > &precStrategyFactory, const std::string &precStrategyName, const bool makeDefault=false)
Set a new preconditioner strategy factory object.
void setParameterList(RCP< ParameterList > const ¶mList)
std::string getLinearSolveStrategyName() const
Get the name of the linear solver strategy that will be created on the next call to this->createLinea...
RCP< Thyra::LinearOpWithSolveFactoryBase< Scalar > > createLinearSolveStrategy(const std::string &linearSolveStrategyName) const
Concrete subclass of Thyra::LinearSolverBuilderBase for creating Thyra::LinearOpWithSolveFactoryBase ...
void setDefaultPreconditioningStrategyFactoryName(const std::string &precStrategyName)
Set the default linear solver factory name.
void writeParamsFile(const Thyra::LinearOpWithSolveFactoryBase< Scalar > &lowsFactory, const std::string &outputXmlFileName="") const
Write the parameters list for a LinearOpWithSolveFactoryBase object to a file after the parameters ar...
void setupCLP(Teuchos::CommandLineProcessor *clp)
Setup the command-line processor to read in the needed data to extra the parameters from...
RCP< const ParameterList > getValidParameters() const