Loading...
Searching...
No Matches
boundarydofs.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_FUNCTIONSPACEBASES_BOUNDARYDOFS_HH
#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BOUNDARYDOFS_HH
#include <utility>
#include <dune/functions/functionspacebases/subentitydofs.hh>
namespace Dune {
namespace Functions {
template<class Basis, class F,
decltype(std::declval<std::decay_t<F>>()(0, std::declval<typename Basis::LocalView>(),std::declval<typename Basis::GridView::Intersection>()), 0) = 0>
void forEachBoundaryDOF(const Basis& basis, F&& f)
{
auto localView = basis.localView();
auto seDOFs = subEntityDOFs(basis);
const auto& gridView = basis.gridView();
for(auto&& element : elements(gridView))
if (element.hasBoundaryIntersections())
{
localView.bind(element);
for(const auto& intersection: intersections(gridView, element))
if (intersection.boundary())
for(auto localIndex: seDOFs.bind(localView,intersection))
f(localIndex, localView, intersection);
}
}
template<class Basis, class F,
decltype(std::declval<std::decay_t<F>>()(0, std::declval<typename Basis::LocalView>()),0) = 0>
void forEachBoundaryDOF(const Basis& basis, F&& f)
{
auto localView = basis.localView();
auto seDOFs = subEntityDOFs(basis);
const auto& gridView = basis.gridView();
for(auto&& element : elements(gridView))
if (element.hasBoundaryIntersections())
{
localView.bind(element);
for(const auto& intersection: intersections(gridView, element))
if (intersection.boundary())
for(auto localIndex: seDOFs.bind(localView,intersection))
f(localIndex, localView);
}
}
template<class Basis, class F,
decltype(std::declval<std::decay_t<F>>()(std::declval<typename Basis::MultiIndex>()),0) = 0>
void forEachBoundaryDOF(const Basis& basis, F&& f)
{
auto localView = basis.localView();
auto seDOFs = subEntityDOFs(basis);
const auto& gridView = basis.gridView();
for(auto&& element : elements(gridView))
if (element.hasBoundaryIntersections())
{
localView.bind(element);
for(const auto& intersection: intersections(gridView, element))
if (intersection.boundary())
for(auto localIndex: seDOFs.bind(localView,intersection))
f(localView.index(localIndex));
}
}
} // namespace Functions
} // namespace Dune
#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BOUNDARYDOFS_HH
subentitydofs.hh
Dune::Functions::subEntityDOFs
auto subEntityDOFs(const T &)
Create SubEntityDOFs object.
Definition subentitydofs.hh:167
Dune::Functions::forEachBoundaryDOF
void forEachBoundaryDOF(const Basis &basis, F &&f)
Loop over all DOFs on the boundary.
Definition boundarydofs.hh:40
Dune
Definition monomialset.hh:19
Dune::Functions
Definition monomialset.hh:19