version 3.8.0
Loading...
Searching...
No Matches
center.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_CENTER_HH
13
#define DUMUX_GEOMETRY_CENTER_HH
14
15
#include <numeric>
16
17
namespace
Dumux
{
18
23
template
<
class
Corners>
24
typename
Corners::value_type
center
(
const
Corners& corners)
25
{
26
using
Pos =
typename
Corners::value_type;
27
auto
center
= std::accumulate(corners.begin(), corners.end(), Pos(0.0));
28
center
/= corners.size();
29
return
center
;
30
}
31
32
}
// end namespace Dumux
33
34
#endif
Dumux::center
Corners::value_type center(const Corners &corners)
The center of a given list of corners.
Definition
center.hh:24
Dumux
Definition
adapt.hh:17
dumux
geometry
center.hh
© Copyright 2010-
DuMux project contributors
(doc pages:
CC-BY 4.0
/ code examples:
GPLv3 or later
)
3.8.0 Generated by
1.9.8