GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/multidomain/assemblerview.hh
Date: 2024-09-21 20:52:54
Exec Total Coverage
Lines: 9 9 100.0%
Functions: 0 1508 0.0%
Branches: 169 250 67.6%

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 MultiDomain
10 * \ingroup Assembly
11 * \brief Subdomain-specific views on multidomain assemblers.
12 */
13 #ifndef DUMUX_MULTIDOMAIN_ASSEMBLER_VIEW_HH
14 #define DUMUX_MULTIDOMAIN_ASSEMBLER_VIEW_HH
15
16 #include <dune/common/hybridutilities.hh>
17 #include <dune/common/std/type_traits.hh>
18
19 namespace Dumux {
20
21 /*!
22 * \ingroup MultiDomain
23 * \ingroup Assembly
24 * \brief Subdomain-specific view on a multidomain assembler.
25 * Allows retrieval of sub-domain specific objects w/o passing a domain id.
26 * \todo This is not necessarily fv-specifiv (could be in other header).
27 * \todo Can we get rid of some of the interfaces?
28 */
29 template<typename MDAssembler, std::size_t domainId>
30 class MultiDomainAssemblerSubDomainView
31 {
32 static constexpr Dune::index_constant<domainId> myId{};
33
34 template<class A>
35 using HasStaticIsImplicitCheck = decltype(A::isImplicit());
36
37 template<class A>
38 static constexpr bool hasStaticIsImplicit = Dune::Std::is_detected<HasStaticIsImplicitCheck, A>::value;
39
40 public:
41 using CouplingManager = typename MDAssembler::CouplingManager;
42 using SolutionVector = typename MDAssembler::SolutionVector;
43
44 28128736 MultiDomainAssemblerSubDomainView(MDAssembler& assembler, Dune::index_constant<domainId>)
45
1/2
✓ Branch 1 taken 40 times.
✗ Branch 2 not taken.
28128736 : assembler_{assembler}
46 {}
47
48 template<std::size_t i>
49
12/24
✓ Branch 1 taken 6090609 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 6090609 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 15471851 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 15471851 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1521688 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 1521688 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 108328 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 108328 times.
✗ Branch 23 not taken.
✓ Branch 25 taken 163489 times.
✗ Branch 26 not taken.
✓ Branch 28 taken 163489 times.
✗ Branch 29 not taken.
✓ Branch 31 taken 2892000 times.
✗ Branch 32 not taken.
✓ Branch 34 taken 2892000 times.
✗ Branch 35 not taken.
55839480 auto localResidual(Dune::index_constant<i> id) const { return assembler_.localResidual(id); }
50 auto localResidual() const { return assembler_.localResidual(myId); }
51
52 template<std::size_t i>
53
90/107
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✓ Branch 2 taken 531079 times.
✓ Branch 3 taken 3270385 times.
✓ Branch 4 taken 545920 times.
✓ Branch 5 taken 23202327 times.
✓ Branch 6 taken 14900 times.
✓ Branch 7 taken 21496419 times.
✓ Branch 8 taken 88123 times.
✓ Branch 9 taken 32665966 times.
✓ Branch 10 taken 88612 times.
✓ Branch 11 taken 36071520 times.
✓ Branch 12 taken 2820569 times.
✓ Branch 13 taken 5167136 times.
✓ Branch 14 taken 2820077 times.
✓ Branch 15 taken 3081349 times.
✓ Branch 16 taken 107 times.
✓ Branch 17 taken 11292385 times.
✓ Branch 18 taken 145223 times.
✓ Branch 19 taken 7754064 times.
✓ Branch 20 taken 8549325 times.
✓ Branch 21 taken 7752486 times.
✓ Branch 22 taken 87 times.
✓ Branch 23 taken 4316480 times.
✓ Branch 24 taken 50 times.
✓ Branch 25 taken 23911980 times.
✓ Branch 26 taken 75 times.
✓ Branch 27 taken 1830214 times.
✓ Branch 28 taken 19598023 times.
✓ Branch 29 taken 1506731 times.
✓ Branch 30 taken 325726 times.
✓ Branch 31 taken 10130145 times.
✓ Branch 32 taken 132 times.
✓ Branch 33 taken 10453733 times.
✓ Branch 34 taken 35 times.
✓ Branch 35 taken 1559264 times.
✓ Branch 36 taken 325750 times.
✓ Branch 37 taken 1026236 times.
✓ Branch 38 taken 616938 times.
✓ Branch 39 taken 2568683 times.
✓ Branch 40 taken 293 times.
✓ Branch 41 taken 3665504 times.
✓ Branch 42 taken 264 times.
✓ Branch 43 taken 563884 times.
✓ Branch 44 taken 1322278 times.
✓ Branch 45 taken 2188185 times.
✓ Branch 46 taken 705494 times.
✓ Branch 47 taken 4165506 times.
✓ Branch 48 taken 2792439 times.
✓ Branch 49 taken 1658733 times.
✓ Branch 50 taken 3118113 times.
✓ Branch 51 taken 74 times.
✓ Branch 52 taken 7103 times.
✓ Branch 53 taken 3834829 times.
✓ Branch 54 taken 18 times.
✓ Branch 55 taken 27271 times.
✓ Branch 56 taken 3834773 times.
✓ Branch 57 taken 3 times.
✓ Branch 58 taken 732288 times.
✓ Branch 59 taken 3509055 times.
✓ Branch 60 taken 705020 times.
✓ Branch 61 taken 2892223 times.
✓ Branch 62 taken 616848 times.
✓ Branch 63 taken 412928 times.
✓ Branch 64 taken 16 times.
✓ Branch 65 taken 11 times.
✓ Branch 66 taken 412928 times.
✓ Branch 67 taken 13 times.
✓ Branch 68 taken 12 times.
✓ Branch 69 taken 413088 times.
✓ Branch 70 taken 14 times.
✓ Branch 71 taken 161 times.
✓ Branch 72 taken 412929 times.
✓ Branch 73 taken 1 times.
✓ Branch 74 taken 4 times.
✓ Branch 75 taken 269568 times.
✓ Branch 76 taken 3 times.
✓ Branch 77 taken 269570 times.
✓ Branch 78 taken 2 times.
✓ Branch 79 taken 1 times.
✓ Branch 80 taken 4 times.
✗ Branch 81 not taken.
✓ Branch 82 taken 1 times.
✓ Branch 83 taken 412915 times.
✗ Branch 84 not taken.
✓ Branch 85 taken 1 times.
✓ Branch 86 taken 412915 times.
✗ Branch 87 not taken.
✓ Branch 88 taken 1 times.
✓ Branch 89 taken 412914 times.
✗ Branch 90 not taken.
✓ Branch 92 taken 412914 times.
✗ Branch 93 not taken.
✓ Branch 99 taken 1 times.
✗ Branch 100 not taken.
✓ Branch 102 taken 1 times.
✗ Branch 103 not taken.
✗ Branch 104 not taken.
✓ Branch 105 taken 1 times.
✗ Branch 106 not taken.
✗ Branch 107 not taken.
✓ Branch 108 taken 1 times.
✗ Branch 109 not taken.
✗ Branch 121 not taken.
✗ Branch 122 not taken.
✗ Branch 124 not taken.
✗ Branch 125 not taken.
1238887858 const auto& problem(Dune::index_constant<i> id) const { return assembler_.problem(id); }
54 const auto& problem() const { return assembler_.problem(myId); }
55
56 template<std::size_t i>
57
8/16
✓ Branch 1 taken 6090021 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 6090021 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 16154783 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 16154783 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 947601 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 947601 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 2892000 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 2892000 times.
✗ Branch 23 not taken.
55512360 const auto& gridGeometry(Dune::index_constant<i> id) const { return assembler_.gridGeometry(id); }
58 const auto& gridGeometry() const { return assembler_.gridGeometry(myId); }
59
60 template<std::size_t i>
61
32/64
✓ Branch 1 taken 6090273 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 6090273 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 6090273 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 6090273 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 6090021 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 6090021 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 15685529 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 15685529 times.
✗ Branch 23 not taken.
✓ Branch 25 taken 15685529 times.
✗ Branch 26 not taken.
✓ Branch 28 taken 15685529 times.
✗ Branch 29 not taken.
✓ Branch 31 taken 16149795 times.
✗ Branch 32 not taken.
✓ Branch 34 taken 16149795 times.
✗ Branch 35 not taken.
✓ Branch 37 taken 1319184 times.
✗ Branch 38 not taken.
✓ Branch 40 taken 1319184 times.
✗ Branch 41 not taken.
✓ Branch 43 taken 1319136 times.
✗ Branch 44 not taken.
✓ Branch 46 taken 1319136 times.
✗ Branch 47 not taken.
✓ Branch 49 taken 942084 times.
✗ Branch 50 not taken.
✓ Branch 52 taken 942084 times.
✗ Branch 53 not taken.
✓ Branch 55 taken 1064264 times.
✗ Branch 56 not taken.
✓ Branch 58 taken 1064264 times.
✗ Branch 59 not taken.
✓ Branch 61 taken 1069781 times.
✗ Branch 62 not taken.
✓ Branch 64 taken 1069781 times.
✗ Branch 65 not taken.
✓ Branch 67 taken 1069781 times.
✗ Branch 68 not taken.
✓ Branch 70 taken 1069781 times.
✗ Branch 71 not taken.
✓ Branch 73 taken 105781 times.
✗ Branch 74 not taken.
✓ Branch 76 taken 105781 times.
✗ Branch 77 not taken.
✓ Branch 79 taken 1928000 times.
✗ Branch 80 not taken.
✓ Branch 82 taken 1928000 times.
✗ Branch 83 not taken.
✓ Branch 85 taken 1928000 times.
✗ Branch 86 not taken.
✓ Branch 88 taken 1928000 times.
✗ Branch 89 not taken.
✓ Branch 91 taken 1928000 times.
✗ Branch 92 not taken.
✓ Branch 94 taken 1928000 times.
✗ Branch 95 not taken.
178026000 const auto& gridVariables(Dune::index_constant<i> id) const { return assembler_.gridVariables(id); }
62 const auto& gridVariables() const { return assembler_.gridVariables(myId); }
63
64
6/9
✓ Branch 1 taken 52000 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 212000 times.
✓ Branch 5 taken 100000 times.
✓ Branch 6 taken 100000 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 617000 times.
✓ Branch 9 taken 100000 times.
✗ Branch 10 not taken.
5745082 const auto& prevSol() const { return assembler_.prevSol(); }
65
16/20
✓ Branch 0 taken 57475047 times.
✓ Branch 1 taken 16897199 times.
✓ Branch 2 taken 187783203 times.
✓ Branch 3 taken 52777876 times.
✓ Branch 4 taken 11888880 times.
✓ Branch 5 taken 7911458 times.
✓ Branch 6 taken 1954722 times.
✓ Branch 7 taken 5762125 times.
✓ Branch 8 taken 177500 times.
✓ Branch 9 taken 383298 times.
✓ Branch 10 taken 2919500 times.
✓ Branch 11 taken 388248 times.
✗ Branch 12 not taken.
✓ Branch 13 taken 150000 times.
✗ Branch 14 not taken.
✓ Branch 15 taken 2892000 times.
✗ Branch 16 not taken.
✓ Branch 17 taken 100000 times.
✗ Branch 18 not taken.
✓ Branch 19 taken 1928000 times.
354046986 bool isStationaryProblem() const { return assembler_.isStationaryProblem(); }
66
67 template<class A = MDAssembler, typename std::enable_if_t<hasStaticIsImplicit<A>, int> = 0>
68 static constexpr bool isImplicit() { return MDAssembler::isImplicit(); }
69
70 template<class A = MDAssembler, typename std::enable_if_t<!hasStaticIsImplicit<A>, int> = 0>
71
4/8
✓ Branch 2 taken 165888 times.
✗ Branch 3 not taken.
✓ Branch 6 taken 13824 times.
✗ Branch 7 not taken.
✗ Branch 10 not taken.
✓ Branch 11 taken 3456 times.
✗ Branch 14 not taken.
✓ Branch 15 taken 3456 times.
203008 bool isImplicit() const { return assembler_.isImplicit(); }
72
73 private:
74 MDAssembler& assembler_;
75 };
76
77 } // end namespace Dumux
78
79 #endif
80