LifeV
Norm.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 Norm : distance between a given point
29  @brief This file contains the computation of the distance between two points, used for the pseudo-ECG calculation
30 
31  @author Marie Dupraz <marie.dupraz@epfl.ch>
32  @maintainer Marie Dupraz <marie.dupraz@epfl.ch>
33 
34  @date 2013-04-20
35 
36  Distance between two given points
37  */
38 
39 
40 #include <lifev/core/LifeV.hpp>
41 
42 namespace LifeV
43 {
44 
45 class Norm
46 {
47 public:
48  static Real f ( const Real& t, const Real& x, const Real& y,
49  const Real& z, const ID& i );
50  // {
51  // return sqrt ( (x - M_xPosition) * (x - M_xPosition) + (y - M_yPosition) * (y - M_yPosition) + (z - M_zPosition) * (z - M_zPosition) ) ;
52  // }
53 
54  static inline void setPosition ( const Real& xPosition, const Real& yPosition, const Real& zPosition )
55  {
56  M_xPosition = xPosition;
57  M_yPosition = yPosition;
58  M_zPosition = zPosition;
59  }
60 
61 private:
62  static Real M_xPosition;
63  static Real M_yPosition;
64  static Real M_zPosition;
65 
66 }; // class Laplacian
67 
68 Real Norm::f ( const Real& /* t */, const Real& x, const Real& y, const Real& z, const ID& /* i */ )
69 {
70  return sqrt ( (x - M_xPosition) * (x - M_xPosition) + (y - M_yPosition) * (y - M_yPosition) + (z - M_zPosition) * (z - M_zPosition) ) ;
71 }
72 
73 Real Norm::M_xPosition = 1.;
74 Real Norm::M_yPosition = 1.;
75 Real Norm::M_zPosition = 0.5;
76 
77 } // namespace LifeV
void assignFunction(bcBase_Type &base)
Assign the function to the base of the BCHandler.
static void setPosition(const Real &xPosition, const Real &yPosition, const Real &zPosition)
Definition: Norm.hpp:54
static Real M_zPosition
Definition: Norm.hpp:64
uint32_type ID
IDs.
Definition: LifeV.hpp:194
static Real f(const Real &t, const Real &x, const Real &y, const Real &z, const ID &i)
Definition: Norm.hpp:68
double Real
Generic real data.
Definition: LifeV.hpp:175
static Real M_yPosition
Definition: Norm.hpp:63
static Real M_xPosition
Definition: Norm.hpp:62