Loading...
Searching...
No Matches
discreteglobalbasisfunction.hh
Go to the documentation of this file.
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_DISCRETEGLOBALBASISFUNCTIONS_HH
#define DUNE_FUNCTIONS_GRIDFUNCTIONS_DISCRETEGLOBALBASISFUNCTIONS_HH
#include <memory>
#include <optional>
#include <dune/common/typetraits.hh>
#include <dune/common/shared_ptr.hh>
#include <dune/grid/utility/hierarchicsearch.hh>
#include <dune/common/typetree/traversal.hh>
#include <dune/common/typetree/treecontainer.hh>
#include <dune/functions/functionspacebases/hierarchicnodetorangemap.hh>
#include <dune/functions/functionspacebases/flatvectorview.hh>
#include <dune/functions/gridfunctions/gridviewentityset.hh>
#include <dune/functions/gridfunctions/gridfunction.hh>
#include <dune/functions/backends/concepts.hh>
#include <dune/functions/backends/istlvectorbackend.hh>
namespace Dune {
namespace Functions {
namespace ImplDoc {
template<typename B, typename V, typename NTRE>
class DiscreteGlobalBasisFunctionBase
{
public:
using Basis = B;
using Vector = V;
// In order to make the cache work for proxy-references
// we have to use AutonomousValue<T> instead of std::decay_t<T>
using Coefficient = Dune::AutonomousValue<decltype(std::declval<Vector>()[std::declval<typename Basis::MultiIndex>()])>;
using GridView = typename Basis::GridView;
using EntitySet = GridViewEntitySet<GridView, 0>;
using Tree = typename Basis::LocalView::Tree;
using NodeToRangeEntry = NTRE;
using Domain = typename EntitySet::GlobalCoordinate;
using LocalDomain = typename EntitySet::LocalCoordinate;
using Element = typename EntitySet::Element;
protected:
// This collects all data that is shared by all related
// global and local functions. This way we don't need to
// keep track of it individually.
struct Data
{
EntitySet entitySet;
std::shared_ptr<const Basis> basis;
std::shared_ptr<const Vector> coefficients;
std::shared_ptr<const NodeToRangeEntry> nodeToRangeEntry;
};
public:
class LocalFunctionBase
{
using LocalView = typename Basis::LocalView;
using size_type = typename Tree::size_type;
public:
using Domain = LocalDomain;
using Element = typename EntitySet::Element;
protected:
LocalFunctionBase(const std::shared_ptr<const Data>& data)
: data_(data)
, localView_(data_->basis->localView())
{
localDoFs_.reserve(localView_.maxSize());
}
LocalFunctionBase(const LocalFunctionBase& other)
: data_(other.data_)
, localView_(other.localView_)
{
localDoFs_.reserve(localView_.maxSize());
if (bound())
localDoFs_ = other.localDoFs_;
}
LocalFunctionBase& operator=(const LocalFunctionBase& other)
{
data_ = other.data_;
localView_ = other.localView_;
if (bound())
localDoFs_ = other.localDoFs_;
return *this;
}
public:
void bind(const Element& element)
{
localView_.bind(element);
// Use cache of full local view size. For a subspace basis,
// this may be larger than the number of local DOFs in the
// tree. In this case only cache entries associated to local
// DOFs in the subspace are filled. Cache entries associated
// to local DOFs which are not contained in the subspace will
// not be touched.
//
// Alternatively one could use a cache that exactly fits
// the size of the tree. However, this would require to
// subtract an offset from localIndex(i) on each cache
// access in operator().
localDoFs_.resize(localView_.size());
const auto& dofs = *data_->coefficients;
for (size_type i = 0; i < localView_.tree().size(); ++i)
{
// For a subspace basis the index-within-tree i
// is not the same as the localIndex within the
// full local view.
size_t localIndex = localView_.tree().localIndex(i);
localDoFs_[localIndex] = dofs[localView_.index(localIndex)];
}
}
void unbind()
{
localView_.unbind();
}
bool bound() const
{
return localView_.bound();
}
const Element& localContext() const
{
return localView_.element();
}
protected:
template<class To, class From>
void assignWith(To& to, const From& from) const
{
auto from_flat = flatVectorView(from);
auto to_flat = flatVectorView(to);
assert(from_flat.size() == to_flat.size());
for (size_type i = 0; i < to_flat.size(); ++i)
to_flat[i] = from_flat[i];
}
template<class Node, class TreePath, class Range>
decltype(auto) nodeToRangeEntry(const Node& node, const TreePath& treePath, Range& y) const
{
return (*data_->nodeToRangeEntry)(node, treePath, y);
}
std::shared_ptr<const Data> data_;
LocalView localView_;
std::vector<Coefficient> localDoFs_;
};
protected:
DiscreteGlobalBasisFunctionBase(const std::shared_ptr<const Data>& data)
: data_(data)
{
/* Nothing. */
}
public:
const Basis& basis() const
{
return *data_->basis;
}
const Vector& dofs() const
{
return *data_->coefficients;
}
const NodeToRangeEntry& nodeToRangeEntry() const
{
return *data_->nodeToRangeEntry;
}
const EntitySet& entitySet() const
{
return data_->entitySet;
}
protected:
std::shared_ptr<const Data> data_;
};
} // namespace ImplDoc
template<typename DGBF>
class DiscreteGlobalBasisFunctionDerivative;
template<typename B, typename V,
typename NTRE = HierarchicNodeToRangeMap,
typename R = typename V::value_type>
class DiscreteGlobalBasisFunction
: public ImplDoc::DiscreteGlobalBasisFunctionBase<B, V, NTRE>
{
using Base = ImplDoc::DiscreteGlobalBasisFunctionBase<B, V, NTRE>;
using Data = typename Base::Data;
public:
using Basis = typename Base::Basis;
using Vector = typename Base::Vector;
using Domain = typename Base::Domain;
using Range = R;
using Traits = Imp::GridFunctionTraits<Range(Domain), typename Base::EntitySet, DefaultDerivativeTraits, 16>;
private:
template<class Node>
using LocalBasisRange = typename Node::FiniteElement::Traits::LocalBasisType::Traits::RangeType;
template<class Node>
using NodeData = typename std::vector<LocalBasisRange<Node>>;
using PerNodeEvaluationBuffer = typename TypeTree::TreeContainer<NodeData, typename Base::Tree>;
public:
class LocalFunction
: public Base::LocalFunctionBase
{
using LocalBase = typename Base::LocalFunctionBase;
using size_type = typename Base::Tree::size_type;
using LocalBase::nodeToRangeEntry;
public:
using GlobalFunction = DiscreteGlobalBasisFunction;
using Domain = typename LocalBase::Domain;
using Range = GlobalFunction::Range;
using Element = typename LocalBase::Element;
LocalFunction(const DiscreteGlobalBasisFunction& globalFunction)
: LocalBase(globalFunction.data_)
, evaluationBuffer_(this->localView_.tree())
{
/* Nothing. */
}
Range operator()(const Domain& x) const
{
Range y;
istlVectorBackend(y) = 0;
TypeTree::forEachLeafNode(this->localView_.tree(), [&](auto&& node, auto&& treePath) {
if (node.empty())
return;
const auto& fe = node.finiteElement();
const auto& localBasis = fe.localBasis();
auto& shapeFunctionValues = evaluationBuffer_[treePath];
localBasis.evaluateFunction(x, shapeFunctionValues);
// Compute linear combinations of basis function jacobian.
// Non-scalar coefficients of dimension coeffDim are handled by
// processing the coeffDim linear combinations independently
// and storing them as entries of an array.
using Value = LocalBasisRange< std::decay_t<decltype(node)> >;
static constexpr auto coeffDim = decltype(flatVectorView(this->localDoFs_[node.localIndex(0)]).size())::value;
auto values = std::array<Value, coeffDim>{};
istlVectorBackend(values) = 0;
for (size_type i = 0; i < localBasis.size(); ++i)
{
auto c = flatVectorView(this->localDoFs_[node.localIndex(i)]);
for (std::size_t j = 0; j < coeffDim; ++j)
values[j].axpy(c[j], shapeFunctionValues[i]);
}
// Assign computed values to node entry of range.
// Types are matched using the lexicographic ordering provided by flatVectorView.
LocalBase::assignWith(nodeToRangeEntry(node, treePath, y), values);
});
return y;
}
friend typename DiscreteGlobalBasisFunctionDerivative<DiscreteGlobalBasisFunction>::LocalFunction derivative(const LocalFunction& lf)
{
auto dlf = localFunction(DiscreteGlobalBasisFunctionDerivative<DiscreteGlobalBasisFunction>(lf.data_));
if (lf.bound())
dlf.bind(lf.localContext());
return dlf;
}
private:
mutable PerNodeEvaluationBuffer evaluationBuffer_;
};
template<class B_T, class V_T, class NTRE_T>
DiscreteGlobalBasisFunction(B_T && basis, V_T && coefficients, NTRE_T&& nodeToRangeEntry)
: Base(std::make_shared<Data>(Data{{basis.gridView()}, wrap_or_move(std::forward<B_T>(basis)), wrap_or_move(std::forward<V_T>(coefficients)), wrap_or_move(std::forward<NTRE_T>(nodeToRangeEntry))}))
{}
DiscreteGlobalBasisFunction(std::shared_ptr<const Basis> basis, std::shared_ptr<const V> coefficients, std::shared_ptr<const typename Base::NodeToRangeEntry> nodeToRangeEntry)
: Base(std::make_shared<Data>(Data{{basis->gridView()}, basis, coefficients, nodeToRangeEntry}))
{}
Range operator() (const Domain& x) const
{
HierarchicSearch search(this->data_->basis->gridView().grid(), this->data_->basis->gridView().indexSet());
const auto e = search.findEntity(x);
auto localThis = localFunction(*this);
localThis.bind(e);
return localThis(e.geometry().local(x));
}
friend DiscreteGlobalBasisFunctionDerivative<DiscreteGlobalBasisFunction> derivative(const DiscreteGlobalBasisFunction& f)
{
return DiscreteGlobalBasisFunctionDerivative<DiscreteGlobalBasisFunction>(f.data_);
}
friend LocalFunction localFunction(const DiscreteGlobalBasisFunction& t)
{
return LocalFunction(t);
}
};
template<typename R, typename B, typename V>
auto makeDiscreteGlobalBasisFunction(B&& basis, V&& vector)
{
using Basis = std::decay_t<B>;
using NTREM = HierarchicNodeToRangeMap;
// Small helper functions to wrap vectors using istlVectorBackend
// if they do not already satisfy the VectorBackend interface.
auto toConstVectorBackend = [&](auto&& v) -> decltype(auto) {
if constexpr (models<Concept::ConstVectorBackend<Basis>, decltype(v)>()) {
return std::forward<decltype(v)>(v);
} else {
return istlVectorBackend(v);
}
};
using Vector = std::decay_t<decltype(toConstVectorBackend(std::forward<V>(vector)))>;
return DiscreteGlobalBasisFunction<Basis, Vector, NTREM, R>(
std::forward<B>(basis),
toConstVectorBackend(std::forward<V>(vector)),
HierarchicNodeToRangeMap());
}
template<typename DGBF>
class DiscreteGlobalBasisFunctionDerivative
: public ImplDoc::DiscreteGlobalBasisFunctionBase<typename DGBF::Basis, typename DGBF::Vector, typename DGBF::NodeToRangeEntry>
{
using Base = ImplDoc::DiscreteGlobalBasisFunctionBase<typename DGBF::Basis, typename DGBF::Vector, typename DGBF::NodeToRangeEntry>;
using Data = typename Base::Data;
public:
using DiscreteGlobalBasisFunction = DGBF;
using Basis = typename Base::Basis;
using Vector = typename Base::Vector;
using Domain = typename Base::Domain;
using Range = typename SignatureTraits<typename DiscreteGlobalBasisFunction::Traits::DerivativeInterface>::Range;
using Traits = Imp::GridFunctionTraits<Range(Domain), typename Base::EntitySet, DefaultDerivativeTraits, 16>;
private:
template<class Node>
using LocalBasisRange = typename Node::FiniteElement::Traits::LocalBasisType::Traits::JacobianType;
template<class Node>
using NodeData = typename std::vector< LocalBasisRange<Node> >;
using PerNodeEvaluationBuffer = typename TypeTree::TreeContainer<NodeData, typename Base::Tree>;
public:
class LocalFunction
: public Base::LocalFunctionBase
{
using LocalBase = typename Base::LocalFunctionBase;
using size_type = typename Base::Tree::size_type;
using LocalBase::nodeToRangeEntry;
public:
using GlobalFunction = DiscreteGlobalBasisFunctionDerivative;
using Domain = typename LocalBase::Domain;
using Range = GlobalFunction::Range;
using Element = typename LocalBase::Element;
LocalFunction(const GlobalFunction& globalFunction)
: LocalBase(globalFunction.data_)
, evaluationBuffer_(this->localView_.tree())
{
/* Nothing. */
}
void bind(const Element& element)
{
LocalBase::bind(element);
geometry_.emplace(element.geometry());
}
void unbind()
{
geometry_.reset();
LocalBase::unbind();
}
Range operator()(const Domain& x) const
{
Range y;
istlVectorBackend(y) = 0;
const auto& jacobianInverse = geometry_->jacobianInverse(x);
TypeTree::forEachLeafNode(this->localView_.tree(), [&](auto&& node, auto&& treePath) {
if (node.empty())
return;
const auto& fe = node.finiteElement();
const auto& localBasis = fe.localBasis();
auto& shapeFunctionJacobians = evaluationBuffer_[treePath];
localBasis.evaluateJacobian(x, shapeFunctionJacobians);
// Compute linear combinations of basis function jacobian.
// Non-scalar coefficients of dimension coeffDim are handled by
// processing the coeffDim linear combinations independently
// and storing them as entries of an array.
using RefJacobian = LocalBasisRange< std::decay_t<decltype(node)> >;
static constexpr auto coeffDim = decltype(flatVectorView(this->localDoFs_[node.localIndex(0)]).size())::value;
auto refJacobians = std::array<RefJacobian, coeffDim>{};
istlVectorBackend(refJacobians) = 0;
for (size_type i = 0; i < localBasis.size(); ++i)
{
auto c = flatVectorView(this->localDoFs_[node.localIndex(i)]);
for (std::size_t j = 0; j < coeffDim; ++j)
refJacobians[j].axpy(c[j], shapeFunctionJacobians[i]);
}
// Transform Jacobians form local to global coordinates.
using Jacobian = decltype(refJacobians[0] * jacobianInverse);
auto jacobians = std::array<Jacobian, coeffDim>{};
std::transform(
refJacobians.begin(), refJacobians.end(), jacobians.begin(),
[&](const auto& refJacobian) { return refJacobian * jacobianInverse; });
// Assign computed Jacobians to node entry of range.
// Types are matched using the lexicographic ordering provided by flatVectorView.
LocalBase::assignWith(nodeToRangeEntry(node, treePath, y), jacobians);
});
return y;
}
friend typename Traits::LocalFunctionTraits::DerivativeInterface derivative(const LocalFunction&)
{
DUNE_THROW(NotImplemented, "derivative of derivative is not implemented");
}
private:
mutable PerNodeEvaluationBuffer evaluationBuffer_;
std::optional<typename Element::Geometry> geometry_;
};
DiscreteGlobalBasisFunctionDerivative(const std::shared_ptr<const Data>& data)
: Base(data)
{
/* Nothing. */
}
Range operator()(const Domain& x) const
{
HierarchicSearch search(this->data_->basis->gridView().grid(), this->data_->basis->gridView().indexSet());
const auto e = search.findEntity(x);
auto localThis = localFunction(*this);
localThis.bind(e);
return localThis(e.geometry().local(x));
}
friend typename Traits::DerivativeInterface derivative(const DiscreteGlobalBasisFunctionDerivative& f)
{
DUNE_THROW(NotImplemented, "derivative of derivative is not implemented");
}
friend LocalFunction localFunction(const DiscreteGlobalBasisFunctionDerivative& f)
{
return LocalFunction(f);
}
};
} // namespace Functions
} // namespace Dune
#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_DISCRETEGLOBALBASISFUNCTIONS_HH
flatvectorview.hh
hierarchicnodetorangemap.hh
gridfunction.hh
gridviewentityset.hh
istlvectorbackend.hh
Dune::Functions::DiscreteGlobalBasisFunction::makeDiscreteGlobalBasisFunction
auto makeDiscreteGlobalBasisFunction(B &&basis, V &&vector)
Generate a DiscreteGlobalBasisFunction.
Definition discreteglobalbasisfunction.hh:458
Dune::Functions::istlVectorBackend
auto istlVectorBackend(Vector &v)
Return a vector backend wrapping non-const ISTL like containers.
Definition istlvectorbackend.hh:350
Dune
Definition monomialset.hh:19
Dune::Functions
Definition monomialset.hh:19
Dune::Functions::flatVectorView
auto flatVectorView(T &t)
Create flat vector view of passed mutable container.
Definition flatvectorview.hh:183
Dune::Functions::ImplDoc
Definition discreteglobalbasisfunction.hh:32
Dune::Functions::DefaultDerivativeTraits
Default implementation for derivative traits.
Definition defaultderivativetraits.hh:41
Dune::Functions::SignatureTraits
Helper class to deduce the signature of a callable.
Definition signature.hh:60
Dune::Functions::HierarchicNodeToRangeMap
A simple node to range map using the nested tree indices.
Definition hierarchicnodetorangemap.hh:34
Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase
Definition discreteglobalbasisfunction.hh:36
Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase< typename DGBF::Basis, typename DGBF::Vector, typename DGBF::NodeToRangeEntry >::data_
std::shared_ptr< const Data > data_
Definition discreteglobalbasisfunction.hh:225
Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::dofs
const Vector & dofs() const
Return the coefficients of this discrete function by reference.
Definition discreteglobalbasisfunction.hh:207
Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::Basis
B Basis
Definition discreteglobalbasisfunction.hh:38
Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::Tree
typename Basis::LocalView::Tree Tree
Definition discreteglobalbasisfunction.hh:47
Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::Vector
V Vector
Definition discreteglobalbasisfunction.hh:39
Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::Element
typename EntitySet::Element Element
Definition discreteglobalbasisfunction.hh:53
Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::LocalDomain
typename EntitySet::LocalCoordinate LocalDomain
Definition discreteglobalbasisfunction.hh:52
Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::nodeToRangeEntry
const NodeToRangeEntry & nodeToRangeEntry() const
Return the stored node-to-range map.
Definition discreteglobalbasisfunction.hh:213
Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::NodeToRangeEntry
NTRE NodeToRangeEntry
Definition discreteglobalbasisfunction.hh:48
Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::DiscreteGlobalBasisFunctionBase
DiscreteGlobalBasisFunctionBase(const std::shared_ptr< const Data > &data)
Definition discreteglobalbasisfunction.hh:192
Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::GridView
typename Basis::GridView GridView
Definition discreteglobalbasisfunction.hh:45
Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::basis
const Basis & basis() const
Return a const reference to the stored basis.
Definition discreteglobalbasisfunction.hh:201
Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::EntitySet
GridViewEntitySet< GridView, 0 > EntitySet
Definition discreteglobalbasisfunction.hh:46
Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::entitySet
const EntitySet & entitySet() const
Get associated set of entities the local-function can be bound to.
Definition discreteglobalbasisfunction.hh:219
Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::Domain
typename EntitySet::GlobalCoordinate Domain
Definition discreteglobalbasisfunction.hh:50
Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::Coefficient
Dune::AutonomousValue< decltype(std::declval< Vector >()[std::declval< typename Basis::MultiIndex >()])> Coefficient
Definition discreteglobalbasisfunction.hh:43
Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::Data
Definition discreteglobalbasisfunction.hh:61
Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::Data::entitySet
EntitySet entitySet
Definition discreteglobalbasisfunction.hh:62
Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::Data::nodeToRangeEntry
std::shared_ptr< const NodeToRangeEntry > nodeToRangeEntry
Definition discreteglobalbasisfunction.hh:65
Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::Data::basis
std::shared_ptr< const Basis > basis
Definition discreteglobalbasisfunction.hh:63
Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::Data::coefficients
std::shared_ptr< const Vector > coefficients
Definition discreteglobalbasisfunction.hh:64
Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::LocalFunctionBase
Definition discreteglobalbasisfunction.hh:70
Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::LocalFunctionBase::operator=
LocalFunctionBase & operator=(const LocalFunctionBase &other)
Copy-assignment of the local-function.
Definition discreteglobalbasisfunction.hh:108
Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::LocalFunctionBase::bound
bool bound() const
Check if LocalFunction is already bound to an element.
Definition discreteglobalbasisfunction.hh:157
Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::LocalFunctionBase::bind
void bind(const Element &element)
Bind LocalFunction to grid element.
Definition discreteglobalbasisfunction.hh:124
Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::LocalFunctionBase::Element
typename EntitySet::Element Element
Definition discreteglobalbasisfunction.hh:76
Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::LocalFunctionBase::localContext
const Element & localContext() const
Return the element the local-function is bound to.
Definition discreteglobalbasisfunction.hh:163
Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::LocalFunctionBase::LocalFunctionBase
LocalFunctionBase(const LocalFunctionBase &other)
Copy-construct the local-function.
Definition discreteglobalbasisfunction.hh:92
Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::LocalFunctionBase::localDoFs_
std::vector< Coefficient > localDoFs_
Definition discreteglobalbasisfunction.hh:188
Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::LocalFunctionBase::assignWith
void assignWith(To &to, const From &from) const
Definition discreteglobalbasisfunction.hh:171
Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::LocalFunctionBase::data_
std::shared_ptr< const Data > data_
Definition discreteglobalbasisfunction.hh:186
Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::LocalFunctionBase::nodeToRangeEntry
decltype(auto) nodeToRangeEntry(const Node &node, const TreePath &treePath, Range &y) const
Definition discreteglobalbasisfunction.hh:181
Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::LocalFunctionBase::localView_
LocalView localView_
Definition discreteglobalbasisfunction.hh:187
Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::LocalFunctionBase::unbind
void unbind()
Unbind the local-function.
Definition discreteglobalbasisfunction.hh:151
Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::LocalFunctionBase::Domain
LocalDomain Domain
Definition discreteglobalbasisfunction.hh:75
Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::LocalFunctionBase::LocalFunctionBase
LocalFunctionBase(const std::shared_ptr< const Data > &data)
Definition discreteglobalbasisfunction.hh:79
Dune::Functions::DiscreteGlobalBasisFunctionDerivative
Derivative of a DiscreteGlobalBasisFunction.
Definition discreteglobalbasisfunction.hh:498
Dune::Functions::DiscreteGlobalBasisFunctionDerivative::Basis
typename Base::Basis Basis
Definition discreteglobalbasisfunction.hh:505
Dune::Functions::DiscreteGlobalBasisFunctionDerivative::derivative
friend Traits::DerivativeInterface derivative(const DiscreteGlobalBasisFunctionDerivative &f)
Definition discreteglobalbasisfunction.hh:667
Dune::Functions::DiscreteGlobalBasisFunctionDerivative::operator()
Range operator()(const Domain &x) const
Evaluate the discrete grid-function derivative in global coordinates.
Definition discreteglobalbasisfunction.hh:657
Dune::Functions::DiscreteGlobalBasisFunctionDerivative::Range
typename SignatureTraits< typename DiscreteGlobalBasisFunction::Traits::DerivativeInterface >::Range Range
Definition discreteglobalbasisfunction.hh:509
Dune::Functions::DiscreteGlobalBasisFunctionDerivative::localFunction
friend LocalFunction localFunction(const DiscreteGlobalBasisFunctionDerivative &f)
Construct local function from a DiscreteGlobalBasisFunctionDerivative.
Definition discreteglobalbasisfunction.hh:673
Dune::Functions::DiscreteGlobalBasisFunctionDerivative::DiscreteGlobalBasisFunctionDerivative
DiscreteGlobalBasisFunctionDerivative(const std::shared_ptr< const Data > &data)
create object from DiscreateGlobalBasisFunction data
Definition discreteglobalbasisfunction.hh:646
Dune::Functions::DiscreteGlobalBasisFunctionDerivative::DiscreteGlobalBasisFunction
DGBF DiscreteGlobalBasisFunction
Definition discreteglobalbasisfunction.hh:503
Dune::Functions::DiscreteGlobalBasisFunctionDerivative::Vector
typename Base::Vector Vector
Definition discreteglobalbasisfunction.hh:506
Dune::Functions::DiscreteGlobalBasisFunctionDerivative::Traits
Imp::GridFunctionTraits< Range(Domain), typename Base::EntitySet, DefaultDerivativeTraits, 16 > Traits
Definition discreteglobalbasisfunction.hh:511
Dune::Functions::DiscreteGlobalBasisFunctionDerivative::Domain
typename Base::Domain Domain
Definition discreteglobalbasisfunction.hh:508
Dune::Functions::DiscreteGlobalBasisFunction::derivative
friend DiscreteGlobalBasisFunctionDerivative< DiscreteGlobalBasisFunction > derivative(const DiscreteGlobalBasisFunction &f)
Derivative of the DiscreteGlobalBasisFunction.
Definition discreteglobalbasisfunction.hh:413
Dune::Functions::DiscreteGlobalBasisFunction::DiscreteGlobalBasisFunction
DiscreteGlobalBasisFunction(B_T &&basis, V_T &&coefficients, NTRE_T &&nodeToRangeEntry)
Create a grid-function, by wrapping the arguments in std::shared_ptr.
Definition discreteglobalbasisfunction.hh:388
Dune::Functions::DiscreteGlobalBasisFunction::DiscreteGlobalBasisFunction
DiscreteGlobalBasisFunction(std::shared_ptr< const Basis > basis, std::shared_ptr< const V > coefficients, std::shared_ptr< const typename Base::NodeToRangeEntry > nodeToRangeEntry)
Create a grid-function, by moving the arguments in std::shared_ptr.
Definition discreteglobalbasisfunction.hh:393
Dune::Functions::DiscreteGlobalBasisFunction::localFunction
friend LocalFunction localFunction(const DiscreteGlobalBasisFunction &t)
Construct local function from a DiscreteGlobalBasisFunction.
Definition discreteglobalbasisfunction.hh:426
Dune::Functions::DiscreteGlobalBasisFunction::Basis
typename Base::Basis Basis
Definition discreteglobalbasisfunction.hh:288
Dune::Functions::DiscreteGlobalBasisFunction::Traits
Imp::GridFunctionTraits< Range(Domain), typename Base::EntitySet, DefaultDerivativeTraits, 16 > Traits
Definition discreteglobalbasisfunction.hh:294
Dune::Functions::DiscreteGlobalBasisFunction::Range
R Range
Definition discreteglobalbasisfunction.hh:292
Dune::Functions::DiscreteGlobalBasisFunction::Vector
typename Base::Vector Vector
Definition discreteglobalbasisfunction.hh:289
Dune::Functions::DiscreteGlobalBasisFunction::Domain
typename Base::Domain Domain
Definition discreteglobalbasisfunction.hh:291
Dune::Functions::DiscreteGlobalBasisFunction::LocalFunction
Definition discreteglobalbasisfunction.hh:307
Dune::Functions::DiscreteGlobalBasisFunction::LocalFunction::Range
GlobalFunction::Range Range
Definition discreteglobalbasisfunction.hh:316
Dune::Functions::DiscreteGlobalBasisFunction::LocalFunction::Domain
typename LocalBase::Domain Domain
Definition discreteglobalbasisfunction.hh:315
Dune::Functions::DiscreteGlobalBasisFunction::LocalFunction::LocalFunction
LocalFunction(const DiscreteGlobalBasisFunction &globalFunction)
Create a local-function from the associated grid-function.
Definition discreteglobalbasisfunction.hh:320
Dune::Functions::DiscreteGlobalBasisFunction::LocalFunction::derivative
friend DiscreteGlobalBasisFunctionDerivative< DiscreteGlobalBasisFunction >::LocalFunction derivative(const LocalFunction &lf)
Local function of the derivative.
Definition discreteglobalbasisfunction.hh:374
Dune::Functions::DiscreteGlobalBasisFunction::LocalFunction::GlobalFunction
DiscreteGlobalBasisFunction GlobalFunction
Definition discreteglobalbasisfunction.hh:314
Dune::Functions::DiscreteGlobalBasisFunction::LocalFunction::operator()
Range operator()(const Domain &x) const
Evaluate this local-function in coordinates x in the bound element.
Definition discreteglobalbasisfunction.hh:336
Dune::Functions::DiscreteGlobalBasisFunction::LocalFunction::Element
typename LocalBase::Element Element
Definition discreteglobalbasisfunction.hh:317
Dune::Functions::DiscreteGlobalBasisFunctionDerivative::LocalFunction
local function evaluating the derivative in reference coordinates
Definition discreteglobalbasisfunction.hh:532
Dune::Functions::DiscreteGlobalBasisFunctionDerivative::LocalFunction::operator()
Range operator()(const Domain &x) const
Evaluate this local-function in coordinates x in the bound element.
Definition discreteglobalbasisfunction.hh:583
Dune::Functions::DiscreteGlobalBasisFunctionDerivative::LocalFunction::Domain
typename LocalBase::Domain Domain
Definition discreteglobalbasisfunction.hh:539
Dune::Functions::DiscreteGlobalBasisFunctionDerivative::LocalFunction::Element
typename LocalBase::Element Element
Definition discreteglobalbasisfunction.hh:541
Dune::Functions::DiscreteGlobalBasisFunctionDerivative::LocalFunction::derivative
friend Traits::LocalFunctionTraits::DerivativeInterface derivative(const LocalFunction &)
Not implemented.
Definition discreteglobalbasisfunction.hh:630
Dune::Functions::DiscreteGlobalBasisFunctionDerivative::LocalFunction::GlobalFunction
DiscreteGlobalBasisFunctionDerivative GlobalFunction
Definition discreteglobalbasisfunction.hh:538
Dune::Functions::DiscreteGlobalBasisFunctionDerivative::LocalFunction::Range
GlobalFunction::Range Range
Definition discreteglobalbasisfunction.hh:540
Dune::Functions::DiscreteGlobalBasisFunctionDerivative::LocalFunction::unbind
void unbind()
Unbind the local-function.
Definition discreteglobalbasisfunction.hh:564
Dune::Functions::DiscreteGlobalBasisFunctionDerivative::LocalFunction::LocalFunction
LocalFunction(const GlobalFunction &globalFunction)
Create a local function from the associated grid function.
Definition discreteglobalbasisfunction.hh:544
Dune::Functions::DiscreteGlobalBasisFunctionDerivative::LocalFunction::bind
void bind(const Element &element)
Bind LocalFunction to grid element.
Definition discreteglobalbasisfunction.hh:557
Dune::Functions::GridViewEntitySet
An entity set for all entities of given codim in a grid view.
Definition gridviewentityset.hh:27
Dune::Functions::GridViewEntitySet< GridView, 0 >::Element
GridView::template Codim< codim >::Entity Element
Definition gridviewentityset.hh:36
Dune::Functions::GridViewEntitySet< GridView, 0 >::LocalCoordinate
Element::Geometry::LocalCoordinate LocalCoordinate
Definition gridviewentityset.hh:39
Dune::Functions::GridViewEntitySet< GridView, 0 >::GlobalCoordinate
Element::Geometry::GlobalCoordinate GlobalCoordinate
Definition gridviewentityset.hh:40
concepts.hh