version 3.8.0
Loading...
Searching...
No Matches
diameter.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
//
13
#ifndef DUMUX_GEOMETRY_DIAMETER_HH
14
#define DUMUX_GEOMETRY_DIAMETER_HH
15
16
#include <algorithm>
17
18
namespace
Dumux
{
19
25
template
<
class
Geometry>
26
typename
Geometry::ctype
diameter
(
const
Geometry& geo)
27
{
28
using
std::max;
29
typename
Geometry::ctype h = 0.0;
30
for
(std::size_t i = 0; i < geo.corners(); ++i)
31
for
(std::size_t j = i + 1; j < geo.corners(); ++j)
32
h = max(h, (geo.corner(i)-geo.corner(j)).two_norm());
33
34
return
h;
35
}
36
37
}
// end namespace Dumux
38
39
#endif
Dumux::diameter
Geometry::ctype diameter(const Geometry &geo)
Computes the longest distance between points of a geometry.
Definition
diameter.hh:26
Dumux
Definition
adapt.hh:17
dumux
geometry
diameter.hh
© Copyright 2010-
DuMux project contributors
(doc pages:
CC-BY 4.0
/ code examples:
GPLv3 or later
)
3.8.0 Generated by
1.10.0