version 3.10-dev
functionspacebasis.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//
14#ifndef DUMUX_DISCRETIZATION_FUNCTION_SPACE_BASIS_HH
15#define DUMUX_DISCRETIZATION_FUNCTION_SPACE_BASIS_HH
16
17#if HAVE_DUNE_FUNCTIONS
18
20#include <dune/functions/functionspacebases/lagrangebasis.hh>
21
22namespace Dumux {
23
31template< class GridGeometry, class DiscretizationMethod = typename GridGeometry::DiscretizationMethod >
32struct FunctionSpaceBasisTraits;
33
39template<class GridGeometry, std::enable_if_t<GridGeometry::discMethod != DiscretizationMethods::fem, int> = 0>
40typename FunctionSpaceBasisTraits<GridGeometry>::GlobalBasis
41getFunctionSpaceBasis(const GridGeometry& gridGeometry)
42{ return {gridGeometry.gridView()}; }
43
48template<class GridGeometry, std::enable_if_t<GridGeometry::discMethod == DiscretizationMethods::fem, int> = 0>
49const typename FunctionSpaceBasisTraits<GridGeometry>::GlobalBasis&
50getFunctionSpaceBasis(const GridGeometry& gridGeometry)
51{ return gridGeometry.feBasis(); }
52
53
55// Specializations of the FunctionSpaceBasisTraits class //
57
59template< class GridGeometry >
60struct FunctionSpaceBasisTraits<GridGeometry, DiscretizationMethods::Box>
61{ using GlobalBasis = Dune::Functions::LagrangeBasis<typename GridGeometry::GridView, /*order*/1>; };
62
64template< class GridGeometry >
65struct FunctionSpaceBasisTraits<GridGeometry, DiscretizationMethods::CCTpfa>
66{ using GlobalBasis = Dune::Functions::LagrangeBasis<typename GridGeometry::GridView, /*order*/0>; };
67
69template< class GridGeometry >
70struct FunctionSpaceBasisTraits<GridGeometry, DiscretizationMethods::CCMpfa>
71{ using GlobalBasis = Dune::Functions::LagrangeBasis<typename GridGeometry::GridView, /*order*/0>; };
72
74template< class GridGeometry >
75struct FunctionSpaceBasisTraits<GridGeometry, DiscretizationMethods::FEM>
76{ using GlobalBasis = typename GridGeometry::FEBasis; };
77
78} // end namespace Dumux
79
80#endif // HAVE_DUNE_FUNCTIONS
81#endif
The available discretization methods in Dumux.
CVFE< CVFEMethods::PQ1 > Box
Definition: method.hh:94
Definition: adapt.hh:17