[Dune-devel] [PATCH] Use unqualified calls to allow ADL.

Atgeirr Rasmussen Atgeirr.Rasmussen at sintef.no
Thu Sep 3 13:10:04 CEST 2015


2. sep. 2015 kl. 10.48 skrev Christian Engwer <christi at mathe-macht-spass.de<mailto:christi at mathe-macht-spass.de>>:

Dear Atgeirr,

now I understand the misunderstanding.

The idea was never to specialize the fvmeta functions. These functions
use internally standard math functions and these again can be
overloaded via ADL.

I adopted your example in the way we intended it, see the attached
file.

You specialized absreal, but you would have had to specialize abs.

Dear Christian,

Thank you for your explanation, I have tested this and think it can work,
so consider this patch withdrawn. In our case the abs() function does not
return a double, but an Evaluation object, so to make things work we have
to set real_type to Evaluation. Do you see any pitfalls with this? It is not always
easy to tell what a particular type name is supposed to be used for: at least
real_type is used for the return value of math functions like abs(), sqrt() and also
for norms. For those uses I think the model supports our Evaluation class well
enough (we should return Evaluation from all those functions).

Part of the confusion on my part was due to the fact that the ADL-enabling call
to abs() is a very recent change to Dune, and until recently I was using the
2.3 branch. Happy to see it in 2.4!

Atgeirr

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune-devel/attachments/20150903/bf6d631a/attachment.htm>


More information about the Dune-devel mailing list