version 3.10-dev
sphere.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_GEOMETRY_SPHERE_HH
13#define DUMUX_GEOMETRY_SPHERE_HH
14
15#include <dune/common/fvector.hh>
16
17namespace Dumux {
18
23template<class Scalar, int dim>
24class Sphere
25{
26public:
27 using Point = Dune::FieldVector<Scalar, dim>;
28
30 : center_(0.0)
31 , radius_(0.0)
32 {}
33
34 Sphere(const Point& center, Scalar radius)
35 : center_(center)
36 , radius_(radius)
37 {}
38
39 Scalar radius() const
40 { return radius_; }
41
42 const Point& center() const
43 { return center_; }
44
45private:
46 Point center_;
47 Scalar radius_;
48};
49
50} // end namespace Dumux
51
52#endif
A simple sphere type.
Definition: sphere.hh:25
Scalar radius() const
Definition: sphere.hh:39
Sphere(const Point &center, Scalar radius)
Definition: sphere.hh:34
Dune::FieldVector< Scalar, dim > Point
Definition: sphere.hh:27
const Point & center() const
Definition: sphere.hh:42
Sphere()
Definition: sphere.hh:29
Definition: adapt.hh:17