Constructor of DefaultGlobalBasis is quite aggressive.
In 680ca3ca a new constructor template<class PreBasisFactory> DefaultGlobalBasis(const GridView& gridView, PreBasisFactory&& factory);
has been added. The template sometimes overrides the other constructor which forwards the arguments to the prebasis. E.g., the following does not compile (g++ 10.2.1) anymore:
template<typename GV>
void foo(const GV& gv) {
const auto basis = Dune::Functions::LagrangeBasis<GV>(gv, 1);
}
int
main(int argc, char** argv)
{
using namespace Dune;
MPIHelper::instance(argc, argv);
using Grid = YaspGrid<2>;
const auto gridptr = StructuredGridFactory<Grid>::createCubeGrid(
{ { 0, 0 } }, { { 1, 1 } }, { { 2, 2 } });
foo(gridptr->leafGridView());
}
Error:
/home/lasse/dune/dune-functions/dune/functions/functionspacebases/defaultglobalbasis.hh:102:22: error: expression cannot be used as a function
102 | preBasis_(factory(gridView)),
| ~~~~~~~^~~~~~~~~~