version 3.11-dev
box.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_BOX_HH
14#define DUMUX_DISCRETIZTAION_BOX_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
40
42
43namespace Dumux::Properties {
44
46// Create new type tags
47namespace TTag {
48struct BoxModel { using InheritsFrom = std::tuple<FiniteVolumeModel>; };
49} // end namespace TTag
50
52template<class TypeTag>
53struct GridGeometry<TypeTag, TTag::BoxModel>
54{
55private:
56 static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridGeometryCache>();
59public:
61};
62
64template<class TypeTag>
65struct GridVolumeVariables<TypeTag, TTag::BoxModel>
66{
67private:
68 static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridVolumeVariablesCache>();
72public:
74};
75
77template<class TypeTag>
78struct GridFluxVariablesCache<TypeTag, TTag::BoxModel>
79{
80private:
81 static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridFluxVariablesCache>();
83
85 using FluxVariablesCache = GetPropTypeOr<TypeTag,
86 Properties::FluxVariablesCache, FluxVariablesCaching::EmptyCache<Scalar>
87 >;
88public:
90};
91
93template<class TypeTag>
94struct FluxVariablesCache<TypeTag, TTag::BoxModel>
95{
96private:
99public:
101};
102
104template<class TypeTag>
105struct ElementBoundaryTypes<TypeTag, TTag::BoxModel>
106{
107private:
109 using GG = std::decay_t<decltype(std::declval<Problem>().gridGeometry())>;
110 using BoundaryTypes = typename ProblemTraits<Problem>::BoundaryTypes;
111public:
112 // Check if problem has new boundaryTypes interface
113 // then use ElementIntersectionBoundaryTypes
114 using type = std::conditional_t<
115 Dumux::Detail::hasProblemBoundaryTypesForIntersectionFunction<Problem, typename GG::LocalView, typename GG::GridView::Intersection>(),
118 >;
119};
120
121} // namespace Dumux::Properties
122
123namespace Dumux::Detail {
124
125template<class Problem>
126struct ProblemTraits<Problem, DiscretizationMethods::Box>
127{
128private:
129 using GG = std::decay_t<decltype(std::declval<Problem>().gridGeometry())>;
130public:
131 using GridGeometry = GG;
132 // Determine BoundaryTypes dependent on the used problem interface, either boundaryTypes(element, scv) or boundaryTypes(element, intersection)
133 using BoundaryTypes = Detail::BoundaryTypes<Problem, typename GG::LocalView, typename GG::GridView::Intersection>::type;
134};
135
136template<class TypeTag>
137concept BoxModel = std::is_same_v<
138 typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod,
140>;
141
142template<BoxModel TypeTag>
144{
146};
147
148} // end namespace Dumux:Detail
149
150#endif
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:74
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:30
Flux variable caches on a gridview.
Definition: discretization/cvfe/gridfluxvariablescache.hh:46
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:63
This class stores an array of BoundaryTypes objects. This class is not dependent on the used discreti...
Definition: elementboundarytypes.hh:30
Defines all properties used in Dumux.
Type traits for problem classes.
Definition: box.hh:137
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.
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.
Classes related to flux variables caching.
Declares properties required for finite-volume models models.
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:28
CVFE< CVFEMethods::PQ1 > Box
Definition: method.hh:94
The energy balance equation for a porous solid.
Definition: common/properties.hh:26
Definition: cvfe/gridvolumevariables.hh:31
Definition: defaultlocaloperator.hh:19
Detail::BoundaryTypes< Problem, typename GG::LocalView, typename GG::GridView::Intersection >::type BoundaryTypes
Definition: box.hh:133
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: box.hh:118
std::tuple< FiniteVolumeModel > InheritsFrom
Definition: box.hh:48