LifeV
core/testsuite/bdf/ud_functions.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
30 
31  @author
32  @date 00-00-0000
33  */
34 
35 namespace LifeV
36 {
37 
38 // ===================================================
39 //! User functions
40 // ===================================================
41 
43 {
44 public:
45  inline Real operator() (Real /*x*/, Real /*y*/, Real /*z*/, Real /*t*/, int /*ic*/) const
46  {
47  return -4.;
48  }
49 };
50 
52 {
53  // ic stands for a component index (unuseful in the scalar case)
54 public:
55  static Real u (Real t, Real x, Real y, Real /*z*/, UInt /*ic*/)
56  {
57  return t * t * (x * x + y * y);
58  }
59 
60  static Real der_t (Real t, Real x, Real y, Real /*z*/, UInt /*ic*/)
61  {
62  return 2 * t * (x * x + y * y);
63  }
64 
65  static Real grad ( UInt icoor, Real t, Real x, Real y, Real /*z*/, UInt /*ic*/)
66  {
67  switch (icoor)
68  {
69  case 1:
70  return 2 * x * t * t;
71  case 2:
72  return 2 * y * t * t;
73  default:
74  return 0;
75  }
76  }
77 };
78 
79 class SourceFct
80 {
81 public:
82  inline Real operator() (Real /*x*/, Real /*y*/, Real /*z*/, Real /*t*/, int /*ic*/) const
83  {
84  return -6.;
85  }
86 };
87 
88 
90 {
91  // ic stands for a component index (unuseful in the scalar case)
92 public:
93  static Real u (Real t, Real x, Real y, Real z, UInt /*ic*/)
94  {
95  return t * t * (x * x + y * y + z * z);
96  }
97  static Real grad (UInt icoor, Real t, Real x, Real y, Real z, UInt /*ic*/)
98  {
99  switch (icoor)
100  {
101  case 1: //der_x
102  return 2 * x * t * t;
103  case 2: //der_y
104  return 2 * y * t * t;
105  case 3: //der_z
106  return 2 * z * t * t;
107  default:
108  return 0;
109  }
110  }
111 };
112 
113 
114 Real nu (const Real& t)
115 {
116  return 1. / (t * t);
117 }
118 
119 Real sigma (const Real& t)
120 {
121  return -2. / t;
122 }
123 
124 }
static Real grad(UInt icoor, Real t, Real x, Real y, Real z, UInt)
static Real grad(UInt icoor, Real t, Real x, Real y, Real, UInt)
static Real u(Real t, Real x, Real y, Real z, UInt)
static Real u(Real t, Real x, Real y, Real, UInt)
Real nu(const Real &t)
Real operator()(Real, Real, Real, Real, int) const
Real sigma(const Real &t)
double Real
Generic real data.
Definition: LifeV.hpp:175
static Real der_t(Real t, Real x, Real y, Real, UInt)
Real operator()(Real, Real, Real, Real, int) const
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191