LifeV
OneDFSIFlux.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 File containing a base class for 1D model flux function.
30  *
31  * @date 15-04-2010
32  * @author Cristiano Malossi <cristiano.malossi@epfl.ch>
33  *
34  * @contributors Simone Rossi <simone.rossi@epfl.ch>, Ricardo Ruiz-Baier <ricardo.ruiz@epfl.ch>
35  * @maintainer Cristiano Malossi <cristiano.malossi@epfl.ch>
36  */
37 
38 #ifndef OneDFSIFlux_H
39 #define OneDFSIFlux_H
40 
41 #include <lifev/one_d_fsi/solver/OneDFSIPhysics.hpp>
42 
43 namespace LifeV
44 {
45 
46 //! OneDFSIFlux - Base class for the flux term \f$\mathbf F\f$ of the 1D hyperbolic problem.
47 /*!
48  * @author Cristiano Malossi
49  * @see Equations and networks of 1-D models \cite FormaggiaLamponi2003
50  * @see Geometrical multiscale coupling of 1-D models \cite Malossi2011Algorithms \cite Malossi2011Algorithms1D \cite BonnemainMalossi2012LVAD
51  *
52  * The conservative form of the generic hyperbolic problem is
53  *
54  * \f[
55  * \frac{\partial \mathbf U}{\partial t} + \frac{\partial \mathbf F(\mathbf U)}{\partial z} + \mathbf S(\mathbf U) = 0,
56  * \f]
57  *
58  * where \f$\mathbf U\f$ are the conservative variables, \f$\mathbf F\f$ the corresponding fluxes,
59  * and \f$\mathbf S\f$ represents the source terms.
60  *
61  * This class implements all the interfaces required for the computation of \f$\mathbf F\f$ and its derivatives.
62  */
64 {
65 
66 public:
67 
68  //! @name Type definitions and Enumerators
69  //@{
70 
72 
75 
76  typedef OneDFSIData::container2D_Type container2D_Type;
77 
78  //@}
79 
80 
81  //! @name Constructors & Destructor
82  //@{
83 
84  //! Empty constructor
85  explicit OneDFSIFlux() : M_physicsPtr() {}
86 
87  //! Constructor
88  /*!
89  * @param physicsPtr pointer to the physics of the problem
90  */
91  explicit OneDFSIFlux ( const physicsPtr_Type physicsPtr ) : M_physicsPtr ( physicsPtr ) {}
92 
93  //! Do nothing destructor
94  virtual ~OneDFSIFlux() {}
95 
96  //@}
97 
98 
99  //! @name Virtual Methods
100  //@{
101 
102  //! Evaluate the flux term
103  /*!
104  * @param A area
105  * @param Q flow rate
106  * @param row row of the flux term
107  * @param iNode node of the mesh
108  */
109  virtual Real flux ( const Real& A, const Real& Q, const ID& row, const UInt& iNode ) const = 0;
110 
111 
112  //! Evaluate the derivative of the flux term
113  /*!
114  * @param A area
115  * @param Q flow rate
116  * @param row row of the derivative of the flux term
117  * @param column column of the derivative of the flux term
118  * @param iNode node of the mesh
119  */
120  virtual Real dFdU ( const Real& A, const Real& Q, const ID& row, const ID& column, const UInt& iNode ) const = 0;
121 
122  //! Eigenvalues and eigenvectors of the Jacobian matrix
123  /*!
124  * @param A area
125  * @param Q flow rate
126  * @param eigenvalues eigenvalues of the Jacobian matrix
127  * @param leftEigenvector1 first row of the left eigenvector matrix
128  * @param leftEigenvector2 second row of the left eigenvector matrix
129  * @param iNode node of the mesh
130  */
131  virtual void eigenValuesEigenVectors ( const Real& A, const Real& Q,
132  container2D_Type& eigenvalues,
133  container2D_Type& leftEigenvector1,
134  container2D_Type& leftEigenvector2,
135  const UInt& iNode ) const = 0;
136 
137  //! Derivatives of the eigenvalues and eigenvectors of the derivative of the Jacobian matrix
138  /*!
139  * @param A area
140  * @param Q flow rate
141  * @param deltaEigenvalues derivative of the eigenvalues of the derivative of the Jacobian matrix
142  * @param deltaLeftEigenvector1 derivative of the first row of the left eigenvector matrix
143  * @param deltaLeftEigenvector2 derivative of the second row of the left eigenvector matrix
144  * @param iNode node of the mesh
145  */
146  virtual void deltaEigenValuesEigenVectors ( const Real& A, const Real& Q,
147  container2D_Type& deltaEigenvalues,
148  container2D_Type& deltaLeftEigenvector1,
149  container2D_Type& deltaLeftEigenvector2,
150  const UInt& iNode ) const = 0;
151 
152  //@}
153 
154 
155  //! @name Set Methods
156  //@{
157 
158  //! Set the physics of the problem.
159  /*!
160  * @param physicsPtr pointer to the physics of the problem
161  */
162  void setPhysics ( const physicsPtr_Type& physicsPtr )
163  {
164  M_physicsPtr = physicsPtr;
165  }
166 
167  //@}
168 
169 
170  //! @name Get Methods
171  //@{
172 
173  //! Get the physics of the problem.
174  /*!
175  * @return physics of the problem
176  */
178  {
179  return M_physicsPtr;
180  }
181 
182  //@}
183 
184 protected:
185 
187 
188 private:
189 
190  //! @name Unimplemented Methods
191  //@{
192 
193  explicit OneDFSIFlux ( const OneDFSIFlux& flux );
194 
195  OneDFSIFlux& operator= ( const OneDFSIFlux& flux );
196 
197  //@}
198 
199 };
200 
201 }
202 
203 #endif // OneDFSIFlux_H
virtual Real dFdU(const Real &A, const Real &Q, const ID &row, const ID &column, const UInt &iNode) const =0
Evaluate the derivative of the flux term.
OneDFSIFlux(const OneDFSIFlux &flux)
OneDFSIPhysics - Base class providing physical operations for the 1D model data.
OneDFSIData - Class which read and holds all the data for the One Dimensional Model Solver...
std::shared_ptr< physics_Type > physicsPtr_Type
Definition: OneDFSIFlux.hpp:74
OneDFSIFlux()
Empty constructor.
Definition: OneDFSIFlux.hpp:85
OneDFSIFlux - Base class for the flux term of the 1D hyperbolic problem.
Definition: OneDFSIFlux.hpp:63
virtual Real flux(const Real &A, const Real &Q, const ID &row, const UInt &iNode) const =0
Evaluate the flux term.
virtual void eigenValuesEigenVectors(const Real &A, const Real &Q, container2D_Type &eigenvalues, container2D_Type &leftEigenvector1, container2D_Type &leftEigenvector2, const UInt &iNode) const =0
Eigenvalues and eigenvectors of the Jacobian matrix.
void updateInverseJacobian(const UInt &iQuadPt)
physicsPtr_Type M_physicsPtr
OneDFSIFlux(const physicsPtr_Type physicsPtr)
Constructor.
Definition: OneDFSIFlux.hpp:91
void setPhysics(const physicsPtr_Type &physicsPtr)
Set the physics of the problem.
physicsPtr_Type physics() const
Get the physics of the problem.
OneDFSIPhysics physics_Type
Definition: OneDFSIFlux.hpp:73
uint32_type ID
IDs.
Definition: LifeV.hpp:194
OneDFSIFlux & operator=(const OneDFSIFlux &flux)
virtual ~OneDFSIFlux()
Do nothing destructor.
Definition: OneDFSIFlux.hpp:94
FactorySingleton< Factory< OneDFSIFlux, OneDFSI::fluxTerm_Type > > factoryFlux_Type
Definition: OneDFSIFlux.hpp:71
double Real
Generic real data.
Definition: LifeV.hpp:175
std::array< Real, 2 > container2D_Type
virtual void deltaEigenValuesEigenVectors(const Real &A, const Real &Q, container2D_Type &deltaEigenvalues, container2D_Type &deltaLeftEigenvector1, container2D_Type &deltaLeftEigenvector2, const UInt &iNode) const =0
Derivatives of the eigenvalues and eigenvectors of the derivative of the Jacobian matrix...
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191