LifeV
ZeroDimensionalRythmosSolverInterface.hpp
Go to the documentation of this file.
1 //@HEADER
2 /*
3  *******************************************************************************
4 
5  Copyright (C) 2004, 2005, 2007 EPFL, Politecnico di Milano, INRIA
6  Copyright (C) 2010 EPFL, Politecnico di Milano, Emory University
7 
8  This file is part of LifeV.
9 
10  LifeV is free software; you can redistribute it and/or modify
11  it under the terms of the GNU Lesser General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14 
15  LifeV is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public License
21  along with LifeV. If not, see <http://www.gnu.org/licenses/>.
22 
23  *******************************************************************************
24  */
25 //@HEADER
26 
27 /*!
28  * @file
29  * @brief Rythmos solver Interface.
30  * @version alpha (experimental)
31  *
32  * @date 21-11-2011
33  * @author Mahmoud Jafargholi
34  *
35  * @contributors Cristiano Malossi <cristiano.malossi@epfl.ch>
36  * @mantainer Cristiano Malossi <cristiano.malossi@epfl.ch>
37  */
38 
39 #ifndef ZeroDimensionalRythmosSolverInterface_H
40 #define ZeroDimensionalRythmosSolverInterface_H 1
41 
42 #include <lifev/zero_dimensional/solver/ZeroDimensionalRythmosModelInterface.hpp>
43 
44 #if ( defined(HAVE_NOX_THYRA) && defined(HAVE_TRILINOS_RYTHMOS) )
45 namespace LifeV
46 {
47 //! Rythmos solver interface.
48 /*!
49  * This class will communicate with with Rythmos solver and model interface.
50  */
51 class RythmosSolverInterface : public EpetraExt::ModelEvaluator
52 {
53 public:
54 
55  // Constructor
56  RythmosSolverInterface (Int numCircuitElements,
57  Teuchos::RCP<Epetra_Comm>& epetra_comm_ptr,
58  rythmosModelInterfacePtrRCP_Type theModel);
59 
60  // Initialization
61  void initialize();
62 
63  Teuchos::RCP<const Epetra_Map> get_x_map() const;
64 
65  Teuchos::RCP<const Epetra_Map> get_f_map() const;
66 
67  Teuchos::RCP<const Epetra_Vector> get_x_init() const;
68 
69  Teuchos::RCP<const Epetra_Vector> get_x_dot_init() const;
70 
71  Teuchos::RCP<Epetra_Operator> create_W() const;
72 
73  InArgs createInArgs() const;
74 
75  OutArgs createOutArgs() const;
76 
77  void evalModel ( const InArgs& inArgs, const OutArgs& outArgs ) const;
78 
79 private:
80 
81  Teuchos::RCP<Epetra_Comm> M_epetraCommPtr;
82  Teuchos::RCP<const Epetra_Map> M_epetraMapPtr;
83  Int M_numElements;
84  Teuchos::RCP<Epetra_CrsGraph> M_Wgraph;
85  rythmosModelInterfacePtrRCP_Type M_problemInterfacePtr;
86  Teuchos::RCP<Epetra_Comm> M_comm;
87 };
88 
89 typedef std::shared_ptr< RythmosSolverInterface > rythmosSolverInterfacePtr_Type;
90 typedef Teuchos::RCP< RythmosSolverInterface > rythmosSolverInterfacePtrRCP_Type;
91 
92 } // LifeV namespace
93 
94 #endif /* HAVE_NOX_THYRA && HAVE_TRILINOS_RYTHMOS */
95 
96 #endif //ZeroDimensionalRythmosSolverInterface_H