| 1 |
// @HEADER |
| 2 |
// ***************************************************************************** |
| 3 |
// LOCA: Library of Continuation Algorithms Package |
| 4 |
// |
| 5 |
// Copyright 2001-2005 NTESS and the LOCA contributors. |
| 6 |
// SPDX-License-Identifier: BSD-3-Clause |
| 7 |
// ***************************************************************************** |
| 8 |
// @HEADER |
| 9 |
|
| 10 |
//----------------------------------------------------------------------------- |
| 11 |
#ifndef Problem_Interface_H |
| 12 |
#define Problem_Interface_H |
| 13 |
|
| 14 |
// Interface to the NOX_Epetra_Group to provide for |
| 15 |
// residual and matrix fill routines. |
| 16 |
|
| 17 |
// ---------- Standard Includes ---------- |
| 18 |
#include <iostream> |
| 19 |
#include "Epetra_Vector.h" |
| 20 |
#include "Epetra_Operator.h" |
| 21 |
#include "Epetra_RowMatrix.h" |
| 22 |
#include "LOCA_Parameter_Vector.H" |
| 23 |
#include "LOCA_Epetra_Interface_Required.H" // base class |
| 24 |
#include "NOX_Epetra_Interface_Jacobian.H" // base class |
| 25 |
#include "LOCA_Epetra_Interface_TimeDependent.H" // base class |
| 26 |
|
| 27 |
// ---------- Forward Declarations ---------- |
| 28 |
class Brusselator; |
| 29 |
|
| 30 |
class Problem_Interface : public virtual LOCA::Epetra::Interface::Required, |
| 31 |
public NOX::Epetra::Interface::Jacobian, |
| 32 |
public LOCA::Epetra::Interface::TimeDependent |
| 33 |
{ |
| 34 |
public: |
| 35 |
Problem_Interface(Brusselator& Problem); |
| 36 |
~Problem_Interface(); |
| 37 |
|
| 38 |
//! Compute and return F (LOCA::Epetra::Interface::Required) |
| 39 |
bool computeF(const Epetra_Vector& x, Epetra_Vector& FVec, |
| 40 |
NOX::Epetra::Interface::Required::FillType fillType); |
| 41 |
|
| 42 |
//! Compute an explicit Jacobian (NOX::Epetra::Interface::Jacobian) |
| 43 |
bool computeJacobian(const Epetra_Vector& x, Epetra_Operator& Jac); |
| 44 |
|
| 45 |
//! Set a parameter in the user's code. (LOCA::Epetra::Interface::Required) |
| 46 |
void setParameters(const LOCA::ParameterVector& params); |
| 47 |
|
| 48 |
/*! |
| 49 |
* \brief Call user routine for computing the shifted matrix |
| 50 |
* \f$\alpha J + \beta M\f$ where \f$J\f$ is the Jacobian matrix |
| 51 |
* and \f$M\f$ is the mass matrix. |
| 52 |
*/ |
| 53 |
virtual bool |
| 54 |
computeShiftedMatrix(double alpha, double beta, const Epetra_Vector& x, |
| 55 |
Epetra_Operator& A); |
| 56 |
|
| 57 |
//! Application Operator: Object that points to the user's evaluation routines. |
| 58 |
/*! This is used to point to the actual routines and to store |
| 59 |
* auxiliary data required by the user's application for function/Jacobian |
| 60 |
* evaluations that NOX does not need to know about. This is type of |
| 61 |
* passdown class design by the application code. |
| 62 |
*/ |
| 63 |
Brusselator& problem; |
| 64 |
}; |
| 65 |
|
| 66 |
#endif |
| 67 |
|