ZeroDimensionalRythmosSolverInterface.hpp 2.94 KB
Newer Older
1
2
//@HEADER
/*
3
 *******************************************************************************
4

5
6
 Copyright (C) 2004, 2005, 2007 EPFL, Politecnico di Milano, INRIA
 Copyright (C) 2010 EPFL, Politecnico di Milano, Emory University
7

8
 This file is part of LifeV.
9

10
11
12
13
 LifeV is free software; you can redistribute it and/or modify
 it under the terms of the GNU Lesser General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.
14

15
16
17
18
 LifeV is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 Lesser General Public License for more details.
19

20
21
 You should have received a copy of the GNU Lesser General Public License
 along with LifeV.  If not, see <http://www.gnu.org/licenses/>.
22

23
24
 *******************************************************************************
 */
25
26
27
28
//@HEADER

/*!
 *  @file
Cristiano Malossi's avatar
Cristiano Malossi committed
29
 *  @brief Rythmos solver Interface.
30
 *  @version alpha (experimental)
31
32
33
34
 *
 *  @date 21-11-2011
 *  @author Mahmoud Jafargholi
 *
35
36
 *  @contributors Cristiano Malossi <cristiano.malossi@epfl.ch>
 *  @mantainer    Cristiano Malossi <cristiano.malossi@epfl.ch>
37
38
39
40
41
 */

#ifndef ZeroDimensionalRythmosSolverInterface_H
#define ZeroDimensionalRythmosSolverInterface_H 1

42
#include <lifev/zero_dimensional/solver/ZeroDimensionalRythmosModelInterface.hpp>
43

44
#if ( defined(HAVE_NOX_THYRA) && defined(HAVE_TRILINOS_RYTHMOS) )
45
46
namespace LifeV
{
47
//! Rythmos solver interface.
48
49
50
/*!
 * This class will communicate with with Rythmos solver and model interface.
 */
51
52
53
class RythmosSolverInterface : public EpetraExt::ModelEvaluator {
public:

54
    // Constructor
55
    RythmosSolverInterface(Int numCircuitElements,
56
57
            Teuchos::RCP<Epetra_Comm> &epetra_comm_ptr,
            rythmosModelInterfacePtrRCP_Type theModel);
58

59
60
    // Initialization
    void initialize();
61

62
    Teuchos::RCP<const Epetra_Map> get_x_map() const;
63

64
    Teuchos::RCP<const Epetra_Map> get_f_map() const;
65

66
    Teuchos::RCP<const Epetra_Vector> get_x_init() const;
67

68
    Teuchos::RCP<const Epetra_Vector> get_x_dot_init() const;
69

70
    Teuchos::RCP<Epetra_Operator> create_W() const;
71

72
    InArgs createInArgs() const;
73

74
    OutArgs createOutArgs() const;
75

76
    void evalModel( const InArgs& inArgs, const OutArgs& outArgs ) const;
77
78
79

private:

80
81
82
83
84
85
    Teuchos::RCP<Epetra_Comm>            M_epetraCommPtr;
    Teuchos::RCP<const Epetra_Map>       M_epetraMapPtr;
    Int                                  M_numElements;
    Teuchos::RCP<Epetra_CrsGraph>        M_Wgraph;
    rythmosModelInterfacePtrRCP_Type     M_problemInterfacePtr;
    Teuchos::RCP<Epetra_Comm>            M_comm;
86
87
};

88
89
typedef boost::shared_ptr< RythmosSolverInterface > rythmosSolverInterfacePtr_Type;
typedef Teuchos::RCP< RythmosSolverInterface > rythmosSolverInterfacePtrRCP_Type;
90
91
92

} // LifeV namespace

93
94
#endif /* HAVE_NOX_THYRA && HAVE_TRILINOS_RYTHMOS */

95
#endif //ZeroDimensionalRythmosSolverInterface_H