mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Improved the test for the pow-of-2 constraint from Mark's recommendation.
This commit is contained in:
@ -48,8 +48,9 @@ void fft::transform
|
|||||||
{
|
{
|
||||||
forAll(nn, idim)
|
forAll(nn, idim)
|
||||||
{
|
{
|
||||||
scalar pow2 = log(scalar(nn[idim]))/log(scalar(2));
|
// Check for power of two
|
||||||
if ((pow2 - int(pow2 + 0.5)) > SMALL)
|
unsigned int dimCount = nn[idim];
|
||||||
|
if (!dimCount || (dimCount & (dimCount - 1)))
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
|
|||||||
Reference in New Issue
Block a user