/usr/include/dune/functions/functionspacebases/defaultlocalview.hh is in libdune-functions-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 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH
#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH
#include <tuple>
#include <dune/common/concept.hh>
#include <dune/functions/functionspacebases/concepts.hh>
namespace Dune {
namespace Functions {
/** \brief The restriction of a finite element basis to a single element */
template<class GB>
class DefaultLocalView
{
using PrefixPath = TypeTree::HybridTreePath<>;
public:
//! The global FE basis that this is a view on
using GlobalBasis = GB;
//! The grid view the global FE basis lives on
using GridView = typename GlobalBasis::GridView;
//! Type of the grid element we are bound to
using Element = typename GridView::template Codim<0>::Entity;
//! The type used for sizes
using size_type = std::size_t;
//! Tree of local finite elements / local shape function sets
using Tree = typename GlobalBasis::NodeFactory::template Node<PrefixPath>;
/** \brief Construct local view for a given global finite element basis */
DefaultLocalView(const GlobalBasis& globalBasis) :
globalBasis_(&globalBasis),
tree_(globalBasis_->nodeFactory().node(PrefixPath()))
{
static_assert(models<Concept::BasisTree<GridView>, Tree>(), "Tree type passed to DefaultLocalView does not model the BasisNode concept.");
initializeTree(tree_);
}
/** \brief Bind the view to a grid element
*
* Having to bind the view to an element before being able to actually access any of its data members
* offers to centralize some expensive setup code in the 'bind' method, which can save a lot of run-time.
*/
void bind(const Element& e)
{
element_ = e;
bindTree(tree_, element_);
}
/** \brief Return the grid element that the view is bound to
*
* \throws Dune::Exception if the view is not bound to anything
*/
const Element& element() const
{
return element_;
}
/** \brief Unbind from the current element
*
* Calling this method should only be a hint that the view can be unbound.
*/
void unbind()
{}
/** \brief Return the local ansatz tree associated to the bound entity
*
* \returns Tree // This is tree
*/
const Tree& tree() const
{
return tree_;
}
/** \brief Total number of degrees of freedom on this element
*/
size_type size() const
{
return tree_.size();
}
/**
* \brief Maximum local size for any element on the GridView
*
* This is the maximal size needed for local matrices
* and local vectors, i.e., the result is
*/
size_type maxSize() const
{
return globalBasis_->nodeFactory().maxNodeSize();
}
/** \brief Return the global basis that we are a view on
*/
const GlobalBasis& globalBasis() const
{
return *globalBasis_;
}
const DefaultLocalView& rootLocalView() const
{
return *this;
}
protected:
const GlobalBasis* globalBasis_;
Element element_;
Tree tree_;
};
} // end namespace Functions
} // end namespace Dune
#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH
|