DUNE PDELab (2.8)

concepts.hh
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3#ifndef DUNE_FUNCTIONS_BACKEND_CONCEPTS_HH
4#define DUNE_FUNCTIONS_BACKEND_CONCEPTS_HH
5
6
7#include <utility>
8
10
11namespace Dune {
12namespace Functions {
13namespace Concept {
14
15using namespace Dune::Concept;
16
17
18// Concept for a ConstVectorBackend
19template<class GlobalBasis>
20struct ConstVectorBackend
21{
22 template<class V>
23 auto require(const V& v) -> decltype(
24 v[std::declval<typename GlobalBasis::MultiIndex>()]
25 );
26};
27
28// Concept for a VectorBackend
29template<class GlobalBasis>
30struct VectorBackend : Refines<ConstVectorBackend<GlobalBasis>>
31{
32 template<class V>
33 auto require(const V& v) -> decltype(
34 const_cast<V&>(v).resize(std::declval<const GlobalBasis&>()),
35 const_cast<V&>(v)[std::declval<typename GlobalBasis::MultiIndex>()] = v[std::declval<typename GlobalBasis::MultiIndex>()]
36 );
37};
38
39} // namespace Dune::Functions::Concept
40} // namespace Dune::Functions
41} // namespace Dune
42
43
44#endif // DUNE_FUNCTIONS_BACKEND_CONCEPTS_HH
Infrastructure for concepts.
Namespace for concepts.
Definition: concept.hh:32
Dune namespace.
Definition: alignedallocator.hh:11
Base class for refined concepts.
Definition: concept.hh:52
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 22, 23:30, 2024)