rheolef
6.3
Main Page
Namespaces
Classes
Files
Examples
File List
File Members
pexamples
poiseuille.h
Go to the documentation of this file.
1
struct
u
: std::unary_function<point,Float> {
2
Float
operator()
(
const
point
& x)
const
{
3
return
a
*(
c
+x[1])*(
c
-x[1]); }
4
u
(
const
Float
& c1, std::string sc) :
c
(c1)
5
{
a
= (sc ==
"cartesian"
) ? 3/(2*
pow
(
c
,3)) : 4/
pow
(
c
,4); }
6
protected
:
Float
c
,
a
;
7
};
8
struct
psi
: std::unary_function<point,Float> {
9
Float
operator()
(
const
point
& x)
const
{
10
return
xy
?
a
*
sqr
(
c
-x[1])*(2*
c
+x[1]) :
a
*
sqr
(
c
-x[1])*
sqr
(
c
+x[1]); }
11
psi
(
const
Float
& c1, std::string sc) :
c
(c1),
xy
(sc ==
"cartesian"
)
12
{
a
=
xy
? -1/(2*
pow
(
c
,3)) : -1/
pow
(
c
,4); }
13
protected
:
Float
c
,
a
;
bool
xy
;
14
};
15