Dune Core Modules (unstable)

identitygridgeometry.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_IDENTITYGRIDGEOMETRY_HH
6#define DUNE_IDENTITYGRIDGEOMETRY_HH
7
15
16namespace Dune {
17
18 template<int mydim, int coorddim, class GridImp>
19 class IdentityGridGeometry :
20 public GeometryDefaultImplementation <mydim, coorddim, GridImp, IdentityGridGeometry>
21 {
22 private:
23
24 typedef typename GridImp::ctype ctype;
25
26
27 public:
28
29 // The codimension of this entitypointer wrt the host grid
30 constexpr static int CodimInHostGrid = GridImp::HostGridType::dimension - mydim;
31 constexpr static int DimensionWorld = GridImp::HostGridType::dimensionworld;
32
33 // select appropriate hostgrid geometry via typeswitch
34 typedef typename GridImp::HostGridType::Traits::template Codim<CodimInHostGrid>::Geometry HostGridGeometryType;
35 typedef typename GridImp::HostGridType::Traits::template Codim<CodimInHostGrid>::Geometry HostGridLocalGeometryType;
36
37 typedef typename std::conditional<coorddim==DimensionWorld, HostGridGeometryType, HostGridLocalGeometryType>::type HostGridGeometry;
38
40 typedef typename HostGridGeometryType::JacobianInverseTransposed JacobianInverseTransposed;
41 typedef typename HostGridGeometryType::JacobianTransposed JacobianTransposed;
42
43
46 IdentityGridGeometry(const HostGridGeometry& hostGeometry)
47 : hostGeometry_(hostGeometry)
48 {}
49
50
53 GeometryType type () const {
54 return hostGeometry_.type();
55 }
56
57 // return whether we have an affine mapping
58 bool affine() const {
59 return hostGeometry_.affine();
60 }
61
63 int corners () const {
64 return hostGeometry_.corners();
65 }
66
67
69 const FieldVector<ctype, coorddim> corner (int i) const {
70 return hostGeometry_.corner(i);
71 }
72
73
76 FieldVector<ctype, coorddim> global (const FieldVector<ctype, mydim>& local) const {
77 return hostGeometry_.global(local);
78 }
79
82 JacobianTransposed
83 jacobianTransposed ( const FieldVector<ctype, mydim>& local ) const {
84 return hostGeometry_.jacobianTransposed(local);
85 }
86
89 FieldVector<ctype, mydim> local (const FieldVector<ctype, coorddim>& global) const {
90 return hostGeometry_.local(global);
91 }
92
93
95 bool checkInside(const FieldVector<ctype, mydim> &local) const {
96 return hostGeometry_.checkInside(local);
97 }
98
99
102 ctype integrationElement (const FieldVector<ctype, mydim>& local) const {
103 return hostGeometry_.integrationElement(local);
104 }
105
106
108 JacobianInverseTransposed jacobianInverseTransposed (const FieldVector<ctype, mydim>& local) const {
109 return hostGeometry_.jacobianInverseTransposed(local);
110 }
111
112
113 HostGridGeometry hostGeometry_;
114
115 };
116
117} // namespace Dune
118
119#endif
Wrapper and interface classes for element geometries.
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:132
Implements a matrix constructed from a given type representing a field and compile-time given number ...
Dune namespace.
Definition: alignedallocator.hh:13
Traits for type conversions and type information.
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 22, 23:30, 2024)