dune-grid 2.10
Loading...
Searching...
No Matches
concepts/archetypes/geometry.hh
Go to the documentation of this file.
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_ARCHETYPES_GEOMETRY_HH
6#define DUNE_GRID_CONCEPTS_ARCHETYPES_GEOMETRY_HH
7
8#include <dune/common/fmatrix.hh>
9#include <dune/common/fvector.hh>
10#include <dune/geometry/type.hh>
11
12#ifndef DOXYGEN
13namespace Dune::Concept::Archetypes {
14
15struct ReferenceElement {};
16
17template <int mydim, int cdim = mydim>
18struct Geometry
19{
20 static constexpr int mydimension = mydim;
21 static constexpr int coorddimension = cdim;
22
23 using ctype = double;
24 using Volume = ctype;
25 using LocalCoordinate = Dune::FieldVector<ctype, mydim>;
26 using GlobalCoordinate = Dune::FieldVector<ctype, cdim>;
27 using Jacobian = Dune::FieldMatrix<ctype, cdim, mydim>;
28 using JacobianTransposed = Dune::FieldMatrix<ctype, mydim, cdim>;
29 using JacobianInverse = Dune::FieldMatrix<ctype, mydim, cdim>;
30 using JacobianInverseTransposed = Dune::FieldMatrix<ctype, cdim, mydim>;
31
32 Dune::GeometryType type () const;
33 bool affine () const;
34 int corners () const;
35
36 GlobalCoordinate corner (int i) const;
37 GlobalCoordinate global (const LocalCoordinate& local) const;
38 LocalCoordinate local (const GlobalCoordinate& global) const;
39 GlobalCoordinate center () const;
40
41 Volume integrationElement (const LocalCoordinate& local) const;
42 Volume volume () const;
43
44 Jacobian jacobian (const LocalCoordinate& local) const;
45 JacobianTransposed jacobianTransposed (const LocalCoordinate& local) const;
46 JacobianInverse jacobianInverse (const LocalCoordinate& local) const;
47 JacobianInverseTransposed jacobianInverseTransposed (const LocalCoordinate& local) const;
48};
49
50template <int mydim, int cdim>
51Archetypes::ReferenceElement referenceElement (const Geometry<mydim,cdim>& g);
52
53} // end namespace Dune::Concept::Archetypes
54#endif // DOXYGEN
55
56#endif // DUNE_GRID_CONCEPTS_ARCHETYPES_GEOMETRY_HH
auto referenceElement(const Geometry< mydim, cdim, GridImp, GeometryImp > &geo) -> decltype(referenceElement(geo, geo.impl()))
Definition common/geometry.hh:558