MomentumExchangeBounceBack and float


The MomentumExchangeBounceBack boundary condition doesn’t compile, when T is defined as any other than ‘double’.
The error message is: “cannot allocate an object of abstract type…”

I think the reason is that in its class MomentumExchangeBounceBack the virtual function in Dynamics

virtual void rescale(std::vector& rawData, T xDxInv, T xDt, plint order) const =0;

is redeclared here with

virtual void rescale(std::vector& rawData, double xDxInv, double xDt, plint order) const;

If I use T instead of double it works. Or is there another reason, why in this function the accuracy is fixed to double?

btw: I use version 1.0r0



Thanks a lot for this useful bug report. You are right: the “double” keyword must be replaced by “T” twice, in the declaration and in the definition. The bug fix will be available in the next release and, in the meantime, can easily be changed manually by anybody using MomentumExchangeBounceBack with float (needs to be changed in both bounceBackModels.h and bounceBackModels.hh).


Great, Thank you!