DUNE PDELab (git)

geometry.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_GEOMETRY_HH
6#define DUNE_GRID_CONCEPTS_GEOMETRY_HH
7
8#include <concepts>
9
12#include <dune/geometry/type.hh>
13#include <dune/grid/concepts/archetypes/geometry.hh>
14
15namespace Dune::Concept {
16
17template<class R>
18concept ReferenceElement = true;
19
20static_assert(ReferenceElement< Archetypes::ReferenceElement >);
21
22
28template<class G>
29concept Geometry = requires(const G g, typename G::GlobalCoordinate global, typename G::LocalCoordinate local)
30{
31 typename G::ctype;
32 { G::mydimension } -> std::convertible_to<int>;
33 { G::coorddimension } -> std::convertible_to<int>;
34 { g.type() } -> std::same_as<Dune::GeometryType>;
35 { g.affine() } -> std::convertible_to<bool>;
36 { g.corners() } -> std::convertible_to<int>;
37 { g.corner(/*i*/ int{}) } -> std::convertible_to<typename G::GlobalCoordinate>;
38 { g.global(local) } -> std::convertible_to<typename G::GlobalCoordinate>;
39 { g.local(global) } -> std::convertible_to<typename G::LocalCoordinate>;
40 { g.integrationElement(local) } -> std::convertible_to<typename G::Volume>;
41 { g.volume() } -> std::convertible_to<typename G::Volume>;
42 { g.center() } -> std::convertible_to<typename G::GlobalCoordinate>;
43 { g.jacobian(local) } -> std::convertible_to<typename G::Jacobian>;
44 { g.jacobianInverse(local) } -> std::convertible_to<typename G::JacobianInverse>;
45 { g.jacobianTransposed(local) } -> std::convertible_to<typename G::JacobianTransposed>;
46 { g.jacobianInverseTransposed(local) } -> std::convertible_to<typename G::JacobianInverseTransposed>;
47 { referenceElement(g) } -> ReferenceElement;
48};
49
51
52} // end namespace Dune::Concept
53
54#endif // DUNE_GRID_CONCEPTS_GEOMETRY_HH
Model of a geometry object.
Definition: geometry.hh:29
Implements a matrix constructed from a given type representing a field and compile-time given number ...
Implements a vector constructed from a given type representing a field and a compile-time given size.
unspecified value type referenceElement(T &&... t)
Returns a reference element for the objects t....
Namespace for concepts.
Definition: concept.hh:34
A unique label for each type of element that can occur in a grid.
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 24, 23:30, 2024)