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
24#include <dumux/common/concepts/variables_.hh>
26#include <dumux/common/typetraits/boundary_.hh>
27
29#include <dumux/assembly/cvfelocalresidual_.hh>
30
35
43
45
46namespace Dumux::Properties {
47
49// Create new type tags
50namespace TTag {
51struct PQ2HybridModel { using InheritsFrom = std::tuple<FiniteVolumeModel>; };
52} // end namespace TTag
53
55template<class TypeTag>
56struct GridGeometry<TypeTag, TTag::PQ2HybridModel>
57{
58private:
59 static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridGeometryCache>();
62public:
64};
65
67template<class TypeTag>
68struct GridVolumeVariables<TypeTag, TTag::PQ2HybridModel>
69{
70private:
71 static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridVolumeVariablesCache>();
75public:
77};
78
80template<class TypeTag>
81struct FluxVariablesCache<TypeTag, TTag::PQ2HybridModel>
82{
83private:
86public:
88};
89
91template<class TypeTag>
92struct GridFluxVariablesCache<TypeTag, TTag::PQ2HybridModel>
93{
94private:
95 static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridFluxVariablesCache>();
97
99 using FluxVariablesCache = GetPropTypeOr<TypeTag,
100 Properties::FluxVariablesCache, FluxVariablesCaching::EmptyCache<Scalar>
101 >;
102public:
104};
105
107template<class TypeTag>
108struct ElementBoundaryTypes<TypeTag, TTag::PQ2HybridModel>
109{
110private:
112 using GG = std::decay_t<decltype(std::declval<Problem>().gridGeometry())>;
113 using BoundaryTypes = typename ProblemTraits<Problem>::BoundaryTypes;
114public:
115 // Check if problem has new boundaryTypes interface
116 // then use ElementIntersectionBoundaryTypes
117 using type = std::conditional_t<
118 Dumux::Detail::hasProblemBoundaryTypesForIntersectionFunction<Problem, typename GG::LocalView, typename GG::GridView::Intersection>(),
121 >;
122};
123
124} // namespace Dumux::Properties
125
126namespace Dumux::Detail {
127
128template<class Problem>
129struct ProblemTraits<Problem, DiscretizationMethods::PQ2>
130{
131private:
132 using GG = std::decay_t<decltype(std::declval<Problem>().gridGeometry())>;
133public:
134 using GridGeometry = GG;
135 // Determine BoundaryTypes dependent on the used problem interface, either boundaryTypes(element, scv) or boundaryTypes(element, intersection)
136 using BoundaryTypes = Detail::BoundaryTypes<Problem, typename GG::LocalView, typename GG::GridView::Intersection>::type;
137};
138
139template<class TypeTag>
140concept PQ2HybridModel = std::is_same_v<
141 typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod,
143>;
144
145template<PQ2HybridModel TypeTag>
147{
148private:
149 using GV = GetPropType<TypeTag, Properties::GridVariables>;
150 static constexpr bool usesGeneralGridVariables =
151 Dumux::Concept::GridVariables<GV> && !Dumux::Concept::FVGridVariables<GV>;
152public:
153 using type = std::conditional_t<usesGeneralGridVariables,
154 Dumux::Experimental::CVFELocalResidual<TypeTag>,
156};
157
158} // end namespace Dumux::Detail
159
160#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:140
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
std::conditional_t< usesGeneralGridVariables, Dumux::Experimental::CVFELocalResidual< TypeTag >, Dumux::CVFELocalResidual< TypeTag > > type
Definition: box.hh:154
Detail::BoundaryTypes< Problem, typename GG::LocalView, typename GG::GridView::Intersection >::type BoundaryTypes
Definition: pq2.hh:136
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:121
std::tuple< FiniteVolumeModel > InheritsFrom
Definition: pq2.hh:51