/usr/include/dune/grid/common/geometryreference.hh is in libdune-grid-dev 2.3.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 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef DUNE_GRID_GEOMETRYREFERENCE_HH
#define DUNE_GRID_GEOMETRYREFERENCE_HH
/** \file
\brief Wrapper and interface classes for element geometries
*/
#include <dune/common/typetraits.hh>
#include <dune/geometry/type.hh>
#include <dune/grid/common/geometry.hh>
namespace Dune
{
// Internal Forward Declarations
// -----------------------------
template< int mydim, int cdim, class Grid >
class GlobalGeometryReference;
template< int mydim, int cdim, class Grid >
class LocalGeometryReference;
// FacadeOptions
// -------------
namespace FacadeOptions
{
template< int mydim, int cdim, class GridImp, template< int, int, class > class GeometryImp >
struct StoreGeometryReference;
template< int mydim, int cdim, class Grid >
struct StoreGeometryReference< mydim, cdim, Grid, GlobalGeometryReference >
{
static const bool v = false;
};
template< int mydim, int cdim, class Grid >
struct StoreGeometryReference< mydim, cdim, Grid, LocalGeometryReference >
{
static const bool v = false;
};
} // namespace FacadeOptions
// GeometryReference
// -----------------
template< class Implementation >
class GeometryReference
{
typedef GeometryReference< Implementation > This;
public:
static const int mydimension = Implementation::mydimension;
static const int coorddimension = Implementation::coorddimension;
typedef typename Implementation::ctype ctype;
typedef typename Implementation::LocalCoordinate LocalCoordinate;
typedef typename Implementation::GlobalCoordinate GlobalCoordinate;
typedef typename Implementation::JacobianInverseTransposed JacobianInverseTransposed;
typedef typename Implementation::JacobianTransposed JacobianTransposed;
explicit GeometryReference ( const Implementation &impl )
: impl_( &impl )
{}
GeometryType type () const { return impl().type(); }
bool affine() const { return impl().affine(); }
int corners () const { return impl().corners(); }
GlobalCoordinate corner ( int i ) const { return impl().corner( i ); }
GlobalCoordinate center () const { return impl().center(); }
GlobalCoordinate global ( const LocalCoordinate &local ) const
{
return impl().global( local );
}
LocalCoordinate local ( const GlobalCoordinate &global ) const
{
return impl().local( global );
}
ctype integrationElement ( const LocalCoordinate &local ) const
{
return impl().integrationElement( local );
}
ctype volume () const { return impl().volume(); }
const JacobianTransposed &jacobianTransposed ( const LocalCoordinate &local ) const
{
return impl().jacobianTransposed( local );
}
const JacobianInverseTransposed &jacobianInverseTransposed ( const LocalCoordinate &local ) const
{
return impl().jacobianInverseTransposed( local );
}
const Implementation &impl () const { return *impl_; }
private:
const Implementation *impl_;
};
// GlobalGeometryReference
// -----------------------
template< int mydim, int cdim, class Grid >
class GlobalGeometryReference
: public GeometryReference< typename remove_const< Grid >::type::Traits::template Codim< remove_const< Grid >::type::dimension - mydim >::GeometryImpl >
{
typedef typename remove_const< Grid >::type::Traits::template Codim< remove_const< Grid >::type::dimension - mydim >::GeometryImpl Implementation;
public:
GlobalGeometryReference ( const Implementation &impl )
: GeometryReference< Implementation >( impl )
{}
};
// LocalGeometryReference
// -----------------------
template< int mydim, int cdim, class Grid >
class LocalGeometryReference
: public GeometryReference< typename remove_const< Grid >::type::Traits::template Codim< remove_const< Grid >::type::dimension - mydim >::LocalGeometryImpl >
{
typedef typename remove_const< Grid >::type::Traits::template Codim< remove_const< Grid >::type::dimension - mydim >::LocalGeometryImpl Implementation;
public:
LocalGeometryReference ( const Implementation &impl )
: GeometryReference< Implementation >( impl )
{}
};
// Definitions of GeometryReference
// --------------------------------
template< class Implementation >
const int GeometryReference< Implementation >::mydimension;
template< class Implementation >
const int GeometryReference< Implementation >::coorddimension;
} // namespace Dune
#endif // #ifndef DUNE_GRID_GEOMETRYREFERENCE_HH
|