version 3.11-dev
Loading...
Searching...
No Matches
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//
12
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
24#include <dumux/common/concepts/variables_.hh>
26#include <dumux/common/typetraits/boundary_.hh>
27
29#include <dumux/assembly/cvfelocalresidual_.hh>
30
35
42
44
45namespace Dumux::Properties {
46
48// Create new type tags
49namespace TTag {
50struct BoxModel { using InheritsFrom = std::tuple<FiniteVolumeModel>; };
51} // end namespace TTag
52
54template<class TypeTag>
55struct GridGeometry<TypeTag, TTag::BoxModel>
56{
57private:
58 static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridGeometryCache>();
61public:
63};
64
66template<class TypeTag>
67struct GridVolumeVariables<TypeTag, TTag::BoxModel>
68{
69private:
74public:
76};
77
79template<class TypeTag>
80struct GridFluxVariablesCache<TypeTag, TTag::BoxModel>
81{
82private:
83 static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridFluxVariablesCache>();
85
87 using FluxVariablesCache = GetPropTypeOr<TypeTag,
88 Properties::FluxVariablesCache, FluxVariablesCaching::EmptyCache<Scalar>
89 >;
90public:
92};
93
95template<class TypeTag>
96struct FluxVariablesCache<TypeTag, TTag::BoxModel>
97{
98private:
101public:
103};
104
106template<class TypeTag>
107struct ElementBoundaryTypes<TypeTag, TTag::BoxModel>
108{
109private:
112 using BoundaryTypes = typename ProblemTraits<Problem>::BoundaryTypes;
113public:
114 // Check if problem has new boundaryTypes interface
115 // then use ElementIntersectionBoundaryTypes
116 using type = std::conditional_t<
117 Dumux::Detail::hasProblemBoundaryTypesForFaceFunction<Problem, typename GG::LocalView>(),
120 >;
121};
122
123} // namespace Dumux::Properties
124
125namespace Dumux::Detail {
126
127template<class Problem>
129{
130private:
132public:
133 using GridGeometry = GG;
134 // Determine BoundaryTypes dependent on the used problem interface, either boundaryTypes(element, scv) or boundaryTypes(element, boundaryFace)
135 using BoundaryTypes = Detail::BoundaryTypes<Problem, typename GG::LocalView>::type;
136};
137
138template<class TypeTag>
139concept BoxModel = std::is_same_v<
142>;
143
144template<BoxModel TypeTag>
146{
147private:
149 static constexpr bool usesGeneralGridVariables =
150 Dumux::Concept::GridVariables<GV> && !Dumux::Concept::FVGridVariables<GV>;
151public:
152 using type = std::conditional_t<usesGeneralGridVariables,
153 Dumux::Experimental::CVFELocalResidual<TypeTag>,
155};
156
157} // end namespace Dumux:Detail
158
159#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:83
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
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:139
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.
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
The available discretization methods in Dumux.
Definition boxgeometryhelper.hh:51
Definition cvfelocalresidual.hh:25
typename ProblemGridGeometryHelper< Problem >::type ProblemGridGeometry
Definition common/typetraits/problem.hh:40
Definition method.hh:20
CVFE< CVFEMethods::PQ1 > Box
Definition method.hh:102
Type tag for numeric models.
Definition grid.hh:24
The energy balance equation for a porous solid.
Definition common/properties.hh:26
Definition cvfe/gridvolumevariables.hh:31
std::conditional_t< usesGeneralGridVariables, Dumux::Experimental::CVFELocalResidual< TypeTag >, Dumux::CVFELocalResidual< TypeTag > > type
Definition box.hh:152
Definition defaultlocaloperator.hh:19
Detail::BoundaryTypes< Problem, typename GG::LocalView >::type BoundaryTypes
Definition box.hh:135
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:51
std::conditional_t< Dumux::Detail::hasProblemBoundaryTypesForFaceFunction< Problem, typename GG::LocalView >(), Dumux::ElementIntersectionBoundaryTypes< BoundaryTypes >, Dumux::CVFEElementBoundaryTypes< BoundaryTypes > > type
Definition box.hh:116
CVFEFluxVariablesCache< Scalar, GridGeometry > type
Definition box.hh:102
CVFEGridFluxVariablesCache< Problem, FluxVariablesCache, enableCache > type
Definition box.hh:91
BoxFVGridGeometry< Scalar, GridView, enableCache > type
Definition box.hh:62
CVFEGridVolumeVariables< Traits, enableCache > type
Definition box.hh:75
std::tuple< FiniteVolumeModel > InheritsFrom
Definition box.hh:50