/usr/include/dune/pdelab/finiteelementmap/global.hh is in libdune-pdelab-dev 2.0.0-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 | // -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=8 sw=2 sts=2:
#ifndef DUNE_PDELAB_FINITEELEMENTMAP_GLOBAL_HH
#define DUNE_PDELAB_FINITEELEMENTMAP_GLOBAL_HH
#include <dune/pdelab/finiteelementmap/finiteelementmap.hh>
namespace Dune {
namespace PDELab {
//! \brief Generic finite element map for global finite elements created
//! with a geometry
/**
* \tparam Factory Finite element factory class that supports make(const
* Geometry&).
*/
template<class Factory>
class GeometryFiniteElementMap
{
Factory& factory;
public:
typedef FiniteElementMapTraits<typename Factory::FiniteElement> Traits;
//! construct GeometryFiniteElementMap
/**
* \param factory_ Reference to a factory object.
*
* \note The constructed finite element map object stores a reference to
* to factory object. The finite element map object becomes
* invalid as soon the reference to the factory becomes invalid.
* The only allowed operation on an invalid finite element map is
* calling the destructor, all other operations result in
* undefined behaviour.
*/
GeometryFiniteElementMap(Factory& factory_) : factory(factory_) {}
//! Return finite element for the given entity.
/**
* \param e Grid element to create a finite element for.
*
* The returned value is valid for as long as both this finite element
* map as well as the reference to the grid element are valid.
*/
template<class Element>
typename Traits::FiniteElementType find(const Element& e) const {
return factory.make(e.geometry());
}
};
//! \brief Generic finite element map for global finite elements created
//! with a geometry and a vertex ordering
/**
* \tparam FEFactory Finite element factory class that supports make(const
* Geometry&, const VertexOrdering&).
* \tparam VOFactory Factory to extract the vertex ordering for a given
* grid element.
*/
template<class FEFactory, class VOFactory>
class GeometryVertexOrderFiniteElementMap
{
FEFactory& feFactory;
const VOFactory& voFactory;
public:
typedef FiniteElementMapTraits<typename FEFactory::FiniteElement> Traits;
//! construct GeometryFiniteElementMap
/**
* \param feFactory_ Reference to a finite element factory object.
* \param voFactory_ Reference to a vertex order factory object.
*
* \note The constructed finite element map object stores a reference to
* to factory objects. The finite element map object becomes
* invalid as soon one of the references to the factories becomes
* invalid. The only allowed operation on an invalid finite
* element map is calling the destructor, all other operations
* result in undefined behaviour.
*/
GeometryVertexOrderFiniteElementMap(FEFactory& feFactory_,
const VOFactory & voFactory_) :
feFactory(feFactory_), voFactory(voFactory_)
{}
//! Return finite element for the given entity.
/**
* \param e Grid element to create a finite element for.
*
* The returned value is valid for as long as both this finite element
* map as well as the reference to the grid element are valid.
*/
template<class Element>
typename Traits::FiniteElementType find(const Element& e) const {
return feFactory.make(e.geometry(), voFactory.make(e));
}
};
} // namespace PDELab
} // namespace Dune
#endif // DUNE_PDELAB_FINITEELEMENTMAP_GLOBAL_HH
|