version 3.10-dev
feelementgeometry.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-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
13#ifndef DUMUX_DISCRETIZATION_FE_ELEMENT_GEOMETRY_HH
14#define DUMUX_DISCRETIZATION_FE_ELEMENT_GEOMETRY_HH
15
16#include <utility>
17
18namespace Dumux {
19
27template<class GridGeometry>
29{
30 using GridView = typename GridGeometry::GridView;
31
32 using FEBasis = typename GridGeometry::FEBasis;
33 using FEBasisLocalView = typename FEBasis::LocalView;
34
35public:
37 using Element = typename GridView::template Codim<0>::Entity;
38
40 FEElementGeometry(const GridGeometry& gg)
41 : gridGeometry_(gg)
42 , feBasisLocalView_(gg.feBasis().localView())
43 {}
44
51 {
52 this->bind(element);
53 return std::move(*this);
54 }
55
57 void bind(const Element& element) &
58 { feBasisLocalView_.bind(element); }
59
66 {
67 this->bindElement(element);
68 return std::move(*this);
69 }
70
73 { bind(element); }
74
76 bool isBound() const
77 { return feBasisLocalView_.isBound(); }
78
80 const Element& element() const
81 { return feBasisLocalView_.element(); }
82
84 const FEBasisLocalView& feBasisLocalView() const
85 { return feBasisLocalView_; }
86
88 const GridGeometry& gridGeometry() const
89 { return gridGeometry_; }
90
91private:
92 const GridGeometry& gridGeometry_;
93 FEBasisLocalView feBasisLocalView_;
94};
95
96} // end namespace Dumux
97
98#endif
Grid geometry local view, which is a wrapper around a finite element basis local view.
Definition: feelementgeometry.hh:29
const Element & element() const
The bound element.
Definition: feelementgeometry.hh:80
bool isBound() const
Returns true if bind/bindElement has already been called.
Definition: feelementgeometry.hh:76
FEElementGeometry bindElement(const Element &element) &&
bind the local view (r-value overload) This overload is called when an instance of this class is a te...
Definition: feelementgeometry.hh:65
const GridGeometry & gridGeometry() const
Return reference to the grid geometry.
Definition: feelementgeometry.hh:88
typename GridView::template Codim< 0 >::Entity Element
export type of the element
Definition: feelementgeometry.hh:37
FEElementGeometry bind(const Element &element) &&
bind the local view (r-value overload) This overload is called when an instance of this class is a te...
Definition: feelementgeometry.hh:50
void bind(const Element &element) &
Prepare element-local data.
Definition: feelementgeometry.hh:57
FEElementGeometry(const GridGeometry &gg)
constructor taking grid geometry
Definition: feelementgeometry.hh:40
void bindElement(const Element &element) &
Prepare element-local data.
Definition: feelementgeometry.hh:72
const FEBasisLocalView & feBasisLocalView() const
Return the finite element basis local view.
Definition: feelementgeometry.hh:84
GridCache::LocalView localView(const GridCache &gridCache)
Free function to get the local view of a grid cache object.
Definition: localview.hh:26
Definition: adapt.hh:17