DUNE-FEM (unstable)

orthonormal.hh
1#ifndef DUNE_FEM_OPERATOR_PROJECTION_LOCAL_RIESZ_ORTHONORMAL_HH
2#define DUNE_FEM_OPERATOR_PROJECTION_LOCAL_RIESZ_ORTHONORMAL_HH
3
4#include <cassert>
5#include <cstddef>
6
7#include <utility>
8
9#include <dune/geometry/referenceelements.hh>
10
11#include "localrieszprojection.hh"
12
13namespace Dune
14{
15
16 namespace Fem
17 {
18
19 // OrthonormalLocalRieszProjection
20 // -------------------------------
21
22 template< class BasisFunctionSet >
23 class OrthonormalLocalRieszProjection
24 : public LocalRieszProjection< BasisFunctionSet, OrthonormalLocalRieszProjection< BasisFunctionSet > >
25 {
26 typedef OrthonormalLocalRieszProjection< BasisFunctionSet > ThisType;
27 typedef LocalRieszProjection< BasisFunctionSet, OrthonormalLocalRieszProjection< BasisFunctionSet > > BaseType;
28
29 public:
31 typedef typename BaseType::BasisFunctionSetType BasisFunctionSetType;
32
33 private:
34 typedef typename BasisFunctionSet::FunctionSpaceType::RangeFieldType RangeFieldType;
35
36 public:
41 explicit OrthonormalLocalRieszProjection ( const BasisFunctionSetType &basisFunctionSet )
42 : basisFunctionSet_( std::forward< BasisFunctionSetType >( basisFunctionSet ) ),
43 factor_( ratio( basisFunctionSet.entity().geometry() ) )
44 {}
45
46 explicit OrthonormalLocalRieszProjection ( BasisFunctionSetType &&basisFunctionSet )
47 : basisFunctionSet_( std::forward< BasisFunctionSetType >( basisFunctionSet ) ),
48 factor_( ratio( basisFunctionSet.entity().geometry() ) )
49 {}
50
57 OrthonormalLocalRieszProjection ( const ThisType & ) = default;
58
59 OrthonormalLocalRieszProjection ( ThisType &&other )
60 : basisFunctionSet_( std::move( other.basisFunctionSet_ ) ),
61 factor_( other.factor_ )
62 {}
63
64 ThisType &operator= ( const ThisType & ) = default;
65
66 ThisType &operator= ( ThisType &&other )
67 {
68 basisFunctionSet_ = std::move( other.basisFunctionSet_ );
69 factor_( other.factor_ );
70 return *this;
71 }
72
80 BasisFunctionSetType basisFunctionSet () const
81 {
82 return basisFunctionSet_;
83 }
84
86 template< class F, class LocalDofVector >
87 void apply ( const F &f, LocalDofVector &dofs ) const
88 {
89 assert( f.size() == dofs.size() );
90 const std::size_t size = dofs.size();
91 for( std::size_t i = 0u; i < size; ++i )
92 dofs[ i ] = factor_*f[ i ];
93 }
94
97 private:
98 template< class Geometry >
99 static RangeFieldType ratio ( const Geometry &geometry )
100 {
101 assert( geometry.affine() );
102 const auto &referenceElement
104 return referenceElement.volume()/geometry.volume();
105 }
106
107 BasisFunctionSetType basisFunctionSet_;
108 RangeFieldType factor_;
109 };
110
111 } // namespace Fem
112
113} // namepsace Dune
114
115#endif // #ifndef DUNE_FEM_OPERATOR_PROJECTION_LOCAL_RIESZ_ORTHONORMAL_HH
FunctionSpaceTraits::RangeFieldType RangeFieldType
Intrinsic type used for values in the range field (usually a double)
Definition: functionspaceinterface.hh:63
BasisFunctionSet BasisFunctionSetType
basis function set
Definition: localrieszprojection.hh:26
unspecified value type referenceElement(T &&... t)
Returns a reference element for the objects t....
Dune namespace.
Definition: alignedallocator.hh:13
constexpr std::integral_constant< std::size_t, sizeof...(II)> size(std::integer_sequence< T, II... >)
Return the size of the sequence.
Definition: integersequence.hh:75
STL namespace.
static const ReferenceElement & general(const GeometryType &type)
get general reference elements
Definition: referenceelements.hh:156
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Jul 27, 22:29, 2024)