LifeV
darcy/testsuite/basic_test/3d/user_fun.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  @author A. Fumagalli <alessio.fumagalli@mail.polimi.it>
30  @date 2010-07-29
31 */
32 
33 #ifndef __user_fun_H
34 #define __user_fun_H 1
35 
36 #include <lifev/core/LifeV.hpp>
37 
38 #include <lifev/core/mesh/RegionMesh.hpp>
39 
40 #include <lifev/darcy/solver/DarcySolverLinear.hpp>
41 
42 namespace dataProblem
43 {
44 
45 using namespace LifeV;
46 
47 // ===================================================
48 //! Typedef
49 // ===================================================
50 
54 
56 
58 
61 
64 
67 
70 
73 
76 
79 
82 
85 
86 // ===================================================
87 //! Problem data
88 // ===================================================
89 
90 // Inverse of permeability matrix
92 {
93 public:
94  virtual Matrix eval ( const UInt& iElem, const Vector3D& P, const Real& time = 0. ) const;
95 };
96 
97 // Reaction term
98 class reactionTerm : public scalarFct_Type
99 {
100 public:
101  virtual Real eval ( const UInt& iElem, const Vector3D& P, const Real& time = 0. ) const;
102 };
103 
104 // Scalar source term
105 class scalarSource : public scalarFct_Type
106 {
107 public:
108  virtual Real eval ( const UInt& iElem, const Vector3D& P, const Real& time = 0. ) const;
109 };
110 
111 // Vector source term
112 class vectorSource : public vectorFct_Type
113 {
114 public:
115  virtual Vector eval ( const UInt& iElem, const Vector3D& P, const Real& time = 0. ) const;
116 };
117 
118 // ===================================================
119 //! Boundary data
120 // ===================================================
121 namespace BCFlags
122 {
123 
124 // Flags for structured meshes
125 const UInt BACK = 3;
126 const UInt FRONT = 1;
127 const UInt LEFT = 4;
128 const UInt RIGHT = 2;
129 const UInt BOTTOM = 5;
130 const UInt TOP = 6;
131 }
132 
133 void setBoundaryConditions ( bcHandlerPtr_Type& bcDarcy) ;
134 
135 // Boundary condition of Dirichlet
136 Real dirichlet ( const Real&, const Real&, const Real&, const Real&, const ID& );
137 
138 // Boundary condition of Neumann
139 Real neumann1 ( const Real&, const Real&, const Real&, const Real&, const ID& );
140 
141 Real neumann2 ( const Real&, const Real&, const Real&, const Real&, const ID& );
142 
143 // Boundary condition of Robin (2 functions needed)
144 Real robin ( const Real&, const Real&, const Real&, const Real&, const ID& );
145 Real robinMass ( const Real&, const Real&, const Real&, const Real&, const ID& );
146 
147 // ===================================================
148 //! Analytical solution
149 // ===================================================
150 
151 // Analytical solution
152 Real analyticalSolution ( const Real&, const Real&, const Real&, const Real&, const ID& );
153 
154 // Gradient of the analytical solution
155 Real analyticalFlux ( const Real&, const Real&, const Real&, const Real&, const ID& );
156 
157 } // namespace dataProblem
158 
159 #endif /* __user_fun_H */
darcySolverLinear_Type::fESpacePtr_Type fESpacePtr_Type
Real dirichlet(const Real &t, const Real &x, const Real &y, const Real &z, const ID &ic)
Definition: hyperbolic.cpp:172
darcySolver_Type::dataPtr_Type darcyDataPtr_Type
Real neumann1(const Real &, const Real &, const Real &, const Real &, const ID &)
darcySolverLinear_Type::vectorField_Type vectorField_Type
darcySolverLinear_Type::matrixFctPtr_Type matrixFctPtr_Type
Real robinMass(const Real &, const Real &, const Real &, const Real &, const ID &)
darcySolverLinear_Type::bcHandlerPtr_Type bcHandlerPtr_Type
darcySolver_Type::data_Type darcyData_Type
RegionMesh< geoElement_Type > regionMesh_Type
virtual Matrix eval(const UInt &iElem, const Vector3D &P, const Real &time=0.) const
Abstract virtual eval function.
darcySolverLinear_Type::bcHandler_Type bcHandler_Type
darcySolverLinear_Type::matrixFct_Type matrixFct_Type
darcySolverLinear_Type::scalarFct_Type scalarFct_Type
darcySolverLinear_Type::vector_Type vector_Type
darcySolverLinear_Type::scalarFieldPtr_Type scalarFieldPtr_Type
uint32_type ID
IDs.
Definition: LifeV.hpp:194
darcySolverLinear_Type::vectorFct_Type vectorFct_Type
darcySolverLinear_Type::vectorFieldPtr_Type vectorFieldPtr_Type
DarcySolverTransientNonLinear< regionMesh_Type > darcySolver_Type
darcySolverLinear_Type::vectorFctPtr_Type vectorFctPtr_Type
std::shared_ptr< std::vector< Int > > M_isOnProc
darcySolverLinear_Type::fESpace_Type fESpace_Type
darcySolverLinear_Type::scalarField_Type scalarField_Type
Real analyticalFlux(const Real &, const Real &, const Real &, const Real &, const ID &)
virtual Vector eval(const UInt &iElem, const Vector3D &P, const Real &time=0.) const
Abstract virtual eval function.
Real analyticalSolution(const Real &t, const Real &x, const Real &y, const Real &, const ID &)
Analytical solution.
Definition: hyperbolic.cpp:65
std::shared_ptr< regionMesh_Type > regionMeshPtr_Type
double Real
Generic real data.
Definition: LifeV.hpp:175
darcySolverLinear_Type::vectorPtr_Type vectorPtr_Type
darcySolverLinear_Type::scalarFctPtr_Type scalarFctPtr_Type
implements a mixed-hybrid FE Darcy solver.
Real robin(const Real &, const Real &, const Real &, const Real &, const ID &)
Real neumann2(const Real &, const Real &, const Real &, const Real &, const ID &)
virtual Real eval(const UInt &iElem, const Vector3D &P, const Real &time=0.) const
Abstract virtual eval function.
VectorSmall< 3 > Vector3D
A Geometric Shape.
MeshPartitioner< regionMesh_Type > meshPartitioner_Type
void setBoundaryConditions(bcHandlerPtr_Type &bcDarcy)
Boundary data.
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191
virtual Real eval(const UInt &iElem, const Vector3D &P, const Real &time=0.) const
Abstract virtual eval function.
LinearTetra geoElement_Type
Typedef.