Dune Core Modules (2.6.0)

identitygridgeometry.hh
Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3#ifndef DUNE_IDENTITYGRIDGEOMETRY_HH
4#define DUNE_IDENTITYGRIDGEOMETRY_HH
5
13
14namespace Dune {
15
16 template<int mydim, int coorddim, class GridImp>
17 class IdentityGridGeometry :
18 public GeometryDefaultImplementation <mydim, coorddim, GridImp, IdentityGridGeometry>
19 {
20 private:
21
22 typedef typename GridImp::ctype ctype;
23
24
25 public:
26
27 // The codimension of this entitypointer wrt the host grid
28 enum {CodimInHostGrid = GridImp::HostGridType::dimension - mydim};
29 enum {DimensionWorld = GridImp::HostGridType::dimensionworld};
30
31 // select appropriate hostgrid geometry via typeswitch
32 typedef typename GridImp::HostGridType::Traits::template Codim<CodimInHostGrid>::Geometry HostGridGeometryType;
33 typedef typename GridImp::HostGridType::Traits::template Codim<CodimInHostGrid>::Geometry HostGridLocalGeometryType;
34
35 typedef typename std::conditional<coorddim==DimensionWorld, HostGridGeometryType, HostGridLocalGeometryType>::type HostGridGeometry;
36
38 typedef typename HostGridGeometryType::JacobianInverseTransposed JacobianInverseTransposed;
39 typedef typename HostGridGeometryType::JacobianTransposed JacobianTransposed;
40
41
44 IdentityGridGeometry(const HostGridGeometry& hostGeometry)
45 : hostGeometry_(hostGeometry)
46 {}
47
48
51 GeometryType type () const {
52 return hostGeometry_.type();
53 }
54
55 // return wether we have an affine mapping
56 bool affine() const {
57 return hostGeometry_.affine();
58 }
59
61 int corners () const {
62 return hostGeometry_.corners();
63 }
64
65
67 const FieldVector<ctype, coorddim> corner (int i) const {
68 return hostGeometry_.corner(i);
69 }
70
71
74 FieldVector<ctype, coorddim> global (const FieldVector<ctype, mydim>& local) const {
75 return hostGeometry_.global(local);
76 }
77
80 JacobianTransposed
81 jacobianTransposed ( const FieldVector<ctype, mydim>& local ) const {
82 return hostGeometry_.jacobianTransposed(local);
83 }
84
87 FieldVector<ctype, mydim> local (const FieldVector<ctype, coorddim>& global) const {
88 return hostGeometry_.local(global);
89 }
90
91
93 bool checkInside(const FieldVector<ctype, mydim> &local) const {
94 return hostGeometry_.checkInside(local);
95 }
96
97
100 ctype integrationElement (const FieldVector<ctype, mydim>& local) const {
101 return hostGeometry_.integrationElement(local);
102 }
103
104
106 JacobianInverseTransposed jacobianInverseTransposed (const FieldVector<ctype, mydim>& local) const {
107 return hostGeometry_.jacobianInverseTransposed(local);
108 }
109
110
111 HostGridGeometry hostGeometry_;
112
113 };
114
115} // namespace Dune
116
117#endif
Wrapper and interface classes for element geometries.
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:178
Implements a matrix constructed from a given type representing a field and compile-time given number ...
Dune namespace.
Definition: alignedallocator.hh:10
Traits for type conversions and type information.
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 24, 23:30, 2024)