/usr/include/trilinos/CNOX_Interface.hpp is in libtrilinos-dev 10.4.0.dfsg-1ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | #ifdef HAVE_CTRILINOS_EXPERIMENTAL
#ifndef CNOX_INTERFACE_HPP
#define CNOX_INTERFACE_HPP
// Interface to the NLS_PetraGroup to provide for
// residual and matrix fill routines.
// ---------- Standard Includes ----------
#include <iostream>
#include "Epetra_Operator.h"
#include "Epetra_Vector.h"
#include "Epetra_Import.h"
#include "LOCA_Epetra.H"
#include "LOCA_Parameter_Vector.H"
/*!
\brief General NOX/LOCA Epetra Interface class for use in
C and Fortran codes in Matrix-Free mode.
The residual and (optional) preconditioner functions call back
using function pointers supplied by the user. This class is used
in conjunction with the functions in CNOX_Driver.cpp.
*/
class CNOX_Interface :
public LOCA::Epetra::Interface::Required,
public NOX::Epetra::Interface::Preconditioner,
public Epetra_Operator
{
public:
CNOX_Interface(int* nelems, double* statevector,
const LOCA::ParameterVector& pVector_,
const Epetra_Comm& comm_,
void* blackbox_res, void* blackbox_prec,
void (*residualFunction)(double *, double *, int, void *),
void (*precFunction)(double *, double *, int, double*, void *));
~CNOX_Interface();
//! Compute and return F
bool computeF(const Epetra_Vector& x, Epetra_Vector& F, FillType flag);
//! Set a parameter in the user's code.
void setParameters(const LOCA::ParameterVector& params);
//! Print solution to output file
virtual void printSolution(const Epetra_Vector& x, double conParam);
//! Application Operator: Object that points to the user's evaluation routines.
/*! This is used to point to the actual routines and to store
* auxiliary data required by the user's application for function/Jacobian
* evaluations that NOX does not need to know about. This is type of
* passdown class design by the application code.
*/
Teuchos::RCP<Epetra_Vector> getVector() const;
// 1 Method for inheritance from NOX::Epetra::Interface::Preconditioner
// Compute preconditioner \f$M\f$.
virtual bool computePreconditioner(const Epetra_Vector& x,
Epetra_Operator& Prec,
Teuchos::ParameterList* p = 0);
// 10 Methods for inheritance from Epetra_Operator
// Only ApplyInverse is non-trivial -- first 9 satisfied here in header
int SetUseTranspose(bool UseTranspose)
{ cerr<<"ERROR: No noxlocainterface::SetUseTranspose"<<endl; return -1;};
int Apply(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const
{ cerr<<"ERROR: No noxlocainterface::Apply"<<endl; return -1;};
double NormInf() const
{ cerr<<"ERROR: No noxlocainterface::Apply"<<endl; return 1.0;};
const char* Label() const { return "noxlocainterface::user preconditioner";};
bool UseTranspose() const { return false;};
bool HasNormInf() const { return false;};
const Epetra_Comm& Comm() const {return comm;};
const Epetra_Map& OperatorDomainMap() const {return *globalMap;};
const Epetra_Map& OperatorRangeMap() const {return *globalMap;};
void resetBlackbox(void* blackbox_res_, void* blackbox_prec_) {
blackbox_res=blackbox_res_; blackbox_prec=blackbox_prec_; }
//! Apply the preconditioner
int ApplyInverse(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const;
private:
int N;
const Epetra_Comm& comm;
Teuchos::RCP<Epetra_Vector> solution;
//Teuchos::RCP<Epetra_Vector> global_solution;
//Teuchos::RCP<Epetra_Import> global_importer;
Teuchos::RCP<Epetra_Map> globalMap;
LOCA::ParameterVector pVector;
void* blackbox_res;
void* blackbox_prec;
void (*residualFunction)(double *, double *, int, void *);
void (*precFunction)(double *, double *, int, double*, void *);
};
#endif
#endif //HAVE_CTRILINOS_EXPERIMENTAL
|