version 3.8
checkoverlapsize.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-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
12#ifndef DUMUX_DISCRETIZATION_CHECK_OVERLAP_SIZE_HH
13#define DUMUX_DISCRETIZATION_CHECK_OVERLAP_SIZE_HH
14
16
17namespace Dumux {
18
26template<class DiscretizationMethod>
28{
29 template<class GridView>
30 static bool isValid(const GridView& gridView) noexcept
31 { return gridView.comm().size() <= 1 || gridView.overlapSize(0) + gridView.ghostSize(0) > 0; }
32};
33
35template<>
36struct CheckOverlapSize<DiscretizationMethods::Box>
37{
38 template<class GridView>
39 static bool isValid(const GridView& gridView) noexcept
40 { return gridView.comm().size() <= 1 || gridView.overlapSize(0) == 0; }
41};
42
45template<>
46struct CheckOverlapSize<DiscretizationMethods::FEM>
47{
48 template<class FEBasis>
49 static bool isValid(const FEBasis& feBasis) noexcept
50 { return feBasis.gridView().comm().size() <= 1 || feBasis.gridView().overlapSize(0) == 0; }
51};
52
53// fc staggered requires an overlap of exactly 1
54template<>
55struct CheckOverlapSize<DiscretizationMethods::FCStaggered>
56{
57 template<class GridView>
58 static bool isValid(const GridView& gridView) noexcept
59 { return gridView.comm().size() <= 1 || gridView.overlapSize(0) == 1; }
60};
61
62} // end namespace Dumux
63
64#endif
The available discretization methods in Dumux.
CVFE< CVFEMethods::PQ1 > Box
Definition: method.hh:94
Definition: adapt.hh:17
static bool isValid(const GridView &gridView) noexcept
Definition: checkoverlapsize.hh:39
static bool isValid(const GridView &gridView) noexcept
Definition: checkoverlapsize.hh:58
static bool isValid(const FEBasis &feBasis) noexcept
Definition: checkoverlapsize.hh:49
Check if the overlap size is valid for a given discretization method.
Definition: checkoverlapsize.hh:28
static bool isValid(const GridView &gridView) noexcept
Definition: checkoverlapsize.hh:30