LifeV
core/testsuite/fe_function/user_fun.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  @author A. Fumagalli <alessio.fumagalli@mail.polimi.it>
30  @date 2010-07-29
31 */
32 
33 #include "user_fun.hpp"
34 
35 namespace dataProblem
36 {
37 
38 Real MyFun::eval ( const UInt& iElem, const point_Type& P, const Real& time ) const
39 {
40  const Real scalar1 = scalarField (0).eval ( iElem, P, time );
41  const Real scalar2 = scalarField (1).eval ( iElem, P, time );
42 
43  const Vector vector = vectorField (0).eval ( iElem, P, time );
44 
45  return ( std::sin (scalar1) + scalar2 * scalar2 ) / vector (0);
46 }
47 
48 } // Namespace DataProblem
virtual Real eval(const UInt &iElem, const FEScalarFct_Type::point_Type &P, const Real &time=0.) const
Abstract virtual eval function.
double Real
Generic real data.
Definition: LifeV.hpp:175
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191