3.2-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
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 * 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
35
36namespace Dumux {
37
44template<class FEBasis, class MapperTraits = DefaultMapperTraits<typename FEBasis::GridView>>
45struct DefaultFEGridGeometryTraits : public MapperTraits
46{
47 template<class GridGeometry>
49};
50
58template<class FEB, class Traits = DefaultFEGridGeometryTraits<FEB>>
60: public BaseGridGeometry< typename FEB::GridView, Traits >
61{
62 using ThisType = FEGridGeometry<FEB, Traits>;
64
65 using GridIndexType = typename IndexTraits<typename FEB::GridView>::GridIndex;
66 using LocalIndexType = typename IndexTraits<typename FEB::GridView>::LocalIndex;
67
68public:
71
73 using GridView = typename FEB::GridView;
75 using FEBasis = FEB;
77 using LocalView = typename Traits::template LocalView<ThisType>;
78
80 FEGridGeometry(std::shared_ptr<FEBasis> feBasis)
81 : ParentType(feBasis->gridView())
82 , feBasis_(feBasis)
83 {
84 // Check if the overlap size is what we expect
86 DUNE_THROW(Dune::InvalidStateException, "The finite element discretization method only works with zero overlap for parallel computations. "
87 << " Set the parameter \"Grid.Overlap\" in the input file.");
88 }
89
91 auto numDofs() const
92 { return feBasis_->size(); }
93
95 const FEBasis& feBasis() const
96 { return *feBasis_; }
97
99 bool dofOnPeriodicBoundary(GridIndexType dofIdx) const
100 { DUNE_THROW(Dune::NotImplemented, "Periodic BC support for FEM schemes"); }
101
103 GridIndexType periodicallyMappedDof(GridIndexType dofIdx) const
104 { DUNE_THROW(Dune::NotImplemented, "Periodic BC support for FEM schemes"); }
105
107 const std::unordered_map<GridIndexType, GridIndexType>& periodicVertexMap() const
108 { DUNE_THROW(Dune::NotImplemented, "Periodic BC support for FEM schemes"); }
109
110private:
111 std::shared_ptr<FEBasis> feBasis_;
112};
113
114} // end namespace Dumux
115
116#endif
Defines the default element and vertex mapper types.
Defines the index types used for grid and local indices.
Grid geometry local view, which is a wrapper around a finite element basis local view.
Check the overlap size for different discretization methods.
The available discretization methods in Dumux.
Base class for grid geometries.
BaseGridGeometry(const GridView &gridView)
Constructor computes the bouding box of the entire domain, for e.g. setting boundary conditions.
Definition basegridgeometry.hh:77
DiscretizationMethod
The available discretization methods in Dumux.
Definition method.hh:37
@ fem
Definition method.hh:38
Definition adapt.hh:29
typename GridView::IndexSet::IndexType GridIndex
Definition indextraits.hh:39
unsigned int LocalIndex
Definition indextraits.hh:40
const GridView & gridView() const
Definition basegridgeometry.hh:107
static bool isValid(const GridView &gridView) noexcept
Definition checkoverlapsize.hh:42
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:46
FEElementGeometry< GridGeometry > LocalView
Definition fegridgeometry.hh:48
GridIndexType periodicallyMappedDof(GridIndexType dofIdx) const
The index of the vertex / d.o.f. on the other side of the periodic boundary.
Definition fegridgeometry.hh:103
const FEBasis & feBasis() const
Definition fegridgeometry.hh:95
auto numDofs() const
The total number of degrees of freedom.
Definition fegridgeometry.hh:91
typename Traits::template LocalView< ThisType > LocalView
Definition fegridgeometry.hh:77
FEB FEBasis
Definition fegridgeometry.hh:75
bool dofOnPeriodicBoundary(GridIndexType dofIdx) const
If a vertex / d.o.f. is on a periodic boundary.
Definition fegridgeometry.hh:99
typename FEB::GridView GridView
Definition fegridgeometry.hh:73
const std::unordered_map< GridIndexType, GridIndexType > & periodicVertexMap() const
Returns the map between dofs across periodic boundaries.
Definition fegridgeometry.hh:107
static constexpr DiscretizationMethod discMethod
Definition fegridgeometry.hh:70
FEGridGeometry(std::shared_ptr< FEBasis > feBasis)
Constructor.
Definition fegridgeometry.hh:80