Finite Element Domain Decomposition Library
FEDDLib
Loading...
Searching...
No Matches
NonLinearSolver_decl.hpp
1#ifndef NONLINEARSOLVER_DECL_hpp
2#define NONLINEARSOLVER_DECL_hpp
3#include "feddlib/problems/problems_config.h"
4#include "feddlib/problems/abstract/NonLinearProblem.hpp"
5#include "feddlib/problems/abstract/TimeProblem.hpp"
6#ifdef FEDD_HAVE_NOX
7#include <NOX.H>
8#include <NOX_Thyra.H>
9#include <NOX_SolverStats.hpp>
10#endif
19
29
30namespace FEDD{
31template <class SC = default_sc, class LO = default_lo, class GO = default_go, class NO = default_no>
32class NonLinearSolver {
33
34public:
35
36 typedef Problem<SC,LO,NO,GO> Problem_Type;
37 typedef Teuchos::RCP<Problem_Type> ProblemPtr_Type;
38
39 typedef TimeProblem<SC,LO,GO,NO> TimeProblem_Type;
40 typedef NonLinearProblem<SC,LO,GO,NO> NonLinearProblem_Type;
41
42 typedef typename Problem_Type::Matrix_Type Matrix_Type;
43 typedef typename Problem_Type::MatrixPtr_Type MatrixPtr_Type;
44
45 typedef Teuchos::RCP<ExporterTxt> ExporterTxtPtr_Type;
46
47 NonLinearSolver();
48
50 NonLinearSolver(std::string type);
51
52 ~NonLinearSolver();
53
59 void solve(NonLinearProblem_Type& problem,vec_dbl_ptr_Type valuesForExport = Teuchos::null );
60
67 void solve(TimeProblem_Type& problem, double time=0., vec_dbl_ptr_Type valuesForExport = Teuchos::null );
68
70 int getNonLinIts() {return nonLinearIts_;}
71private:
72#ifdef FEDD_HAVE_NOX
78 void solveNOX(NonLinearProblem_Type& problem,vec_dbl_ptr_Type valuesForExport = Teuchos::null);
79
85 void solveNOX( TimeProblem_Type& problem, vec_dbl_ptr_Type valuesForExport = Teuchos::null );
86
87#endif
93 void solveFixedPoint(NonLinearProblem_Type& problem,vec_dbl_ptr_Type valuesForExport = Teuchos::null);
94
100 void solveNewton(NonLinearProblem_Type& problem, vec_dbl_ptr_Type valuesForExport = Teuchos::null );
101
107 void solveFixedPoint(TimeProblem_Type& problem, double time);
108
115 void solveNewton(TimeProblem_Type& problem, double time, vec_dbl_ptr_Type valuesForExport = Teuchos::null );
116
123 void solveExtrapolation(TimeProblem_Type& problem, double time);
124
125 std::string type_;
126
127 int nonLinearIts_ =0;
128
129
130};
131}
132#endif
Definition NonLinearProblem_decl.hpp:24
int getNonLinIts()
return the number of nonlinear iterations needed
Definition NonLinearSolver_decl.hpp:70
void solve(NonLinearProblem_Type &problem, vec_dbl_ptr_Type valuesForExport=Teuchos::null)
Call for solving a nonlinear problem, depending on linearization solveNOX/solveFixedPoint/solveNewton...
Definition NonLinearSolver_def.hpp:33
Definition Problem_decl.hpp:40
Definition TimeProblem_decl.hpp:33
Adaptive Mesh Refinement.
Definition AdaptiveMeshRefinement_decl.hpp:33