Commit 0faff253 authored by Praetorius, Simon's avatar Praetorius, Simon

renamed template parameters, to shorten error messages and symbols

parent 68c1eb6d
......@@ -15,11 +15,14 @@
namespace AMDiS
{
/// Implementation of interface \ref AssemblerBase
template <class LocalContext, class Operator, class... Nodes>
/**
* \tparam LC LocalContext
**/
template <class LC, class Operator, class... Nodes>
class Assembler
: public AssemblerInterface<LocalContext, Nodes...>
: public AssemblerInterface<LC, Nodes...>
{
using Super = AssemblerInterface<LocalContext, Nodes...>;
using Super = AssemblerInterface<LC, Nodes...>;
private:
......@@ -74,12 +77,11 @@ namespace AMDiS
* \ref calculateElementVector or \ref calculateElementMatrix on the
* vector or matrix operator, respectively.
**/
void assemble(LocalContext const& localContext,
Nodes const&... nodes,
void assemble(LC const& localContext, Nodes const&... nodes,
ElementMatrixVector& elementMatrixVector) final
{
ContextGeometry<LocalContext> context{localContext, element(), geometry()};
assembleImpl(context, nodes..., elementMatrixVector);
ContextGeometry<LC> contextGeo{localContext, element(), geometry()};
assembleImpl(contextGeo, nodes..., elementMatrixVector);
}
......@@ -88,21 +90,17 @@ namespace AMDiS
protected: // implementation detail
// matrix assembling
template <class Context, class RowNode, class ColNode, class ElementMatrix>
void assembleImpl(Context const& context,
RowNode const& rowNode, ColNode const& colNode,
ElementMatrix& elementMatrix)
template <class CG, class RN, class CN, class Mat>
void assembleImpl(CG const& contextGeo, RN const& rowNode, CN const& colNode, Mat& elementMatrix)
{
op_->calculateElementMatrix(context, rowNode, colNode, elementMatrix);
op_->calculateElementMatrix(contextGeo, rowNode, colNode, elementMatrix);
}
// vector assembling
template <class Context, class Node, class ElementVector>
void assembleImpl(Context const& context,
Node const& node,
ElementVector& elementVector)
template <class CG, class Node, class Vec>
void assembleImpl(CG const& contextGeo, Node const& node, Vec& elementVector)
{
op_->calculateElementVector(context, node, elementVector);
op_->calculateElementVector(contextGeo, node, elementVector);
}
#endif // DOXYGEN
......@@ -134,11 +132,11 @@ namespace AMDiS
};
/// Generate a \ref Assembler on a given `LocalContext` (element or intersection)
template <class LocalContext, class Operator, class... Nodes>
/// Generate a \ref Assembler on a given LocalContext `LC` (element or intersection)
template <class LC, class Operator, class... Nodes>
auto makeAssembler(Operator&& op, Nodes const&...)
{
return Assembler<LocalContext, Underlying_t<Operator>, Nodes...>{FWD(op)};
return Assembler<LC, Underlying_t<Operator>, Nodes...>{FWD(op)};
}
} // end namespace AMDiS
......@@ -128,8 +128,8 @@ namespace AMDiS
NodeDataTransferContainer nodeDataTransfer_;
};
template <class Container, class Basis>
void DataTransfer<Container, Basis>::preAdapt(Container const& coeff, bool mightCoarsen)
template <class C, class B>
void DataTransfer<C,B>::preAdapt(C const& coeff, bool mightCoarsen)
{
auto gv = basis_->gridView();
auto lv = basis_->localView();
......@@ -217,8 +217,8 @@ namespace AMDiS
}
}
template <class Container, class Basis>
void DataTransfer<Container, Basis>::postAdapt(Container& coeff, bool refined)
template <class C, class B>
void DataTransfer<C,B>::postAdapt(C& coeff, bool refined)
{
coeff.resize(*basis_);
auto gv = basis_->gridView();
......@@ -370,9 +370,9 @@ namespace AMDiS
NodeElementData fatherDOFsTemp_;
};
template <class Node, class Container, class Basis>
template <class Node, class C, class B>
template <class Trafo>
bool NodeDataTransfer<Node, Container, Basis>::
bool NodeDataTransfer<Node,C,B>::
restrictLocal(Element const& father, NodeElementData& fatherDOFs, Trafo const& trafo,
NodeElementData const& childDOFs, bool init)
{
......@@ -426,9 +426,9 @@ namespace AMDiS
std::logical_and<bool>());
}
template <class Node, class Container, class Basis>
template <class Node, class C, class B>
template <class Trafo>
void NodeDataTransfer<Node, Container, Basis>::
void NodeDataTransfer<Node,C,B>::
prolongLocal(Element const& father, NodeElementData const& fatherDOFs,
Trafo const& trafo, bool init)
{
......
......@@ -53,22 +53,28 @@ namespace AMDiS
, values_(FWD(values))
{}
template <class Intersection>
bool onBoundary(Intersection const& intersection) const
template <class IS>
bool onBoundary(IS const& intersection) const
{
return predicate_ ? (*predicate_)(intersection.geometry().center())
: Super::onBoundary(intersection);
}
// fill \ref dirichletNodes_ with 1 or 0 whether DOF corresponds to the boundary or not.
template <class RowBasis, class ColBasis>
void init(RowBasis const& rowBasis, ColBasis const& colBasis);
template <class RB, class CB>
void init(RB const& rowBasis, CB const& colBasis);
/// \brief Apply dirichlet BC to matrix and vector, i.e., add a unit-row
/// to the matrix and optionally delete the corresponding matrix-column.
template <class Matrix, class VectorX, class VectorB, class RowNode, class ColNode>
void fillBoundaryCondition(Matrix& matrix, VectorX& solution, VectorB& rhs,
RowNode const& rowNode, ColNode const& colNode);
/**
* \tparam Mat Matrix
* \tparam Sol Vector of solution
* \tparam Rhs Vector of rhs
* \tparam RN RowNode
* \tparam CN ColNode
**/
template <class Mat, class Sol, class Rhs, class RN, class CN>
void fillBoundaryCondition(Mat& matrix, Sol& solution, Rhs& rhs, RN const& rowNode, CN const& colNode);
private:
Dune::Std::optional<std::function<bool(Domain)>> predicate_;
......@@ -82,8 +88,8 @@ namespace AMDiS
{
using WorldVector = typename Basis::GridView::template Codim<0>::Geometry::GlobalCoordinate;
template <class RowNode, class ColNode>
using type = std::list< std::shared_ptr<DirichletBC<WorldVector, RangeType_t<RowNode>>> >;
template <class RN, class CN>
using type = std::list< std::shared_ptr<DirichletBC<WorldVector, RangeType_t<RN>>> >;
};
template <class RowBasis, class ColBasis>
......
......@@ -13,29 +13,28 @@
namespace AMDiS {
template <class D, class R>
template <class RowBasis, class ColBasis>
template <class RB, class CB>
void DirichletBC<D,R>::
init(RowBasis const& rowBasis, ColBasis const& colBasis)
init(RB const& rowBasis, CB const& colBasis)
{
using Dune::Functions::forEachBoundaryDOF;
using LV = typename ColBasis::LocalView;
using I = typename ColBasis::GridView::Intersection;
using LV = typename CB::LocalView;
using IS = typename CB::GridView::Intersection;
dirichletNodes_.resize(colBasis.dimension());
forEachBoundaryDOF(colBasis, [&](int localIndex, LV const& localView, I const& intersection) {
forEachBoundaryDOF(colBasis, [&](int localIndex, LV const& localView, IS const& intersection) {
dirichletNodes_[localView.index(localIndex)] = onBoundary(intersection);
});
}
template <class D, class R>
template <class Matrix, class VectorX, class VectorB, class RowNode, class ColNode>
template <class Mat, class Sol, class Rhs, class RN, class CN>
void DirichletBC<D,R>::
fillBoundaryCondition(Matrix& matrix, VectorX& solution, VectorB& rhs,
RowNode const& rowNode, ColNode const& colNode)
fillBoundaryCondition(Mat& matrix, Sol& solution, Rhs& rhs, RN const& rowNode, CN const& colNode)
{
auto columns = Constraints<Matrix>::dirichletBC(matrix, dirichletNodes_);
auto columns = Constraints<Mat>::dirichletBC(matrix, dirichletNodes_);
Dune::Hybrid::ifElse(std::is_same<RangeType_t<RowNode>, R>{},
Dune::Hybrid::ifElse(std::is_same<RangeType_t<RN>, R>{},
[&](auto id) {
auto subBasis = Dune::Functions::subspaceBasis(rhs.basis(), rowNode.treePath());
Dune::Functions::interpolate(subBasis, rhs, values_, dirichletNodes_);
......@@ -45,7 +44,7 @@ fillBoundaryCondition(Matrix& matrix, VectorX& solution, VectorB& rhs,
for (auto const& triplet : columns)
rhs[triplet.row] -= triplet.value * solution[triplet.col];
Dune::Hybrid::ifElse(std::is_same<RangeType_t<ColNode>, R>{},
Dune::Hybrid::ifElse(std::is_same<RangeType_t<CN>, R>{},
[&](auto id) {
auto subBasis = Dune::Functions::subspaceBasis(solution.basis(), colNode.treePath());
Dune::Functions::interpolate(subBasis, solution, values_, dirichletNodes_);
......
......@@ -26,28 +26,30 @@ namespace AMDiS
*
* The class is specialized, by deriving from it, in \ref GridFunctionOperator.
*
* \tparam Derived The class derived from GridFunctionOperatorBase
* \tparam LocalContext The Element or Intersection type
* \tparam GridFunction The GridFunction, a LocalFunction is created from, and
* that is evaluated at quadrature points.
* \tparam Derived The class derived from GridFunctionOperatorBase
* \tparam LC The Element or Intersection type
* \tparam GF The GridFunction, a LocalFunction is created from, and
* that is evaluated at quadrature points.
*
* **Requirements:**
* - `LocalContext` models either Entity (of codim 0) or Intersection
* - `GridFunction` models the \ref Concepts::GridFunction
* - `LC` models either Entity (of codim 0) or Intersection
* - `GF` models the \ref Concepts::GridFunction
**/
template <class Derived, class LocalContext, class GridFunction>
template <class Derived, class LC, class GF>
class GridFunctionOperatorBase
: public LocalOperator<Derived, LocalContext>
: public LocalOperator<Derived, LC>
{
template <class D, class LC>
template <class, class>
friend class LocalOperator;
using ContextType = Impl::ContextTypes<LocalContext>;
using Super = LocalOperator<Derived, LocalContext>;
using ContextType = Impl::ContextTypes<LC>;
using Super = LocalOperator<Derived, LC>;
private:
using GridFunction = GF;
/// The type of the localFunction associated with the GridFunction
using LocalFunction = decltype(localFunction(std::declval<GridFunction>()));
using LocalFunction = decltype(localFunction(std::declval<GF>()));
/// The Codim=0 entity of the grid, the localFunction can be bound to
using Element = typename ContextType::Entity;
......@@ -56,10 +58,10 @@ namespace AMDiS
using Geometry = typename Element::Geometry;
/// The type of the local coordinates in the \ref Element
using LocalCoordinate = typename GridFunction::EntitySet::LocalCoordinate;
using LocalCoordinate = typename GF::EntitySet::LocalCoordinate;
/// A factory for QuadratureRules that incooperate the order of the LocalFunction
using QuadFactory = QuadratureFactory<typename Geometry::ctype, LocalContext::mydimension, LocalFunction>;
using QuadFactory = QuadratureFactory<typename Geometry::ctype, LC::mydimension, LocalFunction>;
public:
/// \brief Constructor. Stores a copy of `gridFct`.
......@@ -68,19 +70,20 @@ namespace AMDiS
* differentiation order of the operator, to calculate the
* quadrature degree in \ref getDegree.
**/
template <class GF>
GridFunctionOperatorBase(GF&& gridFct, int termOrder)
template <class GridFct>
GridFunctionOperatorBase(GridFct&& gridFct, int termOrder)
: gridFct_(FWD(gridFct))
, termOrder_(termOrder)
{}
/// Create a quadrature factory from a PreQuadratureFactory, e.g. class derived from \ref QuadratureFactory
template <class PreQuadFactory>
void setQuadFactory(PreQuadFactory&& pre)
/// \tparam PQF A PreQuadratureFactory
template <class PQF>
void setQuadFactory(PQF&& pre)
{
using ctype = typename Geometry::ctype;
quadFactory_.emplace(
makeQuadratureFactory<ctype, LocalContext::mydimension, LocalFunction>(FWD(pre)));
makeQuadratureFactory<ctype, LC::mydimension, LocalFunction>(FWD(pre)));
}
protected:
......@@ -147,7 +150,7 @@ namespace AMDiS
class GridFunctionOperatorTransposed
: public LocalOperator<Derived, typename Transposed::LocalContext>
{
template <class D, class LC>
template <class, class>
friend class LocalOperator;
template <class T, class... Args>
......@@ -161,8 +164,9 @@ namespace AMDiS
{}
/// Redirects the setQuadFactory call top the transposed operator
template <class PreQuadFactory>
void setQuadFactory(PreQuadFactory&& pre)
/// \tparam PQF A PreQuadratureFactory
template <class PQF>
void setQuadFactory(PQF&& pre)
{
transposedOp_.setQuadFactory(FWD(pre));
}
......@@ -182,15 +186,18 @@ namespace AMDiS
}
/// Apply the assembling to the transposed elementMatrix with interchanged row-/colNode
template <class Context, class RowNode, class ColNode, class ElementMatrix>
void getElementMatrix(Context const& context,
RowNode const& rowNode,
ColNode const& colNode,
ElementMatrix& elementMatrix)
/**
* \tparam CG ContextGeometry
* \tparam RN RowNode
* \tparam CN ColNode
* \tparam Mat ElementMatrix
**/
template <class CG, class RN, class CN, class Mat>
void getElementMatrix(CG const& contextGeometry, RN const& rowNode, CN const& colNode, Mat& elementMatrix)
{
auto elementMatrixTransposed = transposed(elementMatrix);
transposedOp_.getElementMatrix(
context, colNode, rowNode, elementMatrixTransposed);
contextGeometry, colNode, rowNode, elementMatrixTransposed);
}
private:
......@@ -199,12 +206,12 @@ namespace AMDiS
#ifndef DOXYGEN
template <class Tag, class PreGridFct, class PreQuadFactory>
template <class Tag, class PreGridFct, class PQF>
struct PreGridFunctionOperator
{
Tag tag;
PreGridFct expr;
PreQuadFactory quadFactory;
PQF quadFactory;
};
#endif
......@@ -228,12 +235,12 @@ namespace AMDiS
* other effect.
*
* \tparam Tag An Identifier for this GridFunctionOperator
* \tparam LocalContext An Element or Intersection the operator is evaluated on
* \tparam LC An Element or Intersection the operator is evaluated on
* \tparam GridFct A GridFunction evaluated in local coordinates on the bound element
**/
template <class Tag, class LocalContext, class GridFct>
template <class Tag, class LC, class GridFct>
class GridFunctionOperator
: public GridFunctionOperatorBase<GridFunctionOperator<Tag, LocalContext, GridFct>, LocalContext, GridFct>
: public GridFunctionOperatorBase<GridFunctionOperator<Tag, LC, GridFct>, LC, GridFct>
{};
template <class Context, class Tag, class GF, class QF>
......
......@@ -17,7 +17,7 @@ namespace AMDiS
/// Static administration class for automatic handling of DOFVectors during grid adaption
class GridTransferManager
{
template <class T1, class T2>
template <class, class>
friend class DOFVectorBase;
using Self = GridTransferManager;
......
......@@ -8,8 +8,8 @@ namespace AMDiS
{
namespace Impl
{
template <class GF, class GridView, class QuadProvider>
auto integrateImpl(GF&& gf, GridView const& gridView, QuadProvider makeQuad)
template <class GF, class GV, class QP>
auto integrateImpl(GF&& gf, GV const& gridView, QP makeQuad)
{
auto localFct = localFunction(FWD(gf));
......@@ -31,8 +31,8 @@ namespace AMDiS
return result;
}
template <class GF, class GridView, class QuadProvider>
auto integrateImpl(GF&& gf, GridView const& gv, QuadProvider makeQuad, std::true_type)
template <class GF, class GV, class QP>
auto integrateImpl(GF&& gf, GV const& gv, QP makeQuad, std::true_type)
{
return integrateImpl(FWD(gf), gv, makeQuad);
}
......
......@@ -73,34 +73,29 @@ namespace AMDiS
/// \brief Assemble a local element matrix on the element that is bound.
/**
* \param context Container for geometry related data, \ref ContextGeometry
* \param contextGeo Container for geometry related data, \ref ContextGeometry
* \param rowNode The node of the test-basis
* \param colNode The node of the trial-basis
* \param elementMatrix The output element matrix
**/
template <class Context, class RowNode, class ColNode, class ElementMatrix>
void calculateElementMatrix(Context const& context,
RowNode const& rowNode,
ColNode const& colNode,
ElementMatrix& elementMatrix)
template <class CG, class RN, class CN, class Mat>
void calculateElementMatrix(CG const& contextGeo, RN const& rowNode, CN const& colNode, Mat& elementMatrix)
{
assert( bound_ );
derived().getElementMatrix(context, rowNode, colNode, elementMatrix);
derived().getElementMatrix(contextGeo, rowNode, colNode, elementMatrix);
}
/// \brief Assemble a local element vector on the element that is bound.
/**
* \param context Container for geometry related data \ref ContextGeometry
* \param contextGeo Container for geometry related data \ref ContextGeometry
* \param node The node of the test-basis
* \param elementVector The output element vector
**/
template <class Context, class Node, class ElementVector>
void calculateElementVector(Context const& context,
Node const& node,
ElementVector& elementVector)
template <class CG, class Node, class Vec>
void calculateElementVector(CG const& contextGeo, Node const& node, Vec& elementVector)
{
assert( bound_ );
derived().getElementVector(context, node, elementVector);
derived().getElementVector(contextGeo, node, elementVector);
}
......@@ -121,33 +116,17 @@ namespace AMDiS
// default implementation. Can be overridden in the derived classes
void unbind_impl() {}
// default implementation called by \ref calculateElementMatrix
template <class Context, class RowNode, class ColNode, class ElementMatrix>
void getElementMatrix(Context const& /*context*/,
RowNode const& /*rowNode*/,
ColNode const& /*colNode*/,
ElementMatrix& /*elementMatrix*/)
{
error_exit("Needs to be implemented by derived class!");
}
// default implementation called by \ref calculateElementVector
template <class Context, class Node, class ElementVector>
void getElementVector(Context const& /*context*/,
Node const& /*node*/,
ElementVector& /*elementVector*/)
{
error_exit("Needs to be implemented by derived class!");
}
/// \brief Return the quadrature degree for a matrix operator.
/**
* The quadrature degree that is necessary, to integrate the expression
* multiplied with (possibly derivatives of) shape functions. Thus it needs
* the order of derivatives, this operator implements.
*
* \tparam RN RowNode
* \tparam CN ColNode
**/
template <class RowNode, class ColNode>
int getDegree(int order, int coeffDegree, RowNode const& rowNode, ColNode const& colNode) const
template <class RN, class CN>
int getDegree(int order, int coeffDegree, RN const& rowNode, CN const& colNode) const
{
assert( bound_ );
test_warning(coeffDegree >= 0,
......@@ -198,8 +177,13 @@ namespace AMDiS
/// Generate a \ref LocalOperator from a PreOperator.
template <class Derived, class Context, class GridView>
auto makeLocalOperator(LocalOperator<Derived, Context> const& localOp, GridView const& /*gridView*/)
/**
* \tparam Derived Implementation of LocalOperator
* \tparam LC LocalContext
* \tparam GV GridView
**/
template <class Derived, class LC, class GV>
auto makeLocalOperator(LocalOperator<Derived, LC> const& localOp, GV const& /*gridView*/)
{
return localOp.derived();
}
......
......@@ -26,10 +26,10 @@ namespace AMDiS
using Element = typename GridView::template Codim<0>::Entity;
using Intersection = typename GridView::Intersection;
template <class OperatorType>
template <class Op>
struct DataElement
{
std::shared_ptr<OperatorType> op;
std::shared_ptr<Op> op;
BoundaryCondition bc;
};
......
......@@ -40,6 +40,10 @@ namespace AMDiS
/// Implements a periodic boundary condition
/**
* \tparam D Domain
* \tparam MI Type of the MultiIndex
**/
template <class D, class MI>
class PeriodicBC
: public BoundaryCondition
......@@ -58,11 +62,11 @@ namespace AMDiS
, faceTrafo_(std::move(faceTrafo))
{}
template <class RowBasis, class ColBasis>
void init(RowBasis const& rowBasis, ColBasis const& colBasis);
template <class RB, class CB>
void init(RB const& rowBasis, CB const& colBasis);
template <class Matrix, class X, class B, class RN, class CN>
void fillBoundaryCondition(Matrix& A, X& x, B& b, RN const& rowNode, CN const& colNode);
template <class Mat, class Sol, class Rhs, class RN, class CN>
void fillBoundaryCondition(Mat& A, Sol& x, Rhs& b, RN const& rowNode, CN const& colNode);
auto const& associations() const
{
......
......@@ -11,9 +11,9 @@
namespace AMDiS {
template <class D, class MI>
template <class Basis, class ColBasis>
template <class RB, class CB>
void PeriodicBC<D,MI>::
init(Basis const& basis, ColBasis const& /*colBasis*/)
init(RB const& basis, CB const& /*colBasis*/)
{
if (!bool(hasConnectedIntersections_)) {
hasConnectedIntersections_ = true;
......@@ -231,12 +231,11 @@ coords(Node const& tree, std::vector<std::size_t> const& localIndices) const
template <class D, class MI>
template <class Matrix, class VectorX, class VectorB, class RowNode, class ColNode>
template <class Mat, class Sol, class Rhs, class RN, class CN>
void PeriodicBC<D,MI>::
fillBoundaryCondition(Matrix& matrix, VectorX& solution, VectorB& rhs,
RowNode const& rowNode, ColNode const& colNode)
fillBoundaryCondition(Mat& matrix, Sol& solution, Rhs& rhs, RN const& rowNode, CN const& colNode)
{
Constraints<Matrix>::periodicBC(matrix, periodicNodes_, associations_);
Constraints<Mat>::periodicBC(matrix, periodicNodes_, associations_);
for (auto const& a : associations_) {
rhs[a.second] += rhs[a.first];
......
......@@ -16,8 +16,8 @@ namespace AMDiS
class AnalyticLocalFunction;
#endif
template <class R, class D, class LocalContext, class Function>
class AnalyticLocalFunction<R(D), LocalContext, Function>
template <class R, class D, class LC, class Function>
class AnalyticLocalFunction<R(D), LC, Function>
{
public:
/// The LocalDomain this LocalFunction can be evaluated in
......@@ -30,7 +30,7 @@ namespace AMDiS
enum { hasDerivative = true };
private:
using Geometry = typename LocalContext::Geometry;
using Geometry = typename LC::Geometry;
public:
/// \brief Constructor. stores the function `fct`.
......@@ -39,7 +39,7 @@ namespace AMDiS
{}
/// \brief Create a geometry object from the element
void bind(LocalContext const& element)
void bind(LC const& element)
{
geometry_.emplace(element.geometry());
}
......@@ -79,9 +79,9 @@ namespace AMDiS
* **Requirements:**
* - The functor `F` must fulfill the concept \ref Concepts::HasFunctorOrder
**/
template <class Sig, class LocalContext, class F,
template <class Sig, class LC, class F,
REQUIRES(Concepts::HasFunctorOrder<F,1>)>
int order(AnalyticLocalFunction<Sig,LocalContext,F> const& lf)
int order(AnalyticLocalFunction<Sig,LC,F> const& lf)
{
return order(lf.fct(),1);
}
......@@ -97,8 +97,8 @@ namespace AMDiS
* **Requirements:**
* - The functor `F` must fulfill the concept \ref Concepts::HasPartial
**/
template <class R, class D, class LocalContext, class F>
auto derivative(AnalyticLocalFunction<R(D),LocalContext,F> const& lf)
template <class R, class D, class LC, class F>
auto derivative(AnalyticLocalFunction<R(D),LC,F> const& lf)
{
static_assert(Concepts::HasPartial<F>,
"No partial(...,_0) defined for Functor F of AnalyticLocalFunction.");
......@@ -107,7 +107,7 @@ namespace AMDiS
using RawSignature = typename Dune::Functions::SignatureTraits<R(D)>::RawSignature;
using DerivativeSignature = typename Dune::Functions::DefaultDerivativeTraits<RawSignature>::Range(D);
return AnalyticLocalFunction<DerivativeSignature,LocalContext,decltype(df)>{df};
return AnalyticLocalFunction<DerivativeSignature,LC,decltype(df)>{df};
}
......
......@@ -20,8 +20,8 @@ namespace AMDiS
#endif
/// \brief LocalFunction of a Gridfunction returning a constant value.
template <class R, class D, class LocalContext, class T>
class ConstantLocalFunction<R(D), LocalContext, T>
template <class R, class D, class LC, class T>
class ConstantLocalFunction<R(D), LC, T>
{
public:
/// The LocalDomain this LocalFunction can be evaluated in
......@@ -34,7 +34,7 @@ namespace AMDiS
enum { hasDerivative = true };
private:
using Geometry = typename LocalContext::Geometry;
using Geometry = typename LC::Geometry;
public:
/// \brief Constructor. Stores the constant value.
......@@ -42,7 +42,7 @@ namespace AMDiS
: value_(value)
{}
void bind(LocalContext const& /*element*/) { /* do nothing */ }
void bind(LC const& /*element*/) { /* do nothing */ }
void unbind() { /* do nothing */ }
/// Return the constant `value_`.
......@@ -58,7 +58,7 @@ namespace AMDiS
using RawSignature = typename Dune::Functions::SignatureTraits<R(D)>::RawSignature;
using DerivativeRange = typename Dune::Functions::DefaultDerivativeTraits<RawSignature>::Range;
DerivativeRange diff(0);
return ConstantLocalFunction<DerivativeRange(D),LocalContext,DerivativeRange>{diff};
return ConstantLocalFunction<DerivativeRange(D),LC,DerivativeRange>{diff};
}
/// Return the constant polynomial order 0.
......@@ -72,15 +72,15 @@ namespace AMDiS
};
/// \relates ConstantLocalFunction
template <class R, class D, class LocalContext, class T>
auto derivative(ConstantLocalFunction<R(D), LocalContext, T> const& lf)
template <class R, class D, class LC, class T>
auto derivative(ConstantLocalFunction<R(D), LC, T> const& lf)
{
return lf.derivative();
}
/// \relates ConstantLocalFunction
template <class R, class D, class LocalContext, class T>
int order(ConstantLocalFunction<R(D), LocalContext, T> const& lf)
template <class R, class D, class LC, class T>
int order(ConstantLocalFunction<R(D), LC, T> const& lf)
{
return 0;
}
......