DUNE PDELab (git)

localinterpolation.hh
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
5#ifndef DUNE_LOCALFUNCTIONS_COMMON_LOCALINTERPOLATION_HH
6#define DUNE_LOCALFUNCTIONS_COMMON_LOCALINTERPOLATION_HH
7
8#include <functional>
9
11
12
13
14namespace Dune {
15
16 namespace Impl {
17
18 // Concept for function supporting f.evaluate(Domain, Range&)
19 template<class Domain, class Range>
20 struct FunctionWithEvaluate
21 {
22 template<class F>
23 auto require(F&& f) -> decltype(
24 f.evaluate(std::declval<Domain>(), std::declval<Range&>())
25 );
26 };
27
28 // Concept for function supporting f(Domain)
29 template<class Domain>
30 struct FunctionWithCallOperator
31 {
32 template<class F>
33 auto require(F&& f) -> decltype(
34 f(std::declval<Domain>())
35 );
36 };
37
38 // Create function supporting Range = f(Domain)
39 // This functions returns the passed in reference.
40 template<class Domain, class F,
41 std::enable_if_t<models<FunctionWithCallOperator<Domain>, F>(), int> = 0>
42 [[deprecated( "The utility function makeFunctionWithCallOperator() is deprecated and will be removed after 2.10."
43 "Downstream modules no longer need to call this function since interpolate() no-longer supports non-callable functions.")]]
44 decltype(auto) makeFunctionWithCallOperator(const F& f)
45 {
46 return f;
47 }
48
49 } // namespace Impl
50
51} // namespace Dune
52#endif
Infrastructure for concepts.
Dune namespace.
Definition: alignedallocator.hh:13
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 24, 23:30, 2024)