3.2-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
dumux
material
components
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
* See the file COPYING for full copying permissions. *
5
* *
6
* This program is free software: you can redistribute it and/or modify *
7
* it under the terms of the GNU General Public License as published by *
8
* the Free Software Foundation, either version 3 of the License, or *
9
* (at your option) any later version. *
10
* *
11
* This program is distributed in the hope that it will be useful, *
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
* GNU General Public License for more details. *
15
* *
16
* You should have received a copy of the GNU General Public License *
17
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
18
*****************************************************************************/
24
#ifndef DUMUX_COMPONENT_ION_HH
25
#define DUMUX_COMPONENT_ION_HH
26
27
#include <dune/common/exceptions.hh>
28
29
#include <
dumux/common/typetraits/typetraits.hh
>
30
31
namespace
Dumux
{
32
namespace
Components {
33
38
template
<
class
Scalar,
class
Component>
39
class
Ion
40
{
41
public
:
45
template
<
class
C = Component>
46
static
constexpr
int
charge
()
47
{
48
static_assert
(
AlwaysFalse<C>::value
,
"Mandatory function not implemented: charge()"
);
49
return
0;
// iso c++ requires a return statement for constexpr functions
50
}
51
};
52
53
}
// end namespace Components
54
}
// end namespace Dumux
55
56
#endif
typetraits.hh
Dumux
Definition:
adapt.hh:29
Dumux::AlwaysFalse
Template which always yields a false value.
Definition:
typetraits.hh:37
Dumux::Components::Ion
Interface for components that are ions.
Definition:
ion.hh:40
Dumux::Components::Ion::charge
static constexpr int charge()
Returns the charge of the ion.
Definition:
ion.hh:46
Generated by
1.9.3