DUNE PDELab (git)

datahandle.hh
1// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file LICENSE.md in module root
2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
4// vi: set et ts=4 sw=2 sts=2:
5#ifndef DUNE_GRID_CONCEPTS_DATAHANDLE_HH
6#define DUNE_GRID_CONCEPTS_DATAHANDLE_HH
7
8#include <concepts>
9
10#include <dune/grid/concepts/archetypes/datahandle.hh>
11#include <dune/grid/concepts/archetypes/entity.hh>
12#include <dune/grid/concepts/archetypes/messagebuffer.hh>
13
14namespace Dune::Concept {
15
16template <class DH>
17concept CommDataHandle = requires(const DH chandle, const Archetypes::Entity<2,0>& entity)
18{
19 typename DH::DataType;
20
21 { chandle.contains(/*dim*/ 0, /*codim*/ 0) } -> std::convertible_to<bool>;
22 { chandle.fixedSize(/*dim*/ 0, /*codim*/ 0) } -> std::convertible_to<bool>;
23 { chandle.size(entity) } -> std::integral;
24
25 requires requires(DH handle, Archetypes::MessageBuffer<typename DH::DataType> buffer)
26 {
27 handle.gather(buffer, entity);
28 handle.scatter(buffer, entity, /*size*/ 0u);
29 };
30};
31
32static_assert(CommDataHandle< Archetypes::CommDataHandle<double> >);
33
34} // end namespace Dune::Concept
35
36
37#endif // DUNE_GRID_CONCEPTS_DATAHANDLE_HH
Namespace for concepts.
Definition: concept.hh:34
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Jul 15, 22:36, 2024)