GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/geometry/sphere.hh
Date: 2024-05-04 19:09:25
Exec Total Coverage
Lines: 2 4 50.0%
Functions: 0 1 0.0%
Branches: 0 0 -%

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 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 : center_(center)
36 240 , radius_(radius)
37 {}
38
39 Scalar radius() const
40 { 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