Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #include "SundanceNonlinearProblem.hpp"
00032 #include "SundanceOut.hpp"
00033 #include "SundanceTabs.hpp"
00034 #include "SundanceAssembler.hpp"
00035 #include "SundanceDiscreteFunction.hpp"
00036 #include "SundanceEquationSet.hpp"
00037 #include "SundanceLinearSolveDriver.hpp"
00038
00039 #ifndef HAVE_TEUCHOS_EXPLICIT_INSTANTIATION
00040 #include "TSFLinearOperatorImpl.hpp"
00041 #endif
00042
00043
00044 using namespace Sundance;
00045 using namespace Teuchos;
00046 using namespace std;
00047 using namespace TSFExtended;
00048
00049
00050 static Time& nlpCtorTimer()
00051 {
00052 static RCP<Time> rtn
00053 = TimeMonitor::getNewTimer("NonlinearProblem ctor");
00054 return *rtn;
00055 }
00056
00057
00058 NonlinearProblem::NonlinearProblem()
00059 : op_()
00060 {
00061 TimeMonitor timer(nlpCtorTimer());
00062 }
00063
00064
00065 NonlinearProblem::NonlinearProblem(const Mesh& mesh,
00066 const Expr& eqn,
00067 const Expr& bc,
00068 const Expr& test,
00069 const Expr& unk,
00070 const Expr& u0,
00071 const VectorType<double>& vecType)
00072 : op_(rcp(new NLOp(mesh, eqn, bc, test, unk, u0, vecType)))
00073 {}
00074
00075 NonlinearProblem::NonlinearProblem(const Mesh& mesh,
00076 const Expr& eqn,
00077 const Expr& bc,
00078 const Expr& test,
00079 const Expr& unk,
00080 const Expr& u0,
00081 const Expr& params,
00082 const Expr& paramValues,
00083 const VectorType<double>& vecType)
00084 : op_(rcp(new NLOp(mesh, eqn, bc, test, unk, u0,
00085 params, paramValues, vecType)))
00086 {}
00087
00088
00089 NonlinearProblem::NonlinearProblem(const RCP<Assembler>& assembler,
00090 const Expr& u0)
00091 : op_(rcp(new NLOp(assembler, u0)))
00092 {}
00093
00094
00095
00096 NOX::StatusTest::StatusType
00097 NonlinearProblem::solve(const NOXSolver& solver) const
00098 {
00099 RCP<NonlinearOperatorBase<double> > op = op_;
00100 NonlinearOperator<double> F = op;
00101 Vector<double> soln;
00102 NOX::StatusTest::StatusType rtn = solver.solve(F, soln);
00103 F.setEvalPt(soln);
00104 return rtn;
00105 }
00106