Line | Branch | Exec | Source |
---|---|---|---|
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 | // | ||
7 | /*! | ||
8 | * \file | ||
9 | * \ingroup FacetCoupling | ||
10 | * \brief Calculates the element-wise residual for cell-centered discretization schemes | ||
11 | * in models where coupling occurs across the element facets. This extra implementation | ||
12 | * is necessary as facets that lie on the boundary but couple to a facet element have to be | ||
13 | * treated differently. | ||
14 | */ | ||
15 | #ifndef DUMUX_FACETCOUPLING_CC_LOCAL_RESIDUAL_HH | ||
16 | #define DUMUX_FACETCOUPLING_CC_LOCAL_RESIDUAL_HH | ||
17 | |||
18 | #include <utility> | ||
19 | |||
20 | #include <dumux/common/properties.hh> | ||
21 | #include <dumux/common/numeqvector.hh> | ||
22 | #include <dumux/assembly/cclocalresidual.hh> | ||
23 | |||
24 | namespace Dumux { | ||
25 | |||
26 | /*! | ||
27 | * \ingroup FacetCoupling | ||
28 | * \brief Calculates the element-wise residual for cell-centered discretization schemes | ||
29 | * in models where coupling occurs across the element facets. We only overwrite the | ||
30 | * function for the computation of a flux across a single sub-control volume face, | ||
31 | * as we need to additionally check if a boundary face couples to a facet element. | ||
32 | */ | ||
33 | template<class TypeTag> | ||
34 | class CCFacetCouplingLocalResidual : public CCLocalResidual<TypeTag> | ||
35 | { | ||
36 | using ParentType = CCLocalResidual<TypeTag>; | ||
37 | |||
38 | using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; | ||
39 | using ElementVolumeVariables = typename GridVariables::GridVolumeVariables::LocalView; | ||
40 | using ElementFluxVariablesCache = typename GridVariables::GridFluxVariablesCache::LocalView; | ||
41 | |||
42 | using GridGeometry = typename GridVariables::GridGeometry; | ||
43 | using FVElementGeometry = typename GridGeometry::LocalView; | ||
44 | using SubControlVolumeFace = typename GridGeometry::SubControlVolumeFace; | ||
45 | using Element = typename GridGeometry::GridView::template Codim<0>::Entity; | ||
46 | |||
47 | using NumEqVector = Dumux::NumEqVector<GetPropType<TypeTag, Properties::PrimaryVariables>>; | ||
48 | |||
49 | public: | ||
50 | //! pull up the parent's constructor | ||
51 |
5/10✓ Branch 1 taken 9910 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 560056 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 100264 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1933781 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 200 times.
✗ Branch 14 not taken.
|
2604211 | using ParentType::ParentType; |
52 | //! export the type used for element residuals | ||
53 | using ElementResidualVector = typename ParentType::ElementResidualVector; | ||
54 | |||
55 | //! evaluate the flux residual for a sub control volume face and add to residual | ||
56 | template<class... Args> | ||
57 | 18657688 | void evalFlux(ElementResidualVector& residual, Args&&... args) const | |
58 | 18657688 | { ParentType::evalFlux(residual, std::forward<Args>(args)...); } | |
59 | |||
60 | //! evaluate the flux residual for a sub control volume face | ||
61 | template< class Problem > | ||
62 |
2/2✓ Branch 0 taken 980172 times.
✓ Branch 1 taken 30890764 times.
|
41477560 | NumEqVector evalFlux(const Problem& problem, |
63 | const Element& element, | ||
64 | const FVElementGeometry& fvGeometry, | ||
65 | const ElementVolumeVariables& elemVolVars, | ||
66 | const ElementFluxVariablesCache& elemFluxVarsCache, | ||
67 | const SubControlVolumeFace& scvf) const | ||
68 | { | ||
69 | // Even if scvf.boundary=true, compute flux on interior boundaries | ||
70 |
2/2✓ Branch 0 taken 980172 times.
✓ Branch 1 taken 30890764 times.
|
41477560 | if (problem.couplingManager().isOnInteriorBoundary(element, scvf)) |
71 | 1645524 | return this->asImp().computeFlux(problem, element, fvGeometry, elemVolVars, scvf, elemFluxVarsCache); | |
72 | else | ||
73 | 39832036 | return ParentType::evalFlux(problem, element, fvGeometry, elemVolVars, elemFluxVarsCache, scvf); | |
74 | } | ||
75 | }; | ||
76 | |||
77 | } // end namespace Dumux | ||
78 | |||
79 | #endif | ||
80 |