version 3.8
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-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_GRID_GEOMETRY_HH
14#define DUMUX_DISCRETIZATION_FE_GRID_GEOMETRY_HH
15
16#include <unordered_map>
17
20
26
27namespace Dumux {
28
35template<class FEBasis, class MapperTraits = DefaultMapperTraits<typename FEBasis::GridView>>
36struct DefaultFEGridGeometryTraits : public MapperTraits
37{
38 template<class GridGeometry>
40};
41
49template<class FEB, class Traits = DefaultFEGridGeometryTraits<FEB>>
51: public BaseGridGeometry< typename FEB::GridView, Traits >
52{
55
56 using GridIndexType = typename IndexTraits<typename FEB::GridView>::GridIndex;
57 using LocalIndexType = typename IndexTraits<typename FEB::GridView>::LocalIndex;
58
59public:
62 static constexpr DiscretizationMethod discMethod{};
63
65 using GridView = typename FEB::GridView;
69 using FEBasis = FEB;
71 using LocalView = typename Traits::template LocalView<ThisType>;
72
74 FEGridGeometry(std::shared_ptr<FEBasis> feBasis)
76 , feBasis_(feBasis)
77 {
78 // Check if the overlap size is what we expect
80 DUNE_THROW(Dune::InvalidStateException, "The finite element discretization method only works with zero overlap for parallel computations. "
81 << " Set the parameter \"Grid.Overlap\" in the input file.");
82 }
83
85 auto numDofs() const
86 { return feBasis_->size(); }
87
89 const FEBasis& feBasis() const
90 { return *feBasis_; }
91
93 bool dofOnPeriodicBoundary(GridIndexType dofIdx) const
94 { DUNE_THROW(Dune::NotImplemented, "Periodic BC support for FEM schemes"); }
95
97 GridIndexType periodicallyMappedDof(GridIndexType dofIdx) const
98 { DUNE_THROW(Dune::NotImplemented, "Periodic BC support for FEM schemes"); }
99
101 const std::unordered_map<GridIndexType, GridIndexType>& periodicVertexMap() const
102 { DUNE_THROW(Dune::NotImplemented, "Periodic BC support for FEM schemes"); }
103
104private:
105 std::shared_ptr<FEBasis> feBasis_;
106};
107
108} // end namespace Dumux
109
110#endif
Base class for grid geometries.
Check the overlap size for different discretization methods.
Base class for all grid geometries.
Definition: basegridgeometry.hh:52
const GridView & gridView() const
Return the gridView this grid geometry object lives on.
Definition: basegridgeometry.hh:100
Grid geometry local view, which is a wrapper around a finite element basis local view.
Definition: feelementgeometry.hh:29
The grid geometry class for models using finite element schemes. This is basically a wrapper around a...
Definition: fegridgeometry.hh:52
GridIndexType periodicallyMappedDof(GridIndexType dofIdx) const
The index of the vertex / d.o.f. on the other side of the periodic boundary.
Definition: fegridgeometry.hh:97
const FEBasis & feBasis() const
The total number of degrees of freedom.
Definition: fegridgeometry.hh:89
auto numDofs() const
The total number of degrees of freedom.
Definition: fegridgeometry.hh:85
typename Traits::template LocalView< ThisType > LocalView
export local view
Definition: fegridgeometry.hh:71
FEB FEBasis
export the type of finite element basis
Definition: fegridgeometry.hh:69
bool dofOnPeriodicBoundary(GridIndexType dofIdx) const
If a vertex / d.o.f. is on a periodic boundary.
Definition: fegridgeometry.hh:93
Extrusion_t< Traits > Extrusion
export the type of extrusion
Definition: fegridgeometry.hh:67
typename FEB::GridView GridView
export the grid view type
Definition: fegridgeometry.hh:65
const std::unordered_map< GridIndexType, GridIndexType > & periodicVertexMap() const
Returns the map between dofs across periodic boundaries.
Definition: fegridgeometry.hh:101
static constexpr DiscretizationMethod discMethod
Definition: fegridgeometry.hh:62
FEGridGeometry(std::shared_ptr< FEBasis > feBasis)
Constructor.
Definition: fegridgeometry.hh:74
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.
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:166
Check if the overlap size is valid for a given discretization method.
Definition: checkoverlapsize.hh:28
Default Traits class for the fem grid geometry.
Definition: fegridgeometry.hh:37
Definition: method.hh:122
typename GridView::IndexSet::IndexType GridIndex
Definition: indextraits.hh:27
unsigned int LocalIndex
Definition: indextraits.hh:28