/usr/include/dune/grid/geometrygrid/hostcorners.hh is in libdune-grid-dev 2.2.1-2.
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 | #ifndef DUNE_GEOGRID_HOSTCORNERS_HH
#define DUNE_GEOGRID_HOSTCORNERS_HH
#include <dune/geometry/type.hh>
#include <dune/grid/alugrid/3d/topology.hh>
#include <dune/grid/common/entity.hh>
namespace Dune
{
// External Forward Declarations
// -----------------------------
template< int, int, class >
class ALU3dGridEntity;
template< ALU3dGridElementType, class >
struct ALU3dImplTraits;
namespace GeoGrid
{
// HostCorners
// -----------
template< class HostEntity >
class HostCorners
{
typedef typename HostEntity::Geometry HostGeometry;
public:
typedef typename HostGeometry::GlobalCoordinate Coordinate;
explicit HostCorners ( const HostEntity &hostEntity )
: hostGeometry_( hostEntity.geometry() )
{}
GeometryType type () const
{
return hostGeometry_.type();
}
Coordinate corner ( const int i ) const
{
return hostGeometry_.corner( i );
}
unsigned int numCorners () const
{
return hostGeometry_.corners();
}
private:
HostGeometry hostGeometry_;
};
// HostCorners for ALU3dGrid
// -------------------------
#if DUNE_GRID_EXPERIMENTAL_GRID_EXTENSIONS
template< int dim, class Grid >
class HostCorners< Dune::Entity< 0, dim, Grid, ALU3dGridEntity > >
{
typedef Dune::Entity< 0, dim, Grid, ALU3dGridEntity > HostEntity;
typedef double ALUCoordinate[ 3 ];
static const ALU3dGridElementType elementType = remove_const< Grid >::type::elementType;
typedef Dune::ElementTopologyMapping< elementType > ElementTopologyMapping;
typedef typename remove_const< Grid >::type::MPICommunicatorType Comm;
typedef ALU3dImplTraits< elementType, Comm > ImplTraits;
public:
typedef FieldVector< double, 3 > Coordinate;
explicit HostCorners ( const HostEntity &hostEntity )
: item_( hostEntity.impl().getItem() )
{}
GeometryType type () const
{
if( elementType == tetra )
return GeometryType( GenericGeometry::SimplexTopology< dim >::type::id, dim );
else
return GeometryType( GenericGeometry::CubeTopology< dim >::type::id, dim );
}
Coordinate corner ( const int i ) const
{
const int j = ElementTopologyMapping::dune2aluVertex( i );
const ALUCoordinate &point = item_.myvertex( j )->Point();
Coordinate corner;
for( int k = 0; k < 3; ++k )
corner[ k ] = point[ k ];
return corner;
}
unsigned int numCorners () const
{
return (elementType == tetra ? dim+1 : (1 << dim));
}
private:
const typename ImplTraits::IMPLElementType &item_;
};
#endif // #if DUNE_GRID_EXPERIMENTAL_GRID_EXTENSIONS
} // namespace GeoGrid
} // namespace Dune
#endif // #ifndef DUNE_GEOGRID_HOSTCORNERS_HH
|