Skip to content
Snippets Groups Projects
Commit fa53c08a authored by Porrmann, Maik's avatar Porrmann, Maik
Browse files

Fill primary template with interface

parent 5bd61c25
No related branches found
No related tags found
No related merge requests found
......@@ -28,6 +28,47 @@ namespace Dune
template <unsigned int dim>
struct HermiteTransformator
{
//TODO prepare this class to be used by a extended GlobalValuedFiniteElement class
// Add static method that creates Matrix with size corresponding to dim and sparsitypattern
// Add static method that fills this Matrix using geomety
// Adapt apply and applyJacobian accordingly
// So far this primary template is not used
template <typename Values, typename LocalCoordinate, typename Geometry>
static auto apply(Values &values, const LocalCoordinate &xi, const Geometry &geometry)
{
}
template <typename Gradients, typename LocalCoordinate, typename Geometry>
static auto applyJacobian(Gradients &values, const LocalCoordinate &xi, const Geometry geometry)
{
}
template <class Function, class LocalCoordinate, class Element>
class LocalValuedFunction
{
const Function &f_;
const Element &element_;
public:
LocalValuedFunction(const Function &f, const Element &e)
: f_(f), element_(e) {}
auto operator()(const LocalCoordinate &xi) const
{
auto &&f = Dune::Impl::makeFunctionWithCallOperator<LocalCoordinate>(f_);
return f_(xi); // no transformation for functionvalues needed
}
friend auto derivative(LocalValuedFunction const &t)
{
// Assumption: derivative(t.f_) gives the global derivative evaluted in local coordinates, if interpolation into the globalValuedfiniteElement.
// I would like to do this
// return LocalValuedFunction<typename std::decay<decltype(derivative(t.f_))>::type, LocalCoordinate, Element>(derivative(t.f_), t.element_);
// But it leads to a DifferentiableFunction which causes a segmentation violation when calling asInterface() ....
return derivative(t.f_);
}
};
};
template <>
......@@ -76,7 +117,7 @@ namespace Dune
auto operator()(const LocalCoordinate &xi) const
{
// auto &&f = Dune::Impl::makeFunctionWithCallOperator<LocalCoordinate>(f_);
auto &&f = Dune::Impl::makeFunctionWithCallOperator<LocalCoordinate>(f_);
return f_(xi); // no transformation for functionvalues needed
}
......@@ -201,7 +242,7 @@ namespace Dune
if (not e.type().isSimplex())
DUNE_THROW(Dune::NotImplemented, "HermiteBasis can only be bound to simplex elements");
element_ = &e;
// if constexpr (dim != 1)
finiteElement_->bind(*localValuedFiniteElement_, *element_);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment