View Issue Details

IDProjectCategoryView StatusLast Update
0001496OpenFOAM[All Projects] Bugpublic2015-01-23 13:11
Reporteruser1068Assigned Tohenry 
PriorityhighSeveritymajorReproducibilityhave not tried
Status resolvedResolutionfixed 
PlatformSGIOSLinux SUSEOS VersionSLES11 Sp3
Product Version 
Fixed in Version 
Summary0001496: Single precision compilation error
DescriptionA source file fails to compile under single precision but passes under double precision. The detail is as follows:

SOURCE=derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C ; g++ -m64 -Dlinux64 -DWM_SP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-100 -I/store/ayad/OpenFOAM/OpenFOAM-SGISLES11SP3-2.3.X_X8664_GCC49_16JAN15_REPO/OpenFOAM-2.3.x/src/finiteVolume/lnInclude -I/store/ayad/OpenFOAM/OpenFOAM-SGISLES11SP3-2.3.X_X8664_GCC49_16JAN15_REPO/OpenFOAM-2.3.x/src/turbulenceModels -I/store/ayad/OpenFOAM/OpenFOAM-SGISLES11SP3-2.3.X_X8664_GCC49_16JAN15_REPO/OpenFOAM-2.3.x/src/transportModels -IlnInclude -I. -I/store/ayad/OpenFOAM/OpenFOAM-SGISLES11SP3-2.3.X_X8664_GCC49_16JAN15_REPO/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude -I/store/ayad/OpenFOAM/OpenFOAM-SGISLES11SP3-2.3.X_X8664_GCC49_16JAN15_REPO/OpenFOAM-2.3.x/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64Gcc49SPOpt/atmBoundaryLayerInletVelocityFvPatchVectorField.o
derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C: In constructor âFoam::incompressible::atmBoundaryLayerInletVelocityFvPatchVectorField::atmBoundaryLayerInletVelocityFvPatchVectorField(const Foam::fvPatch&, const Foam::DimensionedField<Foam::Vector<float>, Foam::volMesh>&, const Foam::dictionary&)â:
derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C:118:60: error: no matching function for call to âmax(Foam::scalarField&, double)â
     Ustar_ = kappa_*Uref_/(log((Zref_ + z0_)/max(z0_, 0.001)));
                                                            ^
derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C:118:60: note: candidates are:
In file included from /store/ayad/OpenFOAM/OpenFOAM-SGISLES11SP3-2.3.X_X8664_GCC49_16JAN15_REPO/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude/UList.H:46:0,
                 from /store/ayad/OpenFOAM/OpenFOAM-SGISLES11SP3-2.3.X_X8664_GCC49_16JAN15_REPO/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude/List.H:43,
                 from /store/ayad/OpenFOAM/OpenFOAM-SGISLES11SP3-2.3.X_X8664_GCC49_16JAN15_REPO/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude/wordList.H:42,
                 from /store/ayad/OpenFOAM/OpenFOAM-SGISLES11SP3-2.3.X_X8664_GCC49_16JAN15_REPO/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude/patchIdentifier.H:38,
...
...
and so on ...


Note that Mattijs Janssen has suggested the following fix:

change the corresponding line from

    max(z0_, 0.001)

to

    max(z0_, scalar(0.001))

Implementing the above suggested fix in four source files
resulted in successful compilation of the full source.

Note that my 2.3.x source was based on a a git made on 16 Jan 2015
Steps To ReproduceSimply compile these source files (containing the above constructs)
under single precision
TagsNo tags attached.

Activities

henry

2015-01-23 13:11

manager   ~0003578

Resolved by commit 1f2f89f7c8168da7e6f5532539616d7a2ded9f3b

Issue History

Date Modified Username Field Change
2015-01-23 10:55 user1068 New Issue
2015-01-23 13:11 henry Note Added: 0003578
2015-01-23 13:11 henry Status new => resolved
2015-01-23 13:11 henry Resolution open => fixed
2015-01-23 13:11 henry Assigned To => henry