mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge remote-tracking branch 'origin/master' into develop
This commit is contained in:
@ -51,7 +51,7 @@ void test(const Type& polynomialEqn, const scalar tol)
|
||||
case roots::real:
|
||||
v[i] = polynomialEqn.value(r[i]);
|
||||
e[i] = polynomialEqn.error(r[i]);
|
||||
ok = ok && mag(v[i]) < tol*mag(e[i]);
|
||||
ok = ok && mag(v[i]) <= tol*mag(e[i]);
|
||||
break;
|
||||
case roots::posInf:
|
||||
v[i] = + inf;
|
||||
@ -79,8 +79,10 @@ void test(const Type& polynomialEqn, const scalar tol)
|
||||
|
||||
int main()
|
||||
{
|
||||
const int nTests = 1000000;
|
||||
for (int t = 0; t < nTests; ++ t)
|
||||
const scalar tol = 5;
|
||||
|
||||
const label nTests = 1000000;
|
||||
for (label t = 0; t < nTests; ++ t)
|
||||
{
|
||||
test
|
||||
(
|
||||
@ -91,11 +93,26 @@ int main()
|
||||
randomScalar(1e-50, 1e+50),
|
||||
randomScalar(1e-50, 1e+50)
|
||||
),
|
||||
100
|
||||
tol
|
||||
);
|
||||
}
|
||||
Info << nTests << " random cubics tested" << endl;
|
||||
|
||||
Info << nTests << " cubics tested" << endl;
|
||||
const label coeffMin = -9, coeffMax = 10, nCoeff = coeffMax - coeffMin;
|
||||
for (label a = coeffMin; a < coeffMax; ++ a)
|
||||
{
|
||||
for (label b = coeffMin; b < coeffMax; ++ b)
|
||||
{
|
||||
for (label c = coeffMin; c < coeffMax; ++ c)
|
||||
{
|
||||
for (label d = coeffMin; d < coeffMax; ++ d)
|
||||
{
|
||||
test(cubicEqn(a, b, c, d), tol);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Info<< nCoeff*nCoeff*nCoeff*nCoeff << " integer cubics tested" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1,12 +1,13 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments # (for error catching)
|
||||
. $WM_PROJECT_DIR/wmake/scripts/have_fftw
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
if have_fftw
|
||||
then
|
||||
wmake
|
||||
wmake $targetType
|
||||
else
|
||||
echo "==> skip noise utility (no FFTW)"
|
||||
fi
|
||||
|
||||
@ -1,12 +1,13 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments # (for error catching)
|
||||
. $WM_PROJECT_DIR/wmake/scripts/have_fftw
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
if have_fftw
|
||||
then
|
||||
wmake
|
||||
wmake $targetType
|
||||
else
|
||||
echo "==> skip boxTurb utility (no FFTW)"
|
||||
fi
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments # (for error catching)
|
||||
. $WM_PROJECT_DIR/wmake/scripts/have_cgal
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
@ -14,6 +15,6 @@ else
|
||||
export COMP_FLAGS="-DNO_CGAL"
|
||||
fi
|
||||
|
||||
wmake
|
||||
wmake $targetType
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user