version 3.8
ion.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_COMPONENT_ION_HH
13#define DUMUX_COMPONENT_ION_HH
14
15#include <dune/common/exceptions.hh>
16
18
19namespace Dumux {
20namespace Components {
21
26template<class Scalar, class Component>
27class Ion
28{
29public:
33 template<class C = Component>
34 static constexpr int charge()
35 {
36 static_assert(AlwaysFalse<C>::value, "Mandatory function not implemented: charge()");
37 return 0; // iso c++ requires a return statement for constexpr functions
38 }
39};
40
41} // end namespace Components
42} // end namespace Dumux
43
44#endif
Interface for components that are ions.
Definition: ion.hh:28
static constexpr int charge()
Returns the charge of the ion.
Definition: ion.hh:34
Type traits.
Definition: adapt.hh:17
Template which always yields a false value.
Definition: common/typetraits/typetraits.hh:24