#433 Error with GridViews (?) in ALUGrid
Metadata
Property | Value |
---|---|
Reported by | Uli Sack (usack@math.fu-berlin.de) |
Reported at | Oct 2, 2008 09:18 |
Type | Bug Report |
Version | Git (pre2.4) [autotools] |
Operating System | Linux |
Last edited by | Martin Nolte (nolte@mathematik.uni-freiburg.de) |
Last edited at | Nov 15, 2008 14:03 |
Closed by | Martin Nolte (nolte@mathematik.uni-freiburg.de) |
Closed at | Nov 15, 2008 14:03 |
Closed in version | Unknown |
Resolution | Fixed |
Comment |
Description
A while ago I posted to the mailinglist a problem with the use of P1Functions as GridFuntions. The problem persists but I think I have tracked it to a source somewhere in ALUGrid as with UG the code compiles without problems. I think it could be connected to the GridViews, as in all the inheritance entanglement of the Dune::P1Function there is a happy back and forth between GridViews and Grids where I guess along the way something gets lost such that GridFunctionGlobalEvalDefault<> is no longer recognized as being a GridFunction<> (plug in the according template parameters.) The original post is:
[Hi Dune-community!
I have a method that takes a GridFunction as parameter. The compiler throws an error if I try to plug in a LeafP1Function or an object of a class I derived from GridFunctionGlobalEvalDefault. Also dynamic_casts of objects of either class to a GridFunction fail. I hope that someone can explain these things to me. I am at a loss. The following gives the details of my problem.
I wrote a class ComposedFunction that implements the composition of two functions deriving from FunctionBase. Now if the inner function is a GridFunction I want to be able to use the composition as a GridFunction as well. Therefore I wrote ComposedGridFunction deriving from ComposedFunction AND GridFunction(Default). Its constructor takes a FunctionBase for the outer function and a GridFunction for the inner function and then calls the constructor of ComposedFunction with these two arguments in the initializer list. Now if I try to compose an arbitrary outer function (let's say TestFunction (see attachment)) with a LeafP1Function as a ComposedFunction it works as expected. But trying to create a ComposedGridFunction with the same two function-objects gives the compiler error:
test.cc:453: error: no matching function for call to ‘ComposedGridFunction<Dune::ALUSimplexGrid<2, 2>, double, double, 1, 1>::ComposedGridFunction(TestFunction<double, double, 1, 1>&, Dune::LeafP1Function<Dune::ALUSimplexGrid<2, 2>, double, 1>&)’ /home/cocktail/usack/entwicklung/dune/ag-common/dune/ag-common/composedgridfunction.hh:32: note: candidates are: ComposedGridFunction<GridType, BT, CT, Bdim, Cdim>::ComposedGridFunction(Dune::FunctionBase<BT, CT, Bdim, Cdim>&, Dune::GridFunction<GridType, BT, Bdim>&) [with GridType = Dune::ALUSimplexGrid<2, 2>, BT = double, CT = double, int Bdim = 1, int Cdim = 1] /home/cocktail/usack/entwicklung/dune/ag-common/dune/ag-common/composedgridfunction.hh:21: note: ComposedGridFunction<Dune::ALUSimplexGrid<2, 2>, double, double, 1, 1>::ComposedGridFunction(const ComposedGridFunction<Dune::ALUSimplexGrid<2, 2>, double, double, 1, 1>&)
The same thing happens if I plug in a TestGridFunction2 object that derives from GridFunctionGlobalEvalDefault whereas it works well with a TestGridFunction that derives from GridFunctionDefault. ]