GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/multidomain/facet/cellcentered/localresidual.hh
Date: 2024-05-04 19:09:25
Exec Total Coverage
Lines: 6 7 85.7%
Functions: 14 34 41.2%
Branches: 16 26 61.5%

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-FileCopyrightInfo: 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
10/20
✓ Branch 1 taken 8314 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8314 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 477064 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 477064 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 100264 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 100264 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 1933781 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 1933781 times.
✗ Branch 23 not taken.
✓ Branch 25 taken 200 times.
✗ Branch 26 not taken.
✓ Branch 28 taken 200 times.
✗ Branch 29 not taken.
5039246 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 void evalFlux(ElementResidualVector& residual, Args&&... args) const
58 16689176 { ParentType::evalFlux(residual, std::forward<Args>(args)...); }
59
60 //! evaluate the flux residual for a sub control volume face
61 template< class Problem >
62 35009592 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
6/6
✓ Branch 0 taken 761004 times.
✓ Branch 1 taken 24641964 times.
✓ Branch 2 taken 761004 times.
✓ Branch 3 taken 24641964 times.
✓ Branch 4 taken 761004 times.
✓ Branch 5 taken 24641964 times.
105028776 if (problem.couplingManager().isOnInteriorBoundary(element, scvf))
71 1426356 return this->asImp().computeFlux(problem, element, fvGeometry, elemVolVars, scvf, elemFluxVarsCache);
72 else
73 33583236 return ParentType::evalFlux(problem, element, fvGeometry, elemVolVars, elemFluxVarsCache, scvf);
74 }
75 };
76
77 } // end namespace Dumux
78
79 #endif
80