[Dune] PQkLocalFiniteElement in dune-localfunction

Carsten Gräser graeser at mi.fu-berlin.de
Thu Apr 28 01:20:26 CEST 2016


Hello Simon,

Am 28.04.2016 um 01:09 schrieb Simon Praetorius:
> Hello,
> 
> I'm currently working on calculating derivatives of solution-vectors
> build on functionspacebases from dune-function, i.e. PQkNodalBasis with
nice to see you're using dune-functions.

> order k > 0. When evaluating the derivative I get an error about non
> matching types, since for some reasons the PQkLocalFiniteElementCache
> generates a LocalBasisType for P0LocalFiniteElements only (independent
> of k, always the order 0 is chosen). Is this a bug or a feature or
> simply not yet implemented for general k?
it's a consequence of how our partial derivative interface
works: The size of the array defininig the partial derivative
grows with it's order which is reflected by using having the
array type as a template parameter.

This does not work in the virtual interface where the size
must be fixed. Since not all implementations provide partial
derivatives of order k>0 we can only use order 0 for the interface.

The issue is already documented here:

  https://gitlab.dune-project.org/flyspray/FS/issues/1653

However, we decided to change the interface to classical multiindex
notation, such that this problem will vanish. Unfortunately I did
not have time to implement this change yet.

Best,
Carsten

> 
> Best regards,
> Simon
> 
> Details:
> ------------------
> The evaluation of a partial derivative is called by
> 
> pqknodalbasis.localView().tree().finiteElement().localBasis().template
> evaluate<1>(direction, position, derivativeVector);
> 
> with
> decltype(direction) = std::array<int, 1>
> decltype(position) = FieldVector<double,dim>
> decltype(derivativeVector) = std::vector< DerivativeType >
> 
> using DerivativeType =
> PQkNodalBasis<...>::LocalView::Tree::FiniteElement::Traits::LocalBasisType::Traits::RangeType
> 
> 
> The problem is in the LocalBasisType, i.e.
> 
> using LocalBasisType =
> decltype(pqknodalbasis.localView().tree().finiteElement().localBasis())::(...)
> 
>  = LocalBasisVirtualInterface< LocalBasisTraits<DF,n,D,RF,m,R,J, *** 0
> *** > >
> 
> Thus, the maximal order of implemented partial derivatives is always set
> to 0.
> 
> See also PQkLocalFiniteElementCache>D,R,dim,k>::FiniteElementType in
> pqkfactory.hh:115
> 
> ErrorMessage:
> -------------------------
> File://dune/localfunctions/common/virtualinterface.hh: In instantiation
> of 'void Dune::LocalBasisVirtualInterface<T>::evaluate(const
> std::array<int, k>&, const typename
> Dune::LocalBasisVirtualInterface<T>::Traits::DomainType&,
> std::vector<typename T::RangeType>&) const [with int k = 1; T =
> Dune::LocalBasisTraits<double, 2, Dune::FieldVector<double, 2>, double,
> 1, Dune::FieldVector<double, 1>, Dune::FieldMatrix<double, 1, 2>, 0>;
> typename Dune::LocalBasisVirtualInterface<T>::Traits::DomainType =
> Dune::FieldVector<double, 2>; typename T::RangeType =
> Dune::FieldVector<double, 1>]':
> (...)
> File://dune/localfunctions/common/virtualinterface.hh:211:44: error:
> invalid initialization of reference of type 'const OrderKBaseInterface&
> {aka const
> Dune::LocalBasisVirtualInterfaceBase<Dune::LocalBasisTraits<double, 2,
> Dune::FieldVector<double, 2>, double, 1, Dune::FieldVector<double, 1>,
> Dune::FieldMatrix<double, 1, 2>, 1> >&}' from expression of type 'const
> Dune::LocalBasisVirtualInterface<Dune::LocalBasisTraits<double, 2,
> Dune::FieldVector<double, 2>, double, 1, Dune::FieldVector<double, 1>,
> Dune::FieldMatrix<double, 1, 2>, 0> >'
>        const OrderKBaseInterface& asBase = *this;
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20160428/6fb27d93/attachment.sig>


More information about the Dune mailing list