LifeV
OneDFSIFluxLinear.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 File containing a base class for linear 1D model flux function.
30  *
31  * @version 1.0
32  * @author Vincent Martin
33  *
34  * @version 2.0
35  * @date 15-04-2010
36  * @author Cristiano Malossi <cristiano.malossi@epfl.ch>
37  *
38  * @contributor Simone Rossi <simone.rossi@epfl.ch>
39  * @maintainer Cristiano Malossi <cristiano.malossi@epfl.ch>
40  */
41 
42 #include <lifev/one_d_fsi/solver/OneDFSIFluxLinear.hpp>
43 
44 namespace LifeV
45 {
46 
47 // ===================================================
48 // Methods
49 // ===================================================
50 Real
51 OneDFSIFluxLinear::flux ( const Real& U1, const Real& U2, const ID& row, const UInt& iNode ) const
52 {
53  if ( row == 0 ) // F1
54  {
55  return M_physicsPtr->data()->flux11 ( iNode ) * U1 + M_physicsPtr->data()->flux12 ( iNode ) * U2;
56  }
57  if ( row == 1 ) // F2
58  {
59  return M_physicsPtr->data()->flux21 ( iNode ) * U1 + M_physicsPtr->data()->flux22 ( iNode ) * U2;
60  }
61  ERROR_MSG ("The flux function has only 2 components.");
62  return -1.;
63 }
64 
65 Real
66 OneDFSIFluxLinear::dFdU ( const Real& /*U1*/, const Real& /*U2*/, const ID& row, const ID& column, const UInt& iNode) const
67 {
68  if ( row == 0 && column == 0 ) // dF1/dU1
69  {
70  return M_physicsPtr->data()->flux11 ( iNode );
71  }
72  if ( row == 0 && column == 1 ) // dF1/dU2
73  {
74  return M_physicsPtr->data()->flux12 ( iNode );
75  }
76  if ( row == 1 && column == 0 ) // dF2/dU1
77  {
78  return M_physicsPtr->data()->flux21 ( iNode );
79  }
80  if ( row == 1 && column == 1 ) // dF2/dU2
81  {
82  return M_physicsPtr->data()->flux22 ( iNode );
83  }
84 
85  ERROR_MSG ("Flux's differential function has only 4 components.");
86  return -1.;
87 }
88 
89 void
90 OneDFSIFluxLinear::eigenValuesEigenVectors ( const Real& /*U1*/, const Real& /*U2*/,
91  container2D_Type& eigenvalues,
92  container2D_Type& leftEigenvector1,
93  container2D_Type& leftEigenvector2,
94  const UInt& iNode ) const
95 {
96  eigenvalues[0] = M_physicsPtr->data()->celerity1 ( iNode );
97  eigenvalues[1] = M_physicsPtr->data()->celerity2 ( iNode );
98 
99  leftEigenvector1[0] = M_physicsPtr->data()->leftEigenVector11 ( iNode );
100  leftEigenvector1[1] = M_physicsPtr->data()->leftEigenVector12 ( iNode );
101  leftEigenvector2[0] = M_physicsPtr->data()->leftEigenVector21 ( iNode );
102  leftEigenvector2[1] = M_physicsPtr->data()->leftEigenVector22 ( iNode );
103 }
104 
105 void
106 OneDFSIFluxLinear::deltaEigenValuesEigenVectors ( const Real& /*U1*/, const Real& /*U2*/,
107  container2D_Type& deltaEigenvalues,
108  container2D_Type& deltaLeftEigenvector1,
109  container2D_Type& deltaLeftEigenvector2,
110  const UInt& /*iNode*/ ) const
111 {
112  deltaEigenvalues[0] = 0;
113  deltaEigenvalues[1] = 0;
114 
115  deltaLeftEigenvector1[0] = 0;
116  deltaLeftEigenvector1[1] = 0;
117  deltaLeftEigenvector2[0] = 0;
118  deltaLeftEigenvector2[1] = 0;
119 }
120 
121 }
OneDFSIFluxLinear - Class containing the linear flux term of the 1D hyperbolic problem.
void updateInverseJacobian(const UInt &iQuadPt)
#define ERROR_MSG(A)
Definition: LifeAssert.hpp:69
Real dFdU(const Real &U1, const Real &U2, const ID &row, const ID &column, const UInt &iNode) const
Evaluate the derivative of the flux term.
uint32_type ID
IDs.
Definition: LifeV.hpp:194
Real flux(const Real &U1, const Real &U2, const ID &row, const UInt &iNode) const
Evaluate the source term.
void eigenValuesEigenVectors(const Real &U1, const Real &U2, container2D_Type &eigenvalues, container2D_Type &leftEigenvector1, container2D_Type &leftEigenvector2, const UInt &iNode) const
Eigenvalues and eigenvectors of the Jacobian matrix.
double Real
Generic real data.
Definition: LifeV.hpp:175
void deltaEigenValuesEigenVectors(const Real &A, const Real &Q, container2D_Type &deltaEigenvalues, container2D_Type &deltaLeftEigenvector1, container2D_Type &deltaLeftEigenvector2, const UInt &iNode) const
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