3.3.0
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
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 * See the file COPYING for full copying permissions. *
5 * *
6 * This program is free software: you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation, either version 3 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
18 *****************************************************************************/
25#ifndef DUMUX_DISCRETIZATION_FE_GRID_GEOMETRY_HH
26#define DUMUX_DISCRETIZATION_FE_GRID_GEOMETRY_HH
27
30
36
37namespace Dumux {
38
45template<class FEBasis, class MapperTraits = DefaultMapperTraits<typename FEBasis::GridView>>
46struct DefaultFEGridGeometryTraits : public MapperTraits
47{
48 template<class GridGeometry>
50};
51
59template<class FEB, class Traits = DefaultFEGridGeometryTraits<FEB>>
61: public BaseGridGeometry< typename FEB::GridView, Traits >
62{
65
66 using GridIndexType = typename IndexTraits<typename FEB::GridView>::GridIndex;
67 using LocalIndexType = typename IndexTraits<typename FEB::GridView>::LocalIndex;
68
69public:
72
74 using GridView = typename FEB::GridView;
78 using FEBasis = FEB;
80 using LocalView = typename Traits::template LocalView<ThisType>;
81
83 FEGridGeometry(std::shared_ptr<FEBasis> feBasis)
85 , feBasis_(feBasis)
86 {
87 // Check if the overlap size is what we expect
89 DUNE_THROW(Dune::InvalidStateException, "The finite element discretization method only works with zero overlap for parallel computations. "
90 << " Set the parameter \"Grid.Overlap\" in the input file.");
91 }
92
94 auto numDofs() const
95 { return feBasis_->size(); }
96
98 const FEBasis& feBasis() const
99 { return *feBasis_; }
100
102 bool dofOnPeriodicBoundary(GridIndexType dofIdx) const
103 { DUNE_THROW(Dune::NotImplemented, "Periodic BC support for FEM schemes"); }
104
106 GridIndexType periodicallyMappedDof(GridIndexType dofIdx) const
107 { DUNE_THROW(Dune::NotImplemented, "Periodic BC support for FEM schemes"); }
108
110 const std::unordered_map<GridIndexType, GridIndexType>& periodicVertexMap() const
111 { DUNE_THROW(Dune::NotImplemented, "Periodic BC support for FEM schemes"); }
112
113private:
114 std::shared_ptr<FEBasis> feBasis_;
115};
116
117} // end namespace Dumux
118
119#endif
Defines the index types used for grid and local indices.
Defines the default element and vertex mapper types.
The available discretization methods in Dumux.
Grid geometry local view, which is a wrapper around a finite element basis local view.
Check the overlap size for different discretization methods.
Helper classes to compute the integration elements.
Base class for grid geometries.
DiscretizationMethod
The available discretization methods in Dumux.
Definition: method.hh:37
Definition: adapt.hh:29
typename Extrusion< T >::type Extrusion_t
Convenience alias for obtaining the extrusion type.
Definition: extrusion.hh:177
typename GridView::IndexSet::IndexType GridIndex
Definition: indextraits.hh:39
unsigned int LocalIndex
Definition: indextraits.hh:40
Base class for all finite volume grid geometries.
Definition: basegridgeometry.hh:49
const GridView & gridView() const
Return the gridView this grid geometry object lives on.
Definition: basegridgeometry.hh:107
Check if the overlap size is valid for a given discretization method.
Definition: checkoverlapsize.hh:40
Grid geometry local view, which is a wrapper around a finite element basis local view.
Definition: feelementgeometry.hh:39
Default Traits class for the fem grid geometry.
Definition: fegridgeometry.hh:47
The grid geometry class for models using finite element schemes. This is basically a wrapper around a...
Definition: fegridgeometry.hh:62
GridIndexType periodicallyMappedDof(GridIndexType dofIdx) const
The index of the vertex / d.o.f. on the other side of the periodic boundary.
Definition: fegridgeometry.hh:106
const FEBasis & feBasis() const
The total number of degrees of freedom.
Definition: fegridgeometry.hh:98
auto numDofs() const
The total number of degrees of freedom.
Definition: fegridgeometry.hh:94
typename Traits::template LocalView< ThisType > LocalView
export local view
Definition: fegridgeometry.hh:80
FEB FEBasis
export the type of finite element basis
Definition: fegridgeometry.hh:78
bool dofOnPeriodicBoundary(GridIndexType dofIdx) const
If a vertex / d.o.f. is on a periodic boundary.
Definition: fegridgeometry.hh:102
Extrusion_t< Traits > Extrusion
export the type of extrusion
Definition: fegridgeometry.hh:76
typename FEB::GridView GridView
export the grid view type
Definition: fegridgeometry.hh:74
const std::unordered_map< GridIndexType, GridIndexType > & periodicVertexMap() const
Returns the map between dofs across periodic boundaries.
Definition: fegridgeometry.hh:110
static constexpr DiscretizationMethod discMethod
export discretization method
Definition: fegridgeometry.hh:71
FEGridGeometry(std::shared_ptr< FEBasis > feBasis)
Constructor.
Definition: fegridgeometry.hh:83