version 3.11-dev
Loading...
Searching...
No Matches
pq1.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//
12
13#ifndef DUMUX_DISCRETIZATION_PQ1_HH
14#define DUMUX_DISCRETIZATION_PQ1_HH
15
16#include <concepts>
17#include <type_traits>
18
19#include <dune/common/fvector.hh>
20#include <dune/geometry/multilineargeometry.hh>
21#include <dune/istl/bvector.hh>
22#include <dune/istl/bcrsmatrix.hh>
23
26#include <dumux/common/concepts/variables_.hh>
28#include <dumux/common/typetraits/boundary_.hh>
29
31#include <dumux/assembly/cvfelocalresidual_.hh>
33
38
47
52
54
55namespace Dumux::Properties {
56
58// Create new type tags
59namespace TTag {
60struct PQ1FVModel { using InheritsFrom = std::tuple<FiniteVolumeModel>; };
61struct PQ1FEModel { using InheritsFrom = std::tuple<GridProperties>; };
62} // end namespace TTag
63
65template<class TypeTag>
66struct GridGeometry<TypeTag, TTag::PQ1FVModel>
67{
68private:
69 static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridGeometryCache>();
72public:
74};
75
77template<class TypeTag>
78struct GridVolumeVariables<TypeTag, TTag::PQ1FVModel>
79{
80private:
85public:
87};
88
90template<class TypeTag>
91struct GridFluxVariablesCache<TypeTag, TTag::PQ1FVModel>
92{
93private:
94 static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridFluxVariablesCache>();
96
98 using FluxVariablesCache = GetPropTypeOr<TypeTag,
99 Properties::FluxVariablesCache, FluxVariablesCaching::EmptyCache<Scalar>
100 >;
101public:
103};
104
106template<class TypeTag>
107struct FluxVariablesCache<TypeTag, TTag::PQ1FVModel>
108{
109private:
112public:
114};
115
117template<class TypeTag>
118struct ElementBoundaryTypes<TypeTag, TTag::PQ1FVModel>
119{
120private:
123 using BoundaryTypes = typename ProblemTraits<Problem>::BoundaryTypes;
124public:
125 // Check if problem has new boundaryTypes interface
126 // then use ElementIntersectionBoundaryTypes
127 using type = std::conditional_t<
128 Dumux::Detail::hasProblemBoundaryTypesForFaceFunction<Problem, typename GG::LocalView>(),
131 >;
132};
133
134
136template<class TypeTag>
137struct GridGeometry<TypeTag, TTag::PQ1FEModel>
138{
139private:
140 static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridGeometryCache>();
143public:
145};
146
147template<class TypeTag>
161
163template<class TypeTag>
164struct ElementBoundaryTypes<TypeTag, TTag::PQ1FEModel>
165{
166private:
169 using BoundaryTypes = typename ProblemTraits<Problem>::BoundaryTypes;
170public:
171 using type = std::conditional_t<
172 Dumux::Detail::hasProblemBoundaryTypesForFaceFunction<Problem, typename GG::LocalView>(),
175 >;
176};
177
179template<class TypeTag>
180struct EnableGridVolumeVariablesCache<TypeTag, TTag::PQ1FEModel> { static constexpr bool value = false; };
181
183template<class TypeTag>
184struct SolutionVector<TypeTag, TTag::PQ1FEModel> { using type = Dune::BlockVector<GetPropType<TypeTag, Properties::PrimaryVariables>>; };
185
187template<class TypeTag>
188struct JacobianMatrix<TypeTag, TTag::PQ1FEModel>
189{
190private:
193 using MatrixBlock = typename Dune::FieldMatrix<Scalar, numEq, numEq>;
194public:
196};
197
198} // namespace Dumux::Properties
199
200namespace Dumux::Detail {
201
202template<class Problem>
204{
205private:
207public:
208 using GridGeometry = GG;
209 // Determine BoundaryTypes dependent on the used problem interface, either boundaryTypes(element, scv) or boundaryTypes(element, boundaryFace)
210 using BoundaryTypes = Detail::BoundaryTypes<Problem, typename GG::LocalView>::type;
211};
212
213template<class TypeTag>
214concept PQ1Model = std::is_same_v<
217>;
218
219template<class T>
221
222template<PQ1Model TypeTag>
224{
225private:
227 static constexpr bool usesGeneralGridVariables =
228 Dumux::Concept::GridVariables<GV> && !Dumux::Concept::FVGridVariables<GV>;
229public:
230 using type = std::conditional_t<usesGeneralGridVariables,
231 Dumux::Experimental::CVFELocalResidual<TypeTag>,
233};
234
235template<class TypeTag>
237
238template<PQ1FEModel TypeTag>
241
242} // end namespace Dumux::Detail
243
244#endif
The element-wise residual for grid-based discretization schemes.
Boundary flag to store e.g. in sub control volume faces.
Base class for the finite volume geometry vector for box schemes This builds up the sub control volum...
Definition discretization/box/fvgridgeometry.hh:83
Interpolation point data related to a local basis.
Definition cvfe/interpolationpointdata.hh:161
This class stores an array of BoundaryTypes objects.
Definition cvfe/elementboundarytypes.hh:28
Flux variables cache class for control-volume finite element schemes. For control-volume finite eleme...
Definition discretization/cvfe/fluxvariablescache.hh:34
Base class for the grid volume variables.
Definition cvfe/gridvolumevariables.hh:44
The element-wise residual for control-volume finite element schemes.
Definition cvfelocalresidual.hh:60
A class for providing the new update interface of variables. This allows to still use the VolumesVari...
Definition variablesadapter.hh:36
This class stores an array of BoundaryTypes objects. This class is not dependent on the used discreti...
Definition elementboundarytypes.hh:30
Base class for the grid local variables.
Definition fem/gridvariablescache.hh:50
The grid variables class for general schemes, storing variables and data.
Definition discretization/gridvariables.hh:27
The element-wise residual for grid-based discretization schemes.
Definition assembly/localresidual.hh:39
Definition matrix.hh:20
Defines all properties used in Dumux.
Type traits for problem classes.
Definition pq1.hh:236
Definition pq1.hh:220
Definition pq1.hh:214
Boundary types gathered on an element.
The local element solution class for control-volume finite element methods.
The grid volume variables class for control-volume finite element methods.
Classes representing interpolation point data for control-volume finite element schemes.
Calculates the element-wise residual for control-volume finite element schemes.
The default local operator than can be specialized for each discretization scheme.
Base class for the finite volume geometry vector for box models This builds up the sub control volume...
Flux variables cache class for control-volume finite element schemes.
Global flux variable cache.
The grid variables class for general schemes, storing variables and data.
Boundary types gathered on an element.
The element variables class.
The grid local variables class for finite element methods.
Classes related to flux variables caching.
Declares properties required for finite-volume models models.
CVFEGridFluxVariablesCacheImpl< Problem, FluxVariablesCache, cachingEnabled, Traits, Detail::ScvfQuadratureRuleOrDefault_t< typename Traits::FluxVariablesCache > > CVFEGridFluxVariablesCache
Flux variable caches on a gridview.
Definition discretization/cvfe/gridfluxvariablescache.hh:58
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:310
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition propertysystem.hh:296
typename GetPropOr< TypeTag, Property, T >::type GetPropTypeOr
get the type alias defined in the property or the type T if the property is undefined
Definition propertysystem.hh:303
constexpr bool inheritsFrom()
Return true if the given type tag inherits from the given parent type tag.
Definition propertysystem.hh:262
The available discretization methods in Dumux.
Definition boxgeometryhelper.hh:55
Definition cvfelocalresidual.hh:25
typename ProblemGridGeometryHelper< Problem >::type ProblemGridGeometry
Definition common/typetraits/problem.hh:40
Definition method.hh:20
CVFE< CVFEMethods::PQ1 > PQ1
Definition method.hh:108
FEGridDiscretization< GV, Traits > PQ1FEGridDiscretization
Finite element grid discretization for the PQ1 FE method.
Definition pq1/fegriddiscretization.hh:92
Type tag for numeric models.
Definition grid.hh:24
The energy balance equation for a porous solid.
Definition common/properties.hh:26
Finite element grid discretization for the PQ1 FE method.
Definition cvfe/gridvolumevariables.hh:31
CCLocalResidual< TypeTag > type
Definition ccmpfa.hh:185
Definition defaultlocaloperator.hh:19
Detail::BoundaryTypes< Problem, typename GG::LocalView >::type BoundaryTypes
Definition pq1.hh:210
Definition common/typetraits/problem.hh:23
Definition fem/gridvariablescache.hh:36
An empty flux variables cache.
Definition fluxvariablescaching.hh:35
typename Detail::template ProblemTraits< Problem, typename GridGeometry::DiscretizationMethod >::BoundaryTypes BoundaryTypes
Definition common/typetraits/problem.hh:51
std::conditional_t< Dumux::Detail::hasProblemBoundaryTypesForFaceFunction< Problem, typename GG::LocalView >(), Dumux::ElementIntersectionBoundaryTypes< BoundaryTypes >, Dumux::CVFEElementBoundaryTypes< BoundaryTypes > > type
Definition pq1.hh:171
std::conditional_t< Dumux::Detail::hasProblemBoundaryTypesForFaceFunction< Problem, typename GG::LocalView >(), Dumux::ElementIntersectionBoundaryTypes< BoundaryTypes >, Dumux::CVFEElementBoundaryTypes< BoundaryTypes > > type
Definition pq1.hh:127
CVFEFluxVariablesCache< Scalar, GridGeometry > type
Definition pq1.hh:113
CVFEGridFluxVariablesCache< Problem, FluxVariablesCache, enableCache > type
Definition pq1.hh:102
Dumux::Experimental::PQ1FEGridDiscretization< Scalar, GridView, enableCache > type
Definition pq1.hh:144
BoxFVGridGeometry< Scalar, GridView, enableCache > type
Definition pq1.hh:73
Dumux::Experimental::GridVariables< GG, GVC > type
Definition pq1.hh:159
CVFEGridVolumeVariables< Traits, enableCache > type
Definition pq1.hh:86
typename Dune::BCRSMatrix< MatrixBlock > type
Definition pq1.hh:195
Dune::BlockVector< GetPropType< TypeTag, Properties::PrimaryVariables > > type
Definition pq1.hh:184
std::tuple< GridProperties > InheritsFrom
Definition pq1.hh:61
std::tuple< FiniteVolumeModel > InheritsFrom
Definition pq1.hh:60