dune-localfunctions  2.11
orthonormalbasis.hh
Go to the documentation of this file.
1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=4 sw=2 sts=2:
3 // SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
4 // SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
5 #ifndef DUNE_ORTHONORMALBASIS_HH
6 #define DUNE_ORTHONORMALBASIS_HH
7 
8 #include <sstream>
9 
12 
13 namespace Dune
14 {
15 
16  // OrthonormalBasisFactory
17  // -----------------------
18  template< int dim, class D, class R, class SF, class CF = typename ComputeField< SF, 512 >::Type >
20  {
21  static const unsigned int dimension = dim;
22  typedef D Domain;
23  typedef R Range;
24  typedef SF StorageField;
25  typedef CF ComputeField;
26 
27  template <unsigned int dd, class FF>
29  {
31  };
32 
34  typedef typename MonomialBasisProviderType::Object MonomialBasisType;
35 
39 
40  typedef unsigned int Key;
41  typedef const Basis Object;
42 
43  static constexpr GeometryType SimplexGeometry = GeometryTypes::simplex(dim);
44 
45  template< GeometryType::Id geometryId >
46  static Object *create ( const unsigned int order )
47  {
48  const MonomialBasisType &monomialBasis = *MonomialBasisProviderType::template create< SimplexGeometry >( order );
49 
50  static CoefficientMatrix _coeffs;
51  if( _coeffs.size() <= monomialBasis.size() )
52  {
54  _coeffs.fill( matrix );
55  }
56 
57  return new Basis( monomialBasis, _coeffs, monomialBasis.size() );
58  }
59  static void release( Object *object ) { delete object; }
60  };
61 
62 }
63 
64 #endif // #ifndef DUNE_ORTHONORMALBASIS_HH
Definition: polynomialbasis.hh:62
SparseCoeffMatrix< StorageField, 1 > CoefficientMatrix
Definition: orthonormalbasis.hh:36
Definition: basisevaluator.hh:129
Definition: monomialbasis.hh:841
SF StorageField
Definition: orthonormalbasis.hh:24
Definition: bdfmcube.hh:17
unsigned int Key
Definition: orthonormalbasis.hh:40
MonomialBasisProvider< dd, FF > Type
Definition: orthonormalbasis.hh:30
MonomialBasisProviderType::Object MonomialBasisType
Definition: orthonormalbasis.hh:34
const Basis Object
Definition: orthonormalbasis.hh:41
PolynomialBasis< Evaluator, CoefficientMatrix, Domain, Range > Basis
Definition: orthonormalbasis.hh:38
D Domain
Definition: orthonormalbasis.hh:22
CF ComputeField
Definition: orthonormalbasis.hh:25
static constexpr GeometryType SimplexGeometry
Definition: orthonormalbasis.hh:43
StandardEvaluator< MonomialBasisType > Evaluator
Definition: orthonormalbasis.hh:37
Definition: orthonormalcompute.hh:93
static const unsigned int dimension
Definition: orthonormalbasis.hh:21
Definition: orthonormalbasis.hh:19
R Range
Definition: orthonormalbasis.hh:23
Definition: coeffmatrix.hh:47
static Object * create(const unsigned int order)
Definition: orthonormalbasis.hh:46
EvaluationBasisFactory< dimension, StorageField >::Type MonomialBasisProviderType
Definition: orthonormalbasis.hh:33
static void release(Object *object)
Definition: orthonormalbasis.hh:59