Compilation error with Scalar=Float128
Hello,
I get the following error using DuMux with DUNE with Scalar=Float128 setting:
/home/dpavlov/DUMUX/dune-localfunctions/dune/localfunctions/lagrange/lagrangesimplex.hh: In instantiation of ‘void Dune::Impl::LagrangeSimplexLocalBasis<D, R, dim, k>::evaluateJacobian(const typename Dune::Impl::LagrangeSimplexLocalBasis<D, R, dim, k>::Traits::DomainType&, std::vector<typename Dune::LocalBasisTraits<D, dim, Dune::FieldVector<CoordType, coorddim>, R, 1, Dune::FieldVector<Scalar, 1>, Dune::FieldMatrix<R, 1, dim> >::JacobianType>&) const [with D = double; R = Dune::Impl::Float128; unsigned int dim = 2; unsigned int k = 1; typename Dune::Impl::LagrangeSimplexLocalBasis<D, R, dim, k>::Traits::DomainType = Dune::FieldVector<double, 2>; typename Dune::LocalBasisTraits<D, dim, Dune::FieldVector<CoordType, coorddim>, R, 1, Dune::FieldVector<Scalar, 1>, Dune::FieldMatrix<R, 1, dim> >::JacobianType = Dune::FieldMatrix<Dune::Impl::Float128, 1, 2>]’:
/home/dpavlov/DUMUX/dune-localfunctions/dune/localfunctions/common/virtualwrappers.hh:113:7: required from ‘void Dune::LocalBasisVirtualImp<T, Imp>::evaluateJacobian(const typename Dune::LocalBasisVirtualImp<T, Imp>::Traits::DomainType&, std::vector<typename T::JacobianType>&) const [with T = Dune::LocalBasisTraits<double, 2, Dune::FieldVector<double, 2>, Dune::Impl::Float128, 1, Dune::FieldVector<Dune::Impl::Float128, 1>, Dune::FieldMatrix<Dune::Impl::Float128, 1, 2> >; Imp = Dune::Impl::LagrangeSimplexLocalBasis<double, Dune::Impl::Float128, 2, 1>; typename Dune::LocalBasisVirtualImp<T, Imp>::Traits::DomainType = Dune::FieldVector<double, 2>; typename T::JacobianType = Dune::FieldMatrix<Dune::Impl::Float128, 1, 2>]’
/home/dpavlov/DUMUX/eor-1p/app/main.cc:172:1: required from here
/home/dpavlov/DUMUX/dune-localfunctions/dune/localfunctions/lagrange/lagrangesimplex.hh:331:38: error: operands to ?: have different types ‘Dune::Impl::Float128’ and ‘double’
prod *= (j==l) ? R(k) / (i[p]-l) : (kx[p]-l) / (i[p]-l);
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dpavlov/DUMUX/dune-localfunctions/dune/localfunctions/lagrange/lagrangesimplex.hh:331:38: note: and each type can be converted to the other
Changing the problematic line to
prod *= (j==l) ? R(k) / (i[p]-l) : (R)(kx[p]-l) / (i[p]-l);
helps, but I am not sure whether this is the correct fix.