AMDiS 2.10
The Adaptive Multi-Dimensional Simulation Toolbox
DiscreteFunction< Coeff, GB, TreePath, R > Class Template Reference

A mutable view on the subspace of a DOFVector,. More...

#include <DiscreteFunction.hpp>

Classes

class  LocalFunction
 

Public Member Functions

template<class C , class B , class... Path, REQUIRES(Concepts::Similar< Underlying_t< C >, Coefficients >) , REQUIRES(Concepts::Similar< Underlying_t< B >, GlobalBasis >) >
 DiscreteFunction (C &&coefficients, B &&basis, Path... path)
 Constructor. Stores a pointer to the mutable coefficients vector.
 
template<class Expr , class Tag = tag::assign>
void interpolate_noalias (Expr &&expr, Tag strategy={})
 Interpolation of GridFunction to DOFVector, assuming that there is no reference to this DOFVector in the expression. More...
 
template<class Expr , class Tag = tag::assign>
void interpolate (Expr &&expr, Tag strategy={})
 Interpolation of GridFunction to DOFVector. More...
 
template<class Expr >
Selfoperator<< (Expr &&expr)
 Interpolation of GridFunction to DOFVector, alias to interpolate()
 
template<class Expr >
Selfoperator+= (Expr &&expr)
 interpolate (*this) + expr to DOFVector
 
template<class Expr >
Selfoperator-= (Expr &&expr)
 interpolate (*this) - expr to DOFVector
 
Coefficients & coefficients ()
 Return the mutable DOFVector.
 
template<class Range = void, class... Indices>
auto child (Indices... ii)
 
Coefficients const & coefficients () const
 Return the const DOFVector.
 
template<class Range = void, class... Indices>
auto child (Indices... ii) const
 

Protected Attributes

std::shared_ptr< Coefficients > mutableCoeff_
 

Detailed Description

template<class Coeff, class GB, class TreePath, class R>
class AMDiS::DiscreteFunction< Coeff, GB, TreePath, R >

A mutable view on the subspace of a DOFVector,.

A view on a subspace of a DOFVector.

Template Parameters
CoeffConst or mutable coefficient vector
GBThe type of the global basis
TreePathA realization of Dune::TypeTree::HybridTreePath
RangeThe range type for th evaluation of the discrete function

Requirements:

  • GB models Concepts::GlobalBasis

Member Function Documentation

◆ interpolate()

void interpolate ( Expr &&  expr,
Tag  strategy = {} 
)

Interpolation of GridFunction to DOFVector.

Example:

auto v = valueOf(prob.solutionVector(),0);
v.interpolate(v + [](auto const& x) { return x[0]; });

Allows to have a reference to the DOFVector in the expression, e.g. as DiscreteFunction or gradientOf() of a DiscreteFunction.

References DiscreteFunction< Coeff, GB, TreePath, R >::interpolate_noalias().

Referenced by DiscreteFunction< Coeff, GB, TreePath, R >::operator+=(), DiscreteFunction< Coeff, GB, TreePath, R >::operator-=(), and DiscreteFunction< Coeff, GB, TreePath, R >::operator<<().

◆ interpolate_noalias()

void interpolate_noalias ( Expr &&  expr,
Tag  strategy = {} 
)

Interpolation of GridFunction to DOFVector, assuming that there is no reference to this DOFVector in the expression.

Example:

auto v = valueOf(prob.solutionVector(),0);
v.interpolate_noalias([](auto const& x) { return x[0]; });

References AMDiS::makeGridFunction().

Referenced by DiscreteFunction< Coeff, GB, TreePath, R >::interpolate().


The documentation for this class was generated from the following files: