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 Geometry | ||
10 | * \brief A function to compute bounding spheres of points clouds or convex polytopes | ||
11 | */ | ||
12 | #ifndef DUMUX_GEOMETRY_SPHERE_HH | ||
13 | #define DUMUX_GEOMETRY_SPHERE_HH | ||
14 | |||
15 | #include <dune/common/fvector.hh> | ||
16 | |||
17 | namespace Dumux { | ||
18 | |||
19 | /*! | ||
20 | * \ingroup Geometry | ||
21 | * \brief A simple sphere type | ||
22 | */ | ||
23 | template<class Scalar, int dim> | ||
24 | class Sphere | ||
25 | { | ||
26 | public: | ||
27 | using Point = Dune::FieldVector<Scalar, dim>; | ||
28 | |||
29 | Sphere() | ||
30 | : center_(0.0) | ||
31 | , radius_(0.0) | ||
32 | {} | ||
33 | |||
34 | 240 | Sphere(const Point& center, Scalar radius) | |
35 | 240 | : center_(center) | |
36 | 240 | , radius_(radius) | |
37 | {} | ||
38 | |||
39 | 240 | Scalar radius() const | |
40 |
8/8✓ Branch 0 taken 22 times.
✓ Branch 1 taken 38 times.
✓ Branch 2 taken 5 times.
✓ Branch 3 taken 55 times.
✓ Branch 4 taken 12 times.
✓ Branch 5 taken 48 times.
✓ Branch 6 taken 19 times.
✓ Branch 7 taken 41 times.
|
240 | { return radius_; } |
41 | |||
42 | ✗ | const Point& center() const | |
43 | { return center_; } | ||
44 | |||
45 | private: | ||
46 | Point center_; | ||
47 | Scalar radius_; | ||
48 | }; | ||
49 | |||
50 | } // end namespace Dumux | ||
51 | |||
52 | #endif | ||
53 |