Loading...
Searching...
No Matches
gridviewfunction.hh
Go to the documentation of this file.
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH
#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH
#include <memory>
#include <dune/common/concept.hh>
#include <dune/functions/gridfunctions/gridfunction.hh>
#include <dune/functions/gridfunctions/gridviewentityset.hh>
#include <dune/functions/gridfunctions/analyticgridviewfunction.hh>
namespace Dune {
namespace Functions {
template<class Signature, class GridView, template<class> class DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56>
class GridViewFunction
{};
template<class Range, class Domain, class GV, template<class> class DerivativeTraits, size_t bufferSize>
class GridViewFunction<Range(Domain), GV, DerivativeTraits, bufferSize> :
public GridFunction<Range(Domain), GridViewEntitySet<GV, 0>, DerivativeTraits, bufferSize>
{
using Base = GridFunction<Range(Domain), GridViewEntitySet<GV, 0>, DerivativeTraits, bufferSize>;
public:
using GridView = GV;
using Base::Base;
};
template<class F, class GridView,
std::enable_if_t<
models< Imp::HasFreeLocalFunction, F>() , int> = 0>
std::decay_t<F>
makeGridViewFunction(F&& f, const GridView& gridView)
{
return std::forward<F>(f);
}
template<class F, class GridView,
std::enable_if_t<
not(models< Imp::HasFreeLocalFunction, F>()) , int> = 0>
auto makeGridViewFunction(F&& f, const GridView& gridView)
-> decltype(makeAnalyticGridViewFunction(std::forward<F>(f), gridView))
{
return makeAnalyticGridViewFunction(std::forward<F>(f), gridView);
}
} // end of namespace Dune::Functions
} // end of namespace Dune
#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH
gridfunction.hh
gridviewentityset.hh
analyticgridviewfunction.hh
Dune::Functions::makeAnalyticGridViewFunction
auto makeAnalyticGridViewFunction(F &&f, const GridView &gridView)
Create an AnalyticGridViewFunction from a function and a grid view.
Definition analyticgridviewfunction.hh:238
Dune
Definition monomialset.hh:19
Dune::Functions
Definition monomialset.hh:19
Dune::Functions::makeGridViewFunction
std::decay_t< F > makeGridViewFunction(F &&f, const GridView &gridView)
Construct a function modeling GridViewFunction from function and grid view.
Definition gridviewfunction.hh:72
Dune::Functions::DefaultDerivativeTraits
Default implementation for derivative traits.
Definition defaultderivativetraits.hh:41
Dune::Functions::GridFunction
Definition gridfunction.hh:36
Dune::Functions::GridViewEntitySet
An entity set for all entities of given codim in a grid view.
Definition gridviewentityset.hh:27
Dune::Functions::GridViewFunction
Definition gridviewfunction.hh:26
Dune::Functions::GridViewFunction< Range(Domain), GV, DerivativeTraits, bufferSize >::GridView
GV GridView
Definition gridviewfunction.hh:50