| 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 "Brusselator.H" |
| 16 |
|
| 17 |
//----------------------------------------------------------------------------- |
| 18 |
Problem_Interface::Problem_Interface(Brusselator& Problem) : |
| 19 |
problem(Problem) |
| 20 |
{ } |
| 21 |
|
| 22 |
Problem_Interface::~Problem_Interface() |
| 23 |
{ } |
| 24 |
|
| 25 |
bool Problem_Interface::computeF(const Epetra_Vector& x, Epetra_Vector& FVec, |
| 26 |
NOX::Epetra::Interface::Required::FillType fillType) |
| 27 |
{ |
| 28 |
return problem.evaluate(fillType, &x, &FVec, NULL); |
| 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, 0); |
| 35 |
} |
| 36 |
|
| 37 |
bool Problem_Interface::computePrecMatrix(const Epetra_Vector& x, Epetra_RowMatrix& M) |
| 38 |
{ |
| 39 |
std::cout << "ERROR: Problem_Interface::preconditionVector() - Use Explicit Jacobian only for this test problem!" << std::endl; |
| 40 |
throw 1; |
| 41 |
} |
| 42 |
|
| 43 |
bool Problem_Interface::computePreconditioner(const Epetra_Vector& x, |
| 44 |
Epetra_Operator& Prec, |
| 45 |
Teuchos::ParameterList* p) |
| 46 |
{ |
| 47 |
std::cout << "ERROR: Problem_Interface::preconditionVector() - Use Explicit Jacobian only for this test problem!" << std::endl; |
| 48 |
throw 1; |
| 49 |
} |
| 50 |
//----------------------------------------------------------------------------- |
| 51 |
|