GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/linear/solvercategory.hh
Date: 2024-05-04 19:09:25
Exec Total Coverage
Lines: 6 6 100.0%
Functions: 41 41 100.0%
Branches: 10 13 76.9%

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 Linear
10 * \brief Solver category
11 */
12 #ifndef DUMUX_LINEAR_SOLVERCATEGORY_HH
13 #define DUMUX_LINEAR_SOLVERCATEGORY_HH
14
15 #include <dune/istl/solvers.hh>
16
17 namespace Dumux::Detail {
18
19 template<class LinearSolverTraits, class GridView>
20 258 Dune::SolverCategory::Category solverCategory(const GridView& gridView)
21 {
22 if constexpr (LinearSolverTraits::canCommunicate)
23 {
24
6/6
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 256 times.
✓ Branch 2 taken 51 times.
✓ Branch 3 taken 226 times.
✓ Branch 4 taken 51 times.
✓ Branch 5 taken 206 times.
287 if (gridView.comm().size() <= 1)
25 return Dune::SolverCategory::sequential;
26
27
2/3
✗ Branch 0 not taken.
✓ Branch 1 taken 22 times.
✓ Branch 2 taken 4 times.
52 if (LinearSolverTraits::isNonOverlapping(gridView))
28 2 return Dune::SolverCategory::nonoverlapping;
29 else
30 24 return Dune::SolverCategory::overlapping;
31 }
32 else
33 {
34
2/4
✗ Branch 0 not taken.
✓ Branch 1 taken 23 times.
✓ Branch 3 taken 23 times.
✗ Branch 4 not taken.
23 if (gridView.comm().size() > 1)
35 DUNE_THROW(Dune::InvalidStateException,
36 "Attempt to construct parallel solver but LinearSolverTraits::canCommunicate is false. " <<
37 "Maybe the grid implementation does not support distributed parallelism."
38 );
39 }
40
41 return Dune::SolverCategory::sequential;
42 }
43
44 } // end namespace Dumux::Detail
45
46 #endif
47