| 1 |
// @HEADER |
| 2 |
// ***************************************************************************** |
| 3 |
// NOX: An Object-Oriented Nonlinear Solver Package |
| 4 |
// |
| 5 |
// Copyright 2002 NTESS and the NOX contributors. |
| 6 |
// SPDX-License-Identifier: BSD-3-Clause |
| 7 |
// ***************************************************************************** |
| 8 |
// @HEADER |
| 9 |
|
| 10 |
// ---------- Includes ---------- |
| 11 |
#include <iostream> |
| 12 |
#include "Problem_Interface.H" |
| 13 |
|
| 14 |
// ---------- User Defined Includes ---------- |
| 15 |
#include "GenericEpetraProblem.H" |
| 16 |
#include "Problem_Manager.H" |
| 17 |
|
| 18 |
//----------------------------------------------------------------------------- |
| 19 |
Problem_Interface::Problem_Interface(GenericEpetraProblem& Problem) : |
| 20 |
problem(Problem) |
| 21 |
{ } |
| 22 |
|
| 23 |
Problem_Interface::~Problem_Interface() |
| 24 |
{ } |
| 25 |
|
| 26 |
bool Problem_Interface::computeF(const Epetra_Vector& x, Epetra_Vector& FVec, FillType flag) |
| 27 |
{ |
| 28 |
return problem.evaluate(flag, &x, &FVec); |
| 29 |
} |
| 30 |
|
| 31 |
bool Problem_Interface::computeJacobian(const Epetra_Vector& x, |
| 32 |
Epetra_Operator& Jac) |
| 33 |
{ |
| 34 |
return problem.evaluate(NOX::Epetra::Interface::Required::Jac, &x, 0); |
| 35 |
} |
| 36 |
|
| 37 |
bool Problem_Interface::computePrecMatrix(const Epetra_Vector& x) |
| 38 |
{ |
| 39 |
return problem.evaluate(NOX::Epetra::Interface::Required::Prec, &x, 0); |
| 40 |
} |
| 41 |
bool Problem_Interface::computePreconditioner(const Epetra_Vector& x, |
| 42 |
Epetra_Operator& Prec, |
| 43 |
Teuchos::ParameterList* precParams) |
| 44 |
{ |
| 45 |
// Pass through to let the Problem fill its owned matrix |
| 46 |
return problem.evaluate(NOX::Epetra::Interface::Required::Jac, &x, 0); |
| 47 |
} |
| 48 |
//----------------------------------------------------------------------------- |
| 49 |
|