Loading...
Searching...
No Matches
has_function.hpp
/*
Copyright 2022-2023 SINTEF AS
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_CUISTL_DETAIL_HAS_FUNCTION_HPP
#define OPM_CUISTL_DETAIL_HAS_FUNCTION_HPP
#include <type_traits>
namespace Opm::gpuistl::detail
{
template <typename T>
class has_should_call_pre
{
template <typename U>
static std::true_type test(decltype(&U::shouldCallPre));
template <typename U>
static std::false_type test(...);
public:
static constexpr bool value = std::is_same_v<decltype(test<T>(0)), std::true_type>;
};
template <typename T>
class has_should_call_post
{
template <typename U>
static std::true_type test(decltype(&U::shouldCallPost));
template <typename U>
static std::false_type test(...);
public:
static constexpr bool value = std::is_same_v<decltype(test<T>(0)), std::true_type>;
};
template <typename T>
class has_communication
{
template <typename U>
static std::true_type test(decltype(&U::getCommunication));
template <typename U>
static std::false_type test(...);
public:
static constexpr bool value = std::is_same_v<decltype(test<T>(0)), std::true_type>;
};
template <typename T>
class is_a_well_operator
{
template <typename U>
static std::true_type test(decltype(&U::addWellPressureEquations));
template <typename U>
static std::false_type test(...);
public:
static constexpr bool value = std::is_same_v<decltype(test<T>(0)), std::true_type>;
};
} // namespace Opm::gpuistl::detail
#endif
Opm::gpuistl::detail::has_communication
The has_communication class checks if the type has the member function getCommunication.
Definition has_function.hpp:96
Opm::gpuistl::detail::has_should_call_post
The has_should_call_post class detects the presence of the method shouldCallPost.
Definition has_function.hpp:77
Opm::gpuistl::detail::has_should_call_pre
The has_should_call_pre class detects the presence of the method shouldCallPre.
Definition has_function.hpp:51
Opm::gpuistl::detail::is_a_well_operator
The is_a_well_operator class tries to guess if the operator is a well type operator.
Definition has_function.hpp:114
Opm::gpuistl::detail
Contains wrappers to make the CuBLAS library behave as a modern C++ library with function overlading.
Definition autotuner.hpp:30