3.5-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
componenttraits.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 *****************************************************************************/
19
25#ifndef DUMUX_COMPONENT_TRAITS_HH
26#define DUMUX_COMPONENT_TRAITS_HH
27
28#include <type_traits>
29
34
35namespace Dumux {
36
41template<class Component>
43{
44 using Scalar = typename Component::Scalar;
45
47 static constexpr bool hasSolidState = std::is_base_of<Components::Solid<Scalar, Component>, Component>::value;
48
50 static constexpr bool hasLiquidState = std::is_base_of<Components::Liquid<Scalar, Component>, Component>::value;
51
53 static constexpr bool hasGasState = std::is_base_of<Components::Gas<Scalar, Component>, Component>::value;
54
56 static constexpr bool isIon = std::is_base_of<Components::Ion<Scalar, Component>, Component>::value;
57};
58
59} // end namespace Dumux
60
61#endif
Interface for components that have a gas state.
Interface for components that are ions.
Interface for components that have a liquid state.
Interface for components that have a solid state.
Definition: adapt.hh:29
Component traits, i.e. information extracted from components.
Definition: componenttraits.hh:43
static constexpr bool hasLiquidState
if the component implements a liquid state
Definition: componenttraits.hh:50
typename Component::Scalar Scalar
Definition: componenttraits.hh:44
static constexpr bool isIon
if the component implements an ion
Definition: componenttraits.hh:56
static constexpr bool hasSolidState
if the component implements a solid state
Definition: componenttraits.hh:47
static constexpr bool hasGasState
if the component implements a gaseous state
Definition: componenttraits.hh:53