|
[Sponsors] |
January 27, 2009, 13:31 |
Hi,
maybe there is a little
|
#1 |
Member
Luca M.
Join Date: Mar 2009
Location: Luzern, Switzerland
Posts: 59
Rep Power: 17 |
Hi,
maybe there is a little bug in fft.C file at line 52: the algorithm seems to check if the size of the field is a power of two. The source is written as if ((pow2 - int(pow2 + 0.5)) > SMALL) but should be: if (mag(pow2 - int(pow2 + 0.5)) > SMALL) or if (mag(pow2 - int(pow2)) > SMALL). The first one does not work. |
|
January 27, 2009, 14:03 |
Or maybe just check directly?
|
#2 |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40 |
Or maybe just check directly?
eg, // check for power of two unsigned int dimCount = nn[idim]; if (!dimCount || (dimCount & (dimCount - 1))) { error; } BTW: how often do people use ffts in OpenFOAM? I have a Singleton FFT kicking about (ie, http://www.netlib.org/go/ fft-olesen.tar.gz) that benchmarked quite well in the first FFTW roundup. With radix-4 or radix-8 data it gives good speedup, but also handles arbitrary data without padding [I used it for image processing]. The only issue I remember is that the NR routine (ie, the one in OpenFOAM) handles the scaling a bit different. Is there a bit enough call for FFTs, that it should be ported from the C version into usingthe OpenFOAM structures? Or would it be better (and easier) just to have FFTW as ThirdParty? |
|
January 27, 2009, 16:40 |
Yep checking directly is much
|
#3 |
Senior Member
Join Date: Mar 2009
Posts: 854
Rep Power: 22 |
Yep checking directly is much more sensible, I will push this change to OpenFOAM-1.5.x.
I don't think the FFT in OpenFOAM is used much; we only use it for noise analysis and we don't need it to be particularly efficient but it would be useful if it were more flexible, i.e. allowed arbitrary number of data in arbitrary dimensions. If yours can do this then it would be interesting to integrate it into OpenFOAM somehow. H |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Bugs in fvcsurfaceIntegrate | su_junwei | OpenFOAM Bugs | 4 | July 7, 2013 11:29 |
Wiki - Bugs | Andy R | Main CFD Forum | 0 | July 25, 2008 14:15 |
bugs in starcd 4.06 | whitemelon | Siemens | 0 | July 11, 2008 07:26 |
Bugs in polySplineEdgeC | kbr | OpenFOAM Bugs | 2 | June 6, 2008 14:04 |
starcd 3.24 has bugs? | whitemelon | Siemens | 6 | May 16, 2008 11:44 |