version 3.11-dev
Loading...
Searching...
No Matches
elementdofs.hh
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3//
4// SPDX-FileCopyrightText: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
12
13#ifndef DUMUX_MULTIDOMAIN_EMBEDDED_ELEMENTDOFS_HH
14#define DUMUX_MULTIDOMAIN_EMBEDDED_ELEMENTDOFS_HH
15
16#include <type_traits>
17#include <utility>
18#include <vector>
19
20#include <dumux/common/typetraits/localdofs_.hh>
22
24
31template<class ElementDiscretization>
32auto elementDofIndices(const ElementDiscretization& elemDisc)
33{
34 using LocalDof = std::decay_t<decltype(*localDofs(std::declval<const ElementDiscretization&>()).begin())>;
35 std::vector<typename LocalDof::GridIndexType> dofIndices(Dumux::Detail::LocalDofs::numLocalDofs(elemDisc));
36 for (const auto& localDof : localDofs(elemDisc))
37 dofIndices[localDof.index()] = localDof.dofIndex();
38 return dofIndices;
39}
40
50template<class GridDiscretization, class Geometry, class GlobalPosition, class ShapeValues>
51void basisFunctionValues(const GridDiscretization& gridDiscretization,
52 const Geometry& geometry,
53 const GlobalPosition& globalPos,
54 ShapeValues& shapeValues)
55{
56 const auto ipLocal = geometry.local(globalPos);
57 gridDiscretization.feCache().get(geometry.type()).localBasis().evaluateFunction(ipLocal, shapeValues);
58}
59
60} // end namespace Dumux::EmbeddedCoupling
61
62#endif
void basisFunctionValues(const GridDiscretization &gridDiscretization, const Geometry &geometry, const GlobalPosition &globalPos, ShapeValues &shapeValues)
The values of the basis functions of an element at a position.
Definition elementdofs.hh:51
auto elementDofIndices(const ElementDiscretization &elemDisc)
The global dof indices of the local dofs of the bound element of a control-volume finite element or f...
Definition elementdofs.hh:32
decltype(auto) gridDiscretization(const T &t, Args &&... args)
The grid discretization.
Definition griddiscretization.hh:98
Class representing dofs on elements for control-volume finite element schemes.
Definition circlepoints.hh:24
auto localDofs(const FVElementGeometry &fvGeometry)
range over local dofs
Definition localdof.hh:50