39 #ifndef ZeroDimensionalRythmosModelInterface_H 40 #define ZeroDimensionalRythmosModelInterface_H 1
43 #include <lifev/zero_dimensional/solver/ZeroDimensionalDefinitions.hpp> 45 #if ( defined(HAVE_NOX_THYRA) && defined(HAVE_TRILINOS_RYTHMOS) ) 49 #include <NOX_Epetra.H> 50 #include <NOX_Epetra_Interface_Required.H> 51 #include <NOX_Epetra_Interface_Jacobian.H> 52 #include <NOX_Epetra_Interface_Preconditioner.H> 53 #include <NOX_Thyra.H> 57 #include <lifev/zero_dimensional/solver/ZeroDimensionalCircuitData.hpp> 75 class RythmosModelInterface :
public NOX::Epetra::Interface::Required,
76 public NOX::Epetra::Interface::Jacobian,
77 public NOX::Epetra::Interface::Preconditioner
82 RythmosModelInterface (Int NumGlobalElements, Epetra_Comm* comm, zeroDimensionalCircuitDataPtr_Type circuitData);
85 virtual ~RythmosModelInterface();
88 virtual bool computeF (
const Epetra_Vector& x, Epetra_Vector& FVec, FillType fillType = Residual);
91 virtual bool computeJacobian (
const Epetra_Vector& x, Epetra_Operator& Jac);
94 virtual bool computePrecMatrix (
const Epetra_Vector& x);
97 virtual bool computePreconditioner (
const Epetra_Vector& x, Epetra_Operator& Prec, Teuchos::ParameterList* precParams = 0);
100 Epetra_Vector& getSolutionY();
103 Epetra_Vector& getSolutionYp();
105 Epetra_Map& getMap();
107 Epetra_CrsGraph& getGraph();
110 virtual bool evaluate (Real t,
const Epetra_Vector* x, Epetra_Vector* f );
113 virtual bool evaluateFImplicit (
const Real& t,
const Epetra_Vector* x,
const Epetra_Vector* x_dot, Epetra_Vector* f );
116 virtual bool evaluateWImplicit (
const Real& t,
const Real& alpha,
const Real& beta,
const Epetra_Vector* x,
const Epetra_Vector* x_dot, Epetra_CrsMatrix* W );
118 virtual bool initializeSolnY();
120 bool initializeSolnY (
const vectorEpetra_Type& y);
122 virtual bool initializeSolnYp();
124 bool initializeSolnYp (
const vectorEpetra_Type& yp);
127 void extractSolution (
const Real& t1,
const vectorEpetra_Type& y ,
const vectorEpetra_Type& yp );
129 Int numCircuitElements()
131 return M_numCircuitElements;
135 Int M_numCircuitElements;
140 Epetra_CrsGraph* M_graph;
141 std::shared_ptr<Epetra_CrsGraph> M_graphSharedPtr;
143 std::shared_ptr<Epetra_Comm> M_commSharedPtr;
144 Epetra_Map* M_standardMap;
145 Epetra_Vector* M_initialSolutionY;
146 Epetra_Vector* M_initialSolutionYp;
148 zeroDimensionalCircuitDataPtr_Type M_circuitData;
152 vectorEpetraPtr_Type M_Y0;
153 vectorEpetraPtr_Type M_Yp0;
154 std::shared_ptr<MapEpetra> M_mapEpetraPtr;
155 vectorEpetraPtr_Type M_fA;
156 vectorEpetraPtr_Type M_fB;
159 typedef std::shared_ptr< RythmosModelInterface > rythmosModelInterfacePtr_Type;
160 typedef Teuchos::RCP< RythmosModelInterface > rythmosModelInterfacePtrRCP_Type;