version 3.10-dev
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// SPDX-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
7
13#ifndef DUMUX_COMPONENT_TRAITS_HH
14#define DUMUX_COMPONENT_TRAITS_HH
15
16#include <type_traits>
17
22
23namespace Dumux {
24
29template<class Component>
31{
32 using Scalar = typename Component::Scalar;
33
35 static constexpr bool hasSolidState = std::is_base_of<Components::Solid<Scalar, Component>, Component>::value;
36
38 static constexpr bool hasLiquidState = std::is_base_of<Components::Liquid<Scalar, Component>, Component>::value;
39
41 static constexpr bool hasGasState = std::is_base_of<Components::Gas<Scalar, Component>, Component>::value;
42
44 static constexpr bool isIon = std::is_base_of<Components::Ion<Scalar, Component>, Component>::value;
45};
46
47} // end namespace Dumux
48
49#endif
Interface for components that have a gas state.
Interface for components that are ions.
Interface for components that have a liquid state.
Definition: adapt.hh:17
Interface for components that have a solid state.
Component traits, i.e. information extracted from components.
Definition: componenttraits.hh:31
static constexpr bool hasLiquidState
if the component implements a liquid state
Definition: componenttraits.hh:38
typename Component::Scalar Scalar
Definition: componenttraits.hh:32
static constexpr bool isIon
if the component implements an ion
Definition: componenttraits.hh:44
static constexpr bool hasSolidState
if the component implements a solid state
Definition: componenttraits.hh:35
static constexpr bool hasGasState
if the component implements a gaseous state
Definition: componenttraits.hh:41