version 3.11-dev
fcdiamond.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//
14#ifndef DUMUX_DISCRETIZATION_FACECENTERED_DIAMOND_HH
15#define DUMUX_DISCRETIZATION_FACECENTERED_DIAMOND_HH
16
17#include <concepts>
18#include <type_traits>
19
21#include <dumux/common/concepts/variables_.hh>
23
25#include <dumux/assembly/cvfelocalresidual_.hh>
32
40
41namespace Dumux::Properties {
42
44// Create new type tags
45namespace TTag {
46struct FaceCenteredDiamondModel { using InheritsFrom = std::tuple<FiniteVolumeModel>; };
47} // end namespace TTag
48
50template<class TypeTag>
51struct GridGeometry<TypeTag, TTag::FaceCenteredDiamondModel>
52{
53private:
54 static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridGeometryCache>();
56public:
58};
59
61template<class TypeTag>
62struct GridVolumeVariables<TypeTag, TTag::FaceCenteredDiamondModel>
63{
64private:
65 static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridVolumeVariablesCache>();
69public:
71};
72
74template<class TypeTag>
75struct GridFluxVariablesCache<TypeTag, TTag::FaceCenteredDiamondModel>
76{
77private:
78 static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridFluxVariablesCache>();
80
82 using FluxVariablesCache = GetPropTypeOr<TypeTag,
83 Properties::FluxVariablesCache, FluxVariablesCaching::EmptyCache<Scalar>
84 >;
85public:
87};
88
90template<class TypeTag>
91struct GridVariables<TypeTag, TTag::FaceCenteredDiamondModel>
92{
93private:
97public:
99};
100
102template<class TypeTag>
103struct FluxVariablesCache<TypeTag, TTag::FaceCenteredDiamondModel>
104{
105private:
108public:
110};
111
113template<class TypeTag>
114struct ElementBoundaryTypes<TypeTag, TTag::FaceCenteredDiamondModel>
115{
116private:
118 using GG = std::decay_t<decltype(std::declval<Problem>().gridGeometry())>;
119 using BoundaryTypes = typename ProblemTraits<Problem>::BoundaryTypes;
120public:
121 // Check if problem has new boundaryTypes interface
122 // then use ElementIntersectionBoundaryTypes
123 using type = std::conditional_t<
124 Dumux::Detail::hasProblemBoundaryTypesForFaceFunction<Problem, typename GG::LocalView>(),
127 >;
128};
129
130} // namespace Dumux::Properties
131
132namespace Dumux::Detail {
133
134template<class Problem>
135struct ProblemTraits<Problem, DiscretizationMethods::FCDiamond>
136{
137private:
138 using GG = std::decay_t<decltype(std::declval<Problem>().gridGeometry())>;
139public:
140 using GridGeometry = GG;
141 // Determine BoundaryTypes dependent on the used problem interface, either boundaryTypes(element, scv) or boundaryTypes(element, boundaryFace)
142 using BoundaryTypes = Detail::BoundaryTypes<Problem, typename GG::LocalView>::type;
143};
144
145template<class TypeTag>
146concept FaceCenteredDiamondModel = std::is_same_v<
147 typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod,
149>;
150
151template<FaceCenteredDiamondModel TypeTag>
153{
154private:
155 using GV = GetPropType<TypeTag, Properties::GridVariables>;
156 static constexpr bool usesGeneralGridVariables =
157 Dumux::Concept::GridVariables<GV> && !Dumux::Concept::FVGridVariables<GV>;
158public:
159 using type = std::conditional_t<usesGeneralGridVariables,
160 Dumux::Experimental::CVFELocalResidual<TypeTag>,
162};
163
164} // end namespace Dumux::Detail
165
166#endif
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
Flux variable caches implementation on a gridview.
Definition: discretization/cvfe/gridfluxvariablescache.hh:48
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
The grid variable class for finite volume schemes storing variables on scv and scvf (volume and flux ...
Definition: discretization/fvgridvariables.hh:30
Grid geometry for the diamond discretization.
Definition: discretization/facecentered/diamond/fvgridgeometry.hh:84
Defines all properties used in Dumux.
Type traits for problem classes.
Definition: fcdiamond.hh:146
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.
The grid variable class for finite volume schemes, storing variables on scv and scvf (volume and flux...
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::CR_RT > FCDiamond
Definition: method.hh:105
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 >::type BoundaryTypes
Definition: fcdiamond.hh:142
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::hasProblemBoundaryTypesForFaceFunction< Problem, typename GG::LocalView >(), Dumux::ElementIntersectionBoundaryTypes< BoundaryTypes >, Dumux::CVFEElementBoundaryTypes< BoundaryTypes > > type
Definition: fcdiamond.hh:127
std::tuple< FiniteVolumeModel > InheritsFrom
Definition: fcdiamond.hh:46