Thyra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Thyra_DefaultNonlinearSolverBuilder.hpp
1 // @HEADER
2 // *****************************************************************************
3 // Thyra: Interfaces and Support for Abstract Numerical Algorithms
4 //
5 // Copyright 2004 NTESS and the Thyra contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef THYRA_DEFAULT_NONLINEAR_SOLVER_BUILDER_HPP
11 #define THYRA_DEFAULT_NONLINEAR_SOLVER_BUILDER_HPP
12 
13 #include "Thyra_NonlinearSolverBuilderBase.hpp"
14 #include "Teuchos_AbstractFactory.hpp"
15 
16 
17 namespace Thyra {
18 
19 
30  : public Thyra::NonlinearSolverBuilderBase<double>
31 {
32 public:
33 
36 
39 
42 
45  const RCP<const AbstractFactory<Thyra::NonlinearSolverBase<double> > >
46  &nonlinearSolverFactory,
47  const std::string &nonlinearSolverTypeName
48  );
49 
53  std::string getNonlinearSolverName() const;
54 
56 
59 
61  void setParameterList(RCP<ParameterList> const& paramList);
70 
72 
75 
78  createNonlinearSolver(const std::string &nonlinearSolverTypeName) const;
79 
81 
82 private:
83 
84  // //////////////////////////////////////
85  // Private types
86 
88  ns_fcty_t;
89 
90  // //////////////////////////////////////
91  // Private data members
92 
93  RCP<ParameterList> paramList_;
94  mutable RCP<const ParameterList> validParamList_;
95  Array<std::string> validNonlinearSolverNames_;
96  Array<ns_fcty_t> nonlinearSolverArray_;
97  std::string defaultNonlinearSolverName_;
98 
99  // //////////////////////////////////////
100  // Private member functions
101 
102  void initializeDefaults();
103 
104 };
105 
106 
107 } // namespace Thyra
108 
109 
113 template<class NonlinearSolverType, class Scalar>
114 void setNonlinearSolverFactory(
115  const std::string &nonlinearSolverTypeName,
116  const Ptr<DefaultNonlinearSolverBuilder<Scalar> > &defaultNonlinearSolverBuilder
117  )
118 {
120 }
121 
122 
123 #endif // THYRA_DEFAULT_NONLINEAR_SOLVER_BUILDER_HPP
RCP< ParameterList > getNonconstParameterList()
std::string getNonlinearSolverName() const
Get the name of the NonlinearSolver type that will be created on the next call to this-&gt;createNonline...
RCP< const ParameterList > getValidParameters() const
RCP< const ParameterList > getParameterList() const
Base class for all nonlinear equation solvers.
RCP< ParameterList > unsetParameterList()
void setParameterList(RCP< ParameterList > const &paramList)
Concrete subclass of Thyra::NonlinearSolverBuilderBase for creating NonlinearSolverBase objects and P...
virtual Teuchos::RCP< NonlinearSolverBase< Scalar > > createNonlinearSolver(const std::string &nonlinearSolverTypeName) const
void setNonlinearSolverFactory(const RCP< const AbstractFactory< Thyra::NonlinearSolverBase< double > > > &nonlinearSolverFactory, const std::string &nonlinearSolverTypeName)
Set a new NonlinearSolverBase factory object.
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)