dune-localfunctions
2.2.1
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
dune
localfunctions
lagrange
pq22d.hh
Go to the documentation of this file.
1
// -*- tab-width: 8; indent-tabs-mode: nil -*-
2
// vi: set ts=8 sw=2 et sts=2:
3
#ifndef DUNE_PQ22DLOCALFINITEELEMENT_HH
4
#define DUNE_PQ22DLOCALFINITEELEMENT_HH
5
6
#include <dune/common/fmatrix.hh>
7
8
#include <
dune/localfunctions/common/virtualinterface.hh
>
9
#include <
dune/localfunctions/common/virtualwrappers.hh
>
10
#include "
q22d.hh
"
11
#include "
pk2d.hh
"
12
13
namespace
Dune
14
{
15
template
<
class
D,
class
R>
16
class
PQ22DLocalFiniteElement
17
{
18
typedef
Dune::FieldVector<D,2> Domain;
19
typedef
Dune::FieldVector<R,1> Range;
20
typedef
LocalBasisTraits<D,2,Domain, R,1,Range, Dune::FieldMatrix<R,1,2>
, 0 >
BasisTraits
;
21
22
typedef
typename
Dune::LocalFiniteElementVirtualInterface<BasisTraits>
LocalFiniteElementBase
;
23
public
:
24
typedef
LocalFiniteElementTraits
<
25
LocalBasisVirtualInterface<BasisTraits>
,
26
LocalCoefficientsVirtualInterface
,
27
LocalInterpolationVirtualInterface< Domain, Range >
28
>
Traits
;
29
typedef
typename
Traits::LocalBasisType
LocalBasis
;
30
typedef
typename
Traits::LocalCoefficientsType
LocalCoefficients
;
31
typedef
typename
Traits::LocalInterpolationType
LocalInterpolation
;
32
33
PQ22DLocalFiniteElement
(
const
GeometryType > )
34
: gt_(gt)
35
{
36
if
( gt.isTriangle() )
37
setup(
Pk2DLocalFiniteElement<D,R,2>
() );
38
else
if
( gt.isQuadrilateral() )
39
setup(
Q22DLocalFiniteElement<D,R>
() );
40
}
41
42
PQ22DLocalFiniteElement
(
const
GeometryType >,
const
std::vector<unsigned int> vertexmap )
43
: gt_(gt)
44
{
45
if
( gt.isTriangle() )
46
setup(
Pk2DLocalFiniteElement<D,R,2>
(vertexmap) );
47
else
if
( gt.isQuadrilateral() )
48
setup(
Q22DLocalFiniteElement<D,R>
() );
49
}
50
51
PQ22DLocalFiniteElement
(
const
PQ22DLocalFiniteElement<D, R>
& other )
52
: gt_(other.gt_)
53
{
54
fe_ = other.fe_->
clone
();
55
}
56
57
~PQ22DLocalFiniteElement
( )
58
{
59
delete
fe_;
60
}
61
62
const
LocalBasis
&
localBasis
()
const
63
{
64
return
fe_->
localBasis
();
65
}
66
67
const
LocalCoefficients
&
localCoefficients
()
const
68
{
69
return
fe_->localCoefficients();
70
}
71
72
const
LocalInterpolation
&
localInterpolation
()
const
73
{
74
return
fe_->localInterpolation();
75
}
76
77
const
GeometryType &
type
()
const
78
{
79
return
gt_;
80
}
81
82
private
:
83
84
template
<
class
FE>
85
void
setup(
const
FE& fe)
86
{
87
fe_ =
new
LocalFiniteElementVirtualImp<FE>
(fe);
88
}
89
90
const
GeometryType gt_;
91
const
LocalFiniteElementBase *fe_;
92
};
93
94
}
95
96
#endif
Generated on Mon May 20 2013 01:06:59 for dune-localfunctions by
1.8.3.1