dune-assembler 2.12
Loading...
Searching...
No Matches
concepts.hh
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
3
4#ifndef DUNE_ASSEMBLER_CONCEPTS_HH
5#define DUNE_ASSEMBLER_CONCEPTS_HH
6
8
9#include <dune/functions/functionspacebases/concepts.hh>
10
12
13template <class LV>
14concept LocalView =
16
17template <class GB>
18concept GlobalBasis =
20
21
22template <class M>
23concept Matrix = requires(M matrix, int i, int j) {
24 matrix[i][j];
25};
26
27template <class M>
28concept BlockMatrix = requires(M matrix, int i, int j) {
29 { matrix[i][j] } -> Matrix;
30};
31
32template <class V>
33concept Vector = requires(V vector, int i) {
34 vector[i];
35};
36
37template <class V>
38concept BlockVector = requires(V vector, int i) {
39 { vector[i] } -> Vector;
40};
41
42template <class P>
43concept LocalMatrixPattern = requires(P pattern, int i, int j) {
44 pattern.add(i, j);
45 pattern.addAll();
46 pattern.clear();
47};
48
49template <class P>
50concept BlockLocalMatrixPattern = requires(P pattern, int i, int j) {
51 { pattern[i][j] } -> LocalMatrixPattern;
52};
53
54namespace Archetypes {
55
56struct Vector
57{
58 void operator[] (int) {}
59};
60
61struct Matrix
62{
63 auto operator[] (int) { return Vector{}; }
64};
65
67{
68 void add (int,int) {}
69 void addAll () {}
70 void clear () {}
71};
72
73} // end namespace Archetypes
74
78
79} // end namespace Dune::Assembler::Concept
80
81#endif // DUNE_ASSEMBLER_CONCEPTS_HH
Definition localboundaryintersectionmatrixassembler.hh:9
static constexpr size_type M()
void operator[](int)
Definition concepts.hh:58
auto operator[](int)
Definition concepts.hh:63
void add(int, int)
Definition concepts.hh:68
Definition concepts.hh:14
Definition concepts.hh:23
Definition concepts.hh:33