I just changed the sqrt calls in the shape function evaluation to
constants... As for pow... We might be able to do better than that.
In particular, pow is not particularly smart & does not make
optimizations where possible.
Help me out here, John... Do you remeber that C++ User's Journal on
scientific programming? I think in near the end of that they describe a
templated pow function that hadles x^int cases intelligently through
repeated squaring... Does that ring a bell? It might be worth having
In the mean time I have added inline pow2, pow3, pow4, pow5 functions in
that file. Test it out and let me know if it is fastest (in optimized
mode) than the old implementation. Of course, make sure the answers are
still the same!
Finally, I changed all the tests that look like (a != min(a,b)) to (a>b)
I realize that the former is the test I put in the hierarchic
implementation... What was I thinking? That code is *really* messy in
3D... I need to look at it again.
Daniel Dreyer wrote:
> On Sat, 7 Feb 2004, Benjamin S. Kirk wrote:
>>Thanks for the prompt on this!
>>Many of the changes in CVS simply changed "Copyright 2002-2003" with
>>However, there are a number of other functional changes as well. I
>>guess I can put together an official release this week (comments from
>>the devel list?). The biggest job in creating an "official" release is
>>in testing the code on all the machines I have access to, and testing
>>various configuration options.
>>I'll try to release 0.4.2 this week if there are no complaints from the
> The Szabo-Babuska shape functions are fully functional, and
> they can already be used. However, they are not yet _truly_
> good: only the 1D shapes are coded in Horner scheme.
> The 2D shapes, honestly, aren't perfect (yet): many
> calls to sqrt(), pow(x,n) with n even 5 or so...
> That means: the 2D shapes (namely only on TRI6) may be prone
> to cancellation issues, and very likely slow!
> I'd suggest to:
> - either change everything _prior_ to releasing 0.4.2,
> namely all the sqrt to evaluated floats, and the
> pow's to horner-like. Since Steffen/Hendrik did these shapes,
> i'd suggest they work on that. They have to say how long
> this may take.
> - or postpone this to 0.4.3, and put some comment in the release text
> that says something like "SZABAB is functional (compiles fine), however
> not really finished".
> Either way, i suggest that the pows and sqrts should go sooner
> or later, either before or after 0.4.2.
> -- Sorry for being that pedantic, but since libmesh is
> open source, we better have an eye on the quality of
> the code.