version 3.11-dev
pq2.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//
13#ifndef DUMUX_DISCRETIZTAION_PQ2_HH
14#define DUMUX_DISCRETIZTAION_PQ2_HH
15
16#include <concepts>
17#include <type_traits>
18
19#include <dune/common/fvector.hh>
20#include <dune/geometry/multilineargeometry.hh>
21
25#include <dumux/common/typetraits/boundary_.hh>
26
28
33
41
43
44namespace Dumux::Properties {
45
47// Create new type tags
48namespace TTag {
49struct PQ2HybridModel { using InheritsFrom = std::tuple<FiniteVolumeModel>; };
50} // end namespace TTag
51
53template<class TypeTag>
54struct GridGeometry<TypeTag, TTag::PQ2HybridModel>
55{
56private:
57 static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridGeometryCache>();
60public:
62};
63
65template<class TypeTag>
66struct GridVolumeVariables<TypeTag, TTag::PQ2HybridModel>
67{
68private:
69 static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridVolumeVariablesCache>();
73public:
75};
76
78template<class TypeTag>
79struct FluxVariablesCache<TypeTag, TTag::PQ2HybridModel>
80{
81private:
84public:
86};
87
89template<class TypeTag>
90struct GridFluxVariablesCache<TypeTag, TTag::PQ2HybridModel>
91{
92private:
93 static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridFluxVariablesCache>();
95
97 using FluxVariablesCache = GetPropTypeOr<TypeTag,
98 Properties::FluxVariablesCache, FluxVariablesCaching::EmptyCache<Scalar>
99 >;
100public:
102};
103
105template<class TypeTag>
106struct ElementBoundaryTypes<TypeTag, TTag::PQ2HybridModel>
107{
108private:
110 using GG = std::decay_t<decltype(std::declval<Problem>().gridGeometry())>;
111 using BoundaryTypes = typename ProblemTraits<Problem>::BoundaryTypes;
112public:
113 // Check if problem has new boundaryTypes interface
114 // then use ElementIntersectionBoundaryTypes
115 using type = std::conditional_t<
116 Dumux::Detail::hasProblemBoundaryTypesForIntersectionFunction<Problem, typename GG::LocalView, typename GG::GridView::Intersection>(),
119 >;
120};
121
122} // namespace Dumux::Properties
123
124namespace Dumux::Detail {
125
126template<class Problem>
127struct ProblemTraits<Problem, DiscretizationMethods::PQ2>
128{
129private:
130 using GG = std::decay_t<decltype(std::declval<Problem>().gridGeometry())>;
131public:
132 using GridGeometry = GG;
133 // Determine BoundaryTypes dependent on the used problem interface, either boundaryTypes(element, scv) or boundaryTypes(element, intersection)
134 using BoundaryTypes = Detail::BoundaryTypes<Problem, typename GG::LocalView, typename GG::GridView::Intersection>::type;
135};
136
137template<class TypeTag>
138concept PQ2HybridModel = std::is_same_v<
139 typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod,
141>;
142
143template<PQ2HybridModel TypeTag>
145{
147};
148
149} // end namespace Dumux::Detail
150
151#endif
Boundary flag to store e.g. in sub control volume faces.
This class stores an array of BoundaryTypes objects.
Definition: cvfe/elementboundarytypes.hh:28
The element-wise residual for control-volume finite element schemes.
Definition: cvfelocalresidual.hh:77
Base class for the grid local variables.
Definition: gridvariablescache.hh:44
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
Flux variables cache class for control-volume finite element schemes. For control-volume finite eleme...
Definition: discretization/cvfe/hybrid/fluxvariablescache.hh:32
Flux variable caches implementation on a gridview.
Definition: discretization/cvfe/hybrid/gridfluxvariablescache.hh:51
Base class for the finite volume geometry vector for pq2 schemes This builds up the sub control volum...
Definition: discretization/pq2/fvgridgeometry.hh:135
Defines all properties used in Dumux.
Type traits for problem classes.
Definition: pq2.hh:138
Boundary types gathered on an element.
The local element solution class for control-volume finite element methods.
Calculates the element-wise residual for control-volume finite element schemes.
The default local operator than can be specialized for each discretization scheme.
Flux variables cache class for control-volume finite element schemes.
Global flux variable cache.
Base class for the finite volume geometry vector for the pq2 method This builds up the sub control vo...
Boundary types gathered on an element.
Classes related to flux variables caching.
Declares properties required for finite-volume models models.
The grid local variables class for control-volume finite element methods.
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
The available discretization methods in Dumux.
Definition: cvfelocalresidual.hh:30
CVFE< CVFEMethods::PQ2 > PQ2
Definition: method.hh:118
The energy balance equation for a porous solid.
Definition: common/properties.hh:26
typename Detail::DiscretizationDefaultLocalOperator< TypeTag >::type DiscretizationDefaultLocalOperator
Definition: defaultlocaloperator.hh:27
Detail::BoundaryTypes< Problem, typename GG::LocalView, typename GG::GridView::Intersection >::type BoundaryTypes
Definition: pq2.hh:134
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:34
std::conditional_t< Dumux::Detail::hasProblemBoundaryTypesForIntersectionFunction< Problem, typename GG::LocalView, typename GG::GridView::Intersection >(), Dumux::ElementIntersectionBoundaryTypes< BoundaryTypes >, Dumux::CVFEElementBoundaryTypes< BoundaryTypes > > type
Definition: pq2.hh:119
std::tuple< FiniteVolumeModel > InheritsFrom
Definition: pq2.hh:49