/usr/include/trilinos/Pike_BlackBoxModelEvaluator_SolverAdapter.hpp is in libtrilinos-pike-dev 12.4.2-2.
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 | #ifndef PIKE_BLACK_BOX_MODEL_EVALUATOR_SOLVER_ADAPTER_HPP
#define PIKE_BLACK_BOX_MODEL_EVALUATOR_SOLVER_ADAPTER_HPP
#include "Pike_BlackBoxModelEvaluator.hpp"
#include "Teuchos_RCP.hpp"
#include <utility>
#include <string>
#include <map>
namespace pike {
class Solver;
class Response;
//! Decorator to represent a pike::Solver as a BlackBoxModelEvaluator for hierarchical solves.
class SolverAdapterModelEvaluator : public pike::BlackBoxModelEvaluator {
public:
SolverAdapterModelEvaluator(const std::string& myName);
void setSolver(const Teuchos::RCP<pike::Solver>& solver);
Teuchos::RCP<const pike::Solver> getSolver() const;
Teuchos::RCP<pike::Solver> getNonconstSolver() const;
// Derived from base
std::string name() const;
void solve();
bool isLocallyConverged() const;
bool isGloballyConverged() const;
bool supportsParameter(const std::string& pName) const;
int getNumberOfParameters() const;
std::string getParameterName(const int l) const;
int getParameterIndex(const std::string& pName) const;
void setParameter(const int l, const Teuchos::ArrayView<const double>& p);
bool supportsResponse(const std::string& rName) const;
int getNumberOfResponses() const;
std::string getResponseName(const int i) const;
int getResponseIndex(const std::string& rName) const;
Teuchos::ArrayView<const double> getResponse(const int i) const;
bool isTransient() const;
double getCurrentTime() const;
double getTentativeTime() const;
bool solvedTentativeStep() const;
double getCurrentTimeStepSize() const;
double getDesiredTimeStepSize() const;
double getMaxTimeStepSize() const;
void setNextTimeStepSize(const double& dt);
void acceptTimeStep();
private:
std::string name_;
Teuchos::RCP<pike::Solver> solver_;
std::map<std::string,int> parameterNameToIndex_;
std::vector<std::string> parameterNames_;
//! Stores the model index and the parameter index in that model for the parameter. Note that multiple underlying model evaluators can support the same parameter.
std::vector<std::vector<std::pair<int,int> > > parameterIndexToModelIndices_;
std::map<std::string,int> responseNameToIndex_;
std::vector<std::string> responseNames_;
//! Stores the model index and the response index in that model for the response.
std::vector<std::pair<int,int> > responseIndexToModelIndices_;
};
}
#endif
|