LifeV
ZeroDimensionalRythmosSolverInterface.cpp
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  *
31  * @date 21-11-2011
32  * @author Mahmoud Jafargholi
33  *
34  * @contributors Cristiano Malossi <cristiano.malossi@epfl.ch>
35  * @mantainer Cristiano Malossi <cristiano.malossi@epfl.ch>
36  */
37 
38 #include <lifev/zero_dimensional/solver/ZeroDimensionalRythmosSolverInterface.hpp>
39 
40 namespace LifeV
41 {
42 
43 #if ( defined(HAVE_NOX_THYRA) && defined(HAVE_TRILINOS_RYTHMOS) )
44 // ===================================================
45 // Constructors
46 // ===================================================
51 {
52  initialize();
53 }
54 
56 {
59 }
60 
61 // Overridden from EpetraExt::ModelEvaluator
63 {
64  return M_epetraMapPtr;
65 }
66 
68 {
69  return M_epetraMapPtr;
70 }
71 
73 {
76  return x_init;
77 }
78 
80 {
83  return x_dot_init;
84 }
85 
87 {
89  *M_Wgraph ) );
90  return W;
91 }
92 
94 {
96  inArgs.setSupports ( IN_ARG_x, true );
99  inArgs.setSupports ( IN_ARG_beta, true );
100  inArgs.setSupports ( IN_ARG_t, true );
101  return inArgs;
102 }
103 
105 {
107  outArgs.setSupports ( OUT_ARG_f, true );
108  outArgs.setSupports ( OUT_ARG_W, true );
109  outArgs.setSupports ( OUT_ARG_W, true );
111  return outArgs;
112 }
113 
115  const OutArgs& outArgs ) const
116 {
117  Teuchos::RCP< const Epetra_Vector > x = inArgs.get_x();
119  Real t = inArgs.get_t();
120 
121 #ifdef HAVE_LIFEV_DEBUG
122  std::cout << "RythmosSolverInterface::evalModel ---------------------------{" << std::endl;
123  std::cout << "x = " << std::endl;
124  x->Print (std::cout);
125  std::cout << "xdot = " << std::endl;
126  xdot->Print (std::cout);
127 #endif // HAVE_LIFEV_DEBUG
128 
130  if ( ( f = outArgs.get_f() ).get() )
131  {
133 #ifdef HAVE_LIFEV_DEBUG
134  std::cout << "f = " << std::endl;
135  f->Print (std::cout);
136 #endif // HAVE_LIFEV_DEBUG
137 
138  }
140  if ( ( W = outArgs.get_W() ).get() )
141  {
142  const Real alpha = inArgs.get_alpha();
143  const Real beta = inArgs.get_beta();
146 #ifdef HAVE_LIFEV_DEBUG
147  std::cout << "jac = " << std::endl;
148  jac.Print (std::cout);
149 #endif // HAVE_LIFEV_DEBUG
150  }
151 #ifdef HAVE_LIFEV_DEBUG
152  std::cout << "RythmosSolverInterface::evalModel ---------------------------}" << std::endl;
153 #endif // HAVE_LIFEV_DEBUG
154 }
155 
156 #endif /* HAVE_NOX_THYRA && HAVE_TRILINOS_RYTHMOS */
157 
158 } // LifeV namespace
void updateInverseJacobian(const UInt &iQuadPt)