/usr/include/dune/grid/identitygrid/identitygridgeometry.hh is in libdune-grid-dev 2.5.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef DUNE_IDENTITYGRIDGEOMETRY_HH
#define DUNE_IDENTITYGRIDGEOMETRY_HH
/** \file
* \brief The IdentityGridGeometry class and its specializations
*/
#include <dune/common/fmatrix.hh>
#include <dune/common/typetraits.hh>
#include <dune/grid/common/geometry.hh>
namespace Dune {
template<int mydim, int coorddim, class GridImp>
class IdentityGridGeometry :
public GeometryDefaultImplementation <mydim, coorddim, GridImp, IdentityGridGeometry>
{
private:
typedef typename GridImp::ctype ctype;
public:
// The codimension of this entitypointer wrt the host grid
enum {CodimInHostGrid = GridImp::HostGridType::dimension - mydim};
enum {DimensionWorld = GridImp::HostGridType::dimensionworld};
// select appropriate hostgrid geometry via typeswitch
typedef typename GridImp::HostGridType::Traits::template Codim<CodimInHostGrid>::Geometry HostGridGeometryType;
typedef typename GridImp::HostGridType::Traits::template Codim<CodimInHostGrid>::Geometry HostGridLocalGeometryType;
typedef typename std::conditional<coorddim==DimensionWorld, HostGridGeometryType, HostGridLocalGeometryType>::type HostGridGeometry;
//! type of jacobian transposed
typedef typename HostGridGeometryType::JacobianInverseTransposed JacobianInverseTransposed;
typedef typename HostGridGeometryType::JacobianTransposed JacobianTransposed;
/** constructor from host geometry
*/
IdentityGridGeometry(const HostGridGeometry& hostGeometry)
: hostGeometry_(hostGeometry)
{}
/** \brief Return the element type identifier
*/
GeometryType type () const {
return hostGeometry_.type();
}
// return wether we have an affine mapping
bool affine() const {
return hostGeometry_.affine();
}
//! return the number of corners of this element. Corners are numbered 0...n-1
int corners () const {
return hostGeometry_.corners();
}
//! access to coordinates of corners. Index is the number of the corner
const FieldVector<ctype, coorddim> corner (int i) const {
return hostGeometry_.corner(i);
}
/** \brief Maps a local coordinate within reference element to
* global coordinate in element */
FieldVector<ctype, coorddim> global (const FieldVector<ctype, mydim>& local) const {
return hostGeometry_.global(local);
}
/** \brief Return the transposed of the Jacobian
*/
JacobianTransposed
jacobianTransposed ( const FieldVector<ctype, mydim>& local ) const {
return hostGeometry_.jacobianTransposed(local);
}
/** \brief Maps a global coordinate within the element to a
* local coordinate in its reference element */
FieldVector<ctype, mydim> local (const FieldVector<ctype, coorddim>& global) const {
return hostGeometry_.local(global);
}
//! Returns true if the point is in the current element
bool checkInside(const FieldVector<ctype, mydim> &local) const {
return hostGeometry_.checkInside(local);
}
/**
*/
ctype integrationElement (const FieldVector<ctype, mydim>& local) const {
return hostGeometry_.integrationElement(local);
}
//! The Jacobian matrix of the mapping from the reference element to this element
JacobianInverseTransposed jacobianInverseTransposed (const FieldVector<ctype, mydim>& local) const {
return hostGeometry_.jacobianInverseTransposed(local);
}
HostGridGeometry hostGeometry_;
};
} // namespace Dune
#endif
|