LifeV
Laplacian.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 Laplacian Analytical Solution
29  @brief This file contains the exact solution and some additive function for testing codes
30 
31  @author Gwenol Grandperrin <gwenol.grandperrin@epfl.ch>
32  @maintainer Gwenol Grandperrin <gwenol.grandperrin@epfl.ch>
33 
34  @date 2011-08-03
35 
36  Implementation.
37 */
38 
39 #include <lifev/core/function/Laplacian.hpp>
40 
41 namespace LifeV
42 {
43 
44 Real Laplacian::f ( const Real& /* t */, const Real& x, const Real& y, const Real& z, const ID& /* i */ )
45 {
46  return (M_xMode * M_xMode + M_yMode * M_yMode + M_zMode * M_zMode) * 4 * M_PI * M_PI * std::sin (M_xMode * 2 * M_PI * x) * std::sin (M_yMode * 2 * M_PI * y) * std::sin (M_zMode * 2 * M_PI * z);
47 }
48 
49 Real Laplacian::uexact ( const Real& /* t */, const Real& x, const Real& y, const Real& z, const ID& /* i */ )
50 {
51  return std::sin (M_xMode * 2 * M_PI * x) * std::sin (M_yMode * 2 * M_PI * y) * std::sin (M_zMode * 2 * M_PI * z);
52 }
53 Real Laplacian::duexactdx ( const Real& /* t */, const Real& x, const Real& y, const Real& z, const ID& /* i */ )
54 {
55  return M_xMode * 2 * M_PI * std::cos (M_xMode * 2 * M_PI * x) * std::sin (M_yMode * 2 * M_PI * y) * std::sin (M_zMode * 2 * M_PI * z);
56 }
57 
58 Real Laplacian::duexactdy ( const Real& /* t */, const Real& x, const Real& y, const Real& z, const ID& /* i */ )
59 {
60  return M_yMode * 2 * M_PI * std::sin (M_xMode * 2 * M_PI * x) * std::cos (M_yMode * 2 * M_PI * y) * std::sin (M_zMode * 2 * M_PI * z);
61 }
62 
63 Real Laplacian::duexactdz ( const Real& /* t */, const Real& x, const Real& y, const Real& z, const ID& /* i */ )
64 {
65  return M_zMode * 2 * M_PI * std::sin (M_xMode * 2 * M_PI * x) * std::sin (M_yMode * 2 * M_PI * y) * std::cos (M_zMode * 2 * M_PI * z);
66 }
67 
68 void Laplacian::setModes ( const Int& xMode, const Int& yMode, const Int& zMode )
69 {
70  M_xMode = xMode;
71  M_yMode = yMode;
72  M_zMode = zMode;
73 }
74 
75 Int Laplacian::M_xMode = 1;
76 Int Laplacian::M_yMode = 1;
77 Int Laplacian::M_zMode = 1;
78 
79 } // namespace LifeV
int32_type Int
Generic integer data.
Definition: LifeV.hpp:188
#define M_PI
Definition: winmath.h:20
void updateInverseJacobian(const UInt &iQuadPt)
uint32_type ID
IDs.
Definition: LifeV.hpp:194
double Real
Generic real data.
Definition: LifeV.hpp:175