version 3.11-dev
Loading...
Searching...
No Matches
fegridgeometry.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//
13#ifndef DUMUX_DISCRETIZATION_FE_GRID_GEOMETRY_HH
14#define DUMUX_DISCRETIZATION_FE_GRID_GEOMETRY_HH
15
16#include <ranges>
17#include <span>
18#include <unordered_map>
19
22
28
29namespace Dumux {
30
37template<class FEBasis, class MapperTraits = DefaultMapperTraits<typename FEBasis::GridView>>
38struct DefaultFEGridGeometryTraits : public MapperTraits
39{
40 template<class GridGeometry>
42};
43
51template<class FEB, class Traits = DefaultFEGridGeometryTraits<FEB>>
53: public BaseGridGeometry< typename FEB::GridView, Traits >
54{
55 using ThisType = FEGridGeometry<FEB, Traits>;
57
58 using GridIndexType = typename IndexTraits<typename FEB::GridView>::GridIndex;
59 using LocalIndexType = typename IndexTraits<typename FEB::GridView>::LocalIndex;
60
61public:
64 static constexpr DiscretizationMethod discMethod{};
65
67 using GridView = typename FEB::GridView;
71 using FEBasis = FEB;
73 using LocalView = typename Traits::template LocalView<ThisType>;
74
76 FEGridGeometry(std::shared_ptr<FEBasis> feBasis)
77 : ParentType(feBasis->gridView())
78 , feBasis_(feBasis)
79 {
80 // Check if the overlap size is what we expect
82 DUNE_THROW(Dune::InvalidStateException, "The finite element discretization method only works with zero overlap for parallel computations. "
83 << " Set the parameter \"Grid.Overlap\" in the input file.");
84 }
85
87 auto numDofs() const
88 { return feBasis_->size(); }
89
91 const FEBasis& feBasis() const
92 { return *feBasis_; }
93
95 bool dofOnPeriodicBoundary(GridIndexType dofIdx) const
96 { DUNE_THROW(Dune::NotImplemented, "Periodic BC support for FEM schemes"); }
97
99 [[deprecated("Will be removed after release 3.11. Use periodicallyMappedDofs, returning a range of dofs")]]
100 GridIndexType periodicallyMappedDof(GridIndexType dofIdx) const
101 { DUNE_THROW(Dune::NotImplemented, "Periodic BC support for FEM schemes"); }
102
104 std::span<const GridIndexType> periodicallyMappedDofs(GridIndexType dofIdx) const
105 { DUNE_THROW(Dune::NotImplemented, "Periodic BC support for FEM schemes"); }
106
107private:
108 std::shared_ptr<FEBasis> feBasis_;
109};
110
111} // end namespace Dumux
112
113#endif
Base class for grid geometries.
Check the overlap size for different discretization methods.
const GridView & gridView() const
Definition basegridgeometry.hh:100
Grid geometry local view, which is a wrapper around a finite element basis local view.
Definition feelementgeometry.hh:29
GridIndexType periodicallyMappedDof(GridIndexType dofIdx) const
The index of the vertex / d.o.f. on the other side of the periodic boundary.
Definition fegridgeometry.hh:100
DiscretizationMethods::FEM DiscretizationMethod
Definition fegridgeometry.hh:63
const FEBasis & feBasis() const
Definition fegridgeometry.hh:91
auto numDofs() const
The total number of degrees of freedom.
Definition fegridgeometry.hh:87
typename Traits::template LocalView< ThisType > LocalView
Definition fegridgeometry.hh:73
std::span< const GridIndexType > periodicallyMappedDofs(GridIndexType dofIdx) const
The indices of the vertices / d.o.f.s on the other side of the periodic boundary.
Definition fegridgeometry.hh:104
FEB FEBasis
Definition fegridgeometry.hh:71
bool dofOnPeriodicBoundary(GridIndexType dofIdx) const
If a vertex / d.o.f. is on a periodic boundary.
Definition fegridgeometry.hh:95
Extrusion_t< Traits > Extrusion
Definition fegridgeometry.hh:69
typename FEB::GridView GridView
Definition fegridgeometry.hh:67
static constexpr DiscretizationMethod discMethod
Definition fegridgeometry.hh:64
FEGridGeometry(std::shared_ptr< FEBasis > feBasis)
Constructor.
Definition fegridgeometry.hh:76
Defines the default element and vertex mapper types.
Helper classes to compute the integration elements.
Grid geometry local view, which is a wrapper around a finite element basis local view.
BaseGridGeometry(std::shared_ptr< BaseImplementation > impl)
Constructor from a BaseImplementation.
Definition basegridgeometry.hh:72
Defines the index types used for grid and local indices.
The available discretization methods in Dumux.
Definition adapt.hh:17
typename Extrusion< T >::type Extrusion_t
Convenience alias for obtaining the extrusion type.
Definition extrusion.hh:257
static bool isValid(const GridView &gridView) noexcept
Definition checkoverlapsize.hh:30
Default Traits class for the fem grid geometry.
Definition fegridgeometry.hh:39
FEElementGeometry< GridGeometry > LocalView
Definition fegridgeometry.hh:41
Definition method.hh:151
typename GridView::IndexSet::IndexType GridIndex
Definition indextraits.hh:27
unsigned int LocalIndex
Definition indextraits.hh:28