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
46
49
51
52namespace Dumux::Properties {
53
55// Create new type tags
56namespace TTag {
57struct PQ1FVModel { using InheritsFrom = std::tuple<FiniteVolumeModel>; };
58struct PQ1FEModel { using InheritsFrom = std::tuple<GridProperties>; };
59} // end namespace TTag
60
62template<class TypeTag>
63struct GridGeometry<TypeTag, TTag::PQ1FVModel>
64{
65private:
66 static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridGeometryCache>();
69public:
71};
72
74template<class TypeTag>
75struct GridVolumeVariables<TypeTag, TTag::PQ1FVModel>
76{
77private:
82public:
84};
85
87template<class TypeTag>
88struct GridFluxVariablesCache<TypeTag, TTag::PQ1FVModel>
89{
90private:
91 static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridFluxVariablesCache>();
93
95 using FluxVariablesCache = GetPropTypeOr<TypeTag,
96 Properties::FluxVariablesCache, FluxVariablesCaching::EmptyCache<Scalar>
97 >;
98public:
100};
101
103template<class TypeTag>
104struct GridVariables<TypeTag, TTag::PQ1FVModel>
106
108template<class TypeTag>
109struct FluxVariablesCache<TypeTag, TTag::PQ1FVModel>
110{
111private:
114public:
116};
117
119template<class TypeTag>
120struct ElementBoundaryTypes<TypeTag, TTag::PQ1FVModel>
121{
122private:
125 using BoundaryTypes = typename ProblemTraits<Problem>::BoundaryTypes;
126public:
127 // Check if problem has new boundaryTypes interface
128 // then use ElementIntersectionBoundaryTypes
129 using type = std::conditional_t<
130 Dumux::Detail::hasProblemBoundaryTypesForFaceFunction<Problem, typename GG::LocalView>(),
133 >;
134};
135
136
138template<class TypeTag>
139struct GridGeometry<TypeTag, TTag::PQ1FEModel>
140{
141private:
142 static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridGeometryCache>();
145public:
147};
148
149template<class TypeTag>
150struct GridVariables<TypeTag, TTag::PQ1FEModel>
152
154template<class TypeTag>
155struct ElementBoundaryTypes<TypeTag, TTag::PQ1FEModel>
156{
157private:
160 using BoundaryTypes = typename ProblemTraits<Problem>::BoundaryTypes;
161public:
162 using type = std::conditional_t<
163 Dumux::Detail::hasProblemBoundaryTypesForFaceFunction<Problem, typename GG::LocalView>(),
166 >;
167};
168
170template<class TypeTag>
171struct EnableGridVolumeVariablesCache<TypeTag, TTag::PQ1FEModel> { static constexpr bool value = false; };
172
174template<class TypeTag>
175struct SolutionVector<TypeTag, TTag::PQ1FEModel> { using type = Dune::BlockVector<GetPropType<TypeTag, Properties::PrimaryVariables>>; };
176
178template<class TypeTag>
179struct JacobianMatrix<TypeTag, TTag::PQ1FEModel>
180{
181private:
184 using MatrixBlock = typename Dune::FieldMatrix<Scalar, numEq, numEq>;
185public:
187};
188
189} // namespace Dumux::Properties
190
191namespace Dumux::Detail {
192
193template<class Problem>
195{
196private:
198public:
199 using GridGeometry = GG;
200 // Determine BoundaryTypes dependent on the used problem interface, either boundaryTypes(element, scv) or boundaryTypes(element, boundaryFace)
201 using BoundaryTypes = Detail::BoundaryTypes<Problem, typename GG::LocalView>::type;
202};
203
204template<class TypeTag>
205concept PQ1Model = std::is_same_v<
208>;
209
210template<class T>
212
213template<PQ1Model TypeTag>
215{
216private:
218 static constexpr bool usesGeneralGridVariables =
219 Dumux::Concept::GridVariables<GV> && !Dumux::Concept::FVGridVariables<GV>;
220public:
221 using type = std::conditional_t<usesGeneralGridVariables,
222 Dumux::Experimental::CVFELocalResidual<TypeTag>,
224};
225
226template<class TypeTag>
228
229template<PQ1FEModel TypeTag>
232
233} // end namespace Dumux::Detail
234
235#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:85
This class stores an array of BoundaryTypes objects.
Definition cvfe/elementboundarytypes.hh:29
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
This class stores an array of BoundaryTypes objects. This class is not dependent on the used discreti...
Definition elementboundarytypes.hh:30
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:227
Definition pq1.hh:211
Definition pq1.hh:205
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.
Calculates the element-wise residual for control-volume finite element schemes.
Grid variables with the variables cache selected depending on the element discretization.
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.
Boundary types gathered on an element.
The element variables class.
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:59
typename CVFEGridVariables< TypeTag >::type CVFEGridVariables_t
The grid variables of a control-volume finite element type tag: Experimental::DefaultGridVariables if...
Definition defaultgridvariables.hh:137
GridVariables< GetPropType< TypeTag, Properties::GridGeometry >, DefaultGridVariablesCache< GetPropType< TypeTag, Properties::GridGeometry >, GetPropType< TypeTag, Properties::Problem >, Variables, getPropValue< TypeTag, Properties::EnableGridVolumeVariablesCache >() > > DefaultGridVariables
The grid variables of a model whose variables are defined per local degree of freedom.
Definition defaultgridvariables.hh:82
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:56
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:201
Definition common/typetraits/problem.hh:23
An empty flux variables cache.
Definition fluxvariablescaching.hh:35
typename Detail::template ProblemTraits< Problem, typename GridGeometry::DiscretizationMethod >::BoundaryTypes BoundaryTypes
Definition common/typetraits/problem.hh:52
std::conditional_t< Dumux::Detail::hasProblemBoundaryTypesForFaceFunction< Problem, typename GG::LocalView >(), Dumux::ElementIntersectionBoundaryTypes< BoundaryTypes >, Dumux::CVFEElementBoundaryTypes< BoundaryTypes > > type
Definition pq1.hh:162
std::conditional_t< Dumux::Detail::hasProblemBoundaryTypesForFaceFunction< Problem, typename GG::LocalView >(), Dumux::ElementIntersectionBoundaryTypes< BoundaryTypes >, Dumux::CVFEElementBoundaryTypes< BoundaryTypes > > type
Definition pq1.hh:129
CVFEFluxVariablesCache< Scalar, GridGeometry > type
Definition pq1.hh:115
CVFEGridFluxVariablesCache< Problem, FluxVariablesCache, enableCache > type
Definition pq1.hh:99
Dumux::Experimental::PQ1FEGridDiscretization< Scalar, GridView, enableCache > type
Definition pq1.hh:146
BoxFVGridGeometry< Scalar, GridView, enableCache > type
Definition pq1.hh:70
Dumux::Experimental::DefaultGridVariables< TypeTag > type
Definition pq1.hh:151
Dumux::Detail::CVFEGridVariables_t< TypeTag > type
Definition pq1.hh:105
CVFEGridVolumeVariables< Traits, enableCache > type
Definition pq1.hh:83
typename Dune::BCRSMatrix< MatrixBlock > type
Definition pq1.hh:186
Dune::BlockVector< GetPropType< TypeTag, Properties::PrimaryVariables > > type
Definition pq1.hh:175
std::tuple< GridProperties > InheritsFrom
Definition pq1.hh:58
std::tuple< FiniteVolumeModel > InheritsFrom
Definition pq1.hh:57