Dune Core Modules (2.6.0)

coefficients.hh
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3
4#ifndef DUNE_LOCALFUNCTIONS_META_POWER_COEFFICIENTS_HH
5#define DUNE_LOCALFUNCTIONS_META_POWER_COEFFICIENTS_HH
6
7#include <cstddef>
8#include <vector>
9
10#include <dune/localfunctions/common/localkey.hh>
11
12namespace Dune {
13
16
21 std::vector<LocalKey> keys;
22
23 public:
25
33 template<class Backend>
34 PowerCoefficients(const Backend &backend, std::size_t power) :
35 keys(backend.size()*power)
36 {
37 for(std::size_t i = 0; i < backend.size(); ++i) {
38 const LocalKey &k = backend.localKey(i);
39 for(std::size_t d = 0; d < power; ++d)
40 keys[i+d*backend.size()] =
41 LocalKey(k.subEntity(), k.codim(), power*k.index() + d);
42 }
43 }
45 inline std::size_t size() const { return keys.size(); }
46
48 inline const LocalKey& localKey(std::size_t i) const { return keys[i]; }
49 };
50
51} // namespace Dune
52
53#endif // DUNE_LOCALFUNCTIONS_META_POWER_COEFFICIENTS_HH
Describe position of one degree of freedom.
Definition: localkey.hh:21
unsigned int index() const
Return offset within subentity.
Definition: localkey.hh:66
unsigned int codim() const
Return codim of associated entity.
Definition: localkey.hh:60
unsigned int subEntity() const
Return number of associated subentity.
Definition: localkey.hh:54
Meta-coefficients turning a scalar coefficients into vector-valued coefficients.
Definition: coefficients.hh:20
std::size_t size() const
number of coefficients
Definition: coefficients.hh:45
PowerCoefficients(const Backend &backend, std::size_t power)
Construct a PowerCoefficients object.
Definition: coefficients.hh:34
const LocalKey & localKey(std::size_t i) const
get i'th index
Definition: coefficients.hh:48
Dune namespace.
Definition: alignedallocator.hh:10
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Jul 15, 22:36, 2024)