/usr/include/dune/pdelab/common/topologyutility.hh is in libdune-pdelab-dev 2.5.0~rc1-2build1.
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 | // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef DUNE_PDELAB_COMMON_TOPOLOGYUTILITY_HH
#define DUNE_PDELAB_COMMON_TOPOLOGYUTILITY_HH
#include <dune/geometry/type.hh>
namespace Dune {
namespace PDELab {
//! Utility TMP for determining the BasicType of a geometry from its dimension and topology id.
/**
* BasicTypeFromDimensionAndTopologyId invokes GenericGeometry-internal machinery to identify
* the GeometryType::BasicType that belongs to the given combination of dimension and topologyId.
*
* This information is often useful when writing generic frontends for FiniteElementMaps that are
* specialized on dimension and BasicType.
*
* \tparam dimension The dimension of the geometry.
* \tparam topologyId The topologyId of the geometry.
*/
template<int dimension, unsigned int topologyId>
struct BasicTypeFromDimensionAndTopologyId
{
static const bool isCube =
((topologyId ^ ((1 << dimension)-1)) >> 1 == 0);
static const bool isSimplex =
(topologyId | 1) == 1;
//! The BasicType of Topology.
static const GeometryType::BasicType value =
isSimplex ? GeometryType::simplex
: (
isCube ? GeometryType::cube
: GeometryType::none
);
};
} // namespace PDELab
} // namespace Dune
#endif // DUNE_PDELAB_COMMON_TOPOLOGYUTILITY_HH
|