10 #ifndef STRATIMIKOS_LINEAR_SOLVER_BUILDING_BASE
11 #define STRATIMIKOS_LINEAR_SOLVER_BUILDING_BASE
14 #include "Thyra_LinearSolverBuilderBase.hpp"
20 #ifdef HAVE_STRATIMIKOS_THYRAEPETRAADAPTERS
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>
88 :
public Thyra::LinearSolverBuilderBase<Scalar>
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);
228 const Thyra::LinearOpWithSolveFactoryBase<Scalar> &lowsFactory,
229 const std::string &outputXmlFileName =
""
266 const std::string &linearSolveStrategyName
271 const std::string &preconditioningStrategyName
313 namespace LinearSolverBuilderHelpers {
333 #endif // STRATIMIKOS_LINEAR_SOLVER_BUILDING_BASE
RCP< ParameterList > getNonconstParameterList()
void initializeDefaults()
RCP< ParameterList > unsetParameterList()
RCP< const ParameterList > getParameterList() const
Array< std::string > validLowsfNames_
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.
Array< std::string > validPfNames_
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.
void justInTimeInitialize() const
RCP< Thyra::PreconditionerFactoryBase< Scalar > > createPreconditioningStrategy(const std::string &preconditioningStrategyName) const
RCP< const Teuchos::StringToIntegralParameterEntryValidator< int > > lowsfValidator_
std::string getPreconditionerStrategyName() const
Get the name of the preconditioner strategy that will be created on the next call to this->createPrec...
RCP< const Teuchos::StringToIntegralParameterEntryValidator< int > > pfValidator_
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
Array< lowsf_fcty_t > lowsfArray_
RCP< ParameterList > paramList_
int getAndAssertExistingFactoryNameIdx(const std::string &setFunctionName, const Teuchos::ArrayView< std::string > namesArray, const std::string &name) const
Array< pf_fcty_t > pfArray_
Concrete subclass of Thyra::LinearSolverBuilderBase for creating Thyra::LinearOpWithSolveFactoryBase ...
bool enableDelayedSolverConstruction_
RCP< const AbstractFactory< Thyra::LinearOpWithSolveFactoryBase< Scalar > > > lowsf_fcty_t
std::string defaultLOWSF_
void setDefaultPreconditioningStrategyFactoryName(const std::string &precStrategyName)
Set the default linear solver factory name.
RCP< const ParameterList > validParamList_
RCP< const AbstractFactory< Thyra::PreconditionerFactoryBase< Scalar > > > pf_fcty_t
int existingNameIndex(const Teuchos::ArrayView< std::string > namesArray, const std::string &name)
Return the index of a name in an array of names.
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