Register Blogs Members List Search Today's Posts Mark Forums Read

 April 3, 2014, 08:40 about volScalarField we used #1 Member   xuhe-openfoam Join Date: Aug 2013 Location: DaLian，china Posts: 82 Rep Power: 3 hello ! in the volFieldsFwd.H , there is: typedef GeometricField volScalarField; there are two "scalar" which are defined in the "scalar.H" as follows: Code: ```36 #ifndef scalar_H 37 #define scalar_H 38 39 #include "floatScalar.H" 40 #include "doubleScalar.H" 41 42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 43 44 #if defined(WM_SP) 45 46 // Define scalar as a float 47 48 namespace Foam 49 { 50 typedef floatScalar scalar; 51 52 static const scalar GREAT = floatScalarGREAT; 53 static const scalar VGREAT = floatScalarVGREAT; 54 static const scalar ROOTVGREAT = floatScalarROOTVGREAT; 55 static const scalar SMALL = floatScalarSMALL; 56 static const scalar VSMALL = floatScalarVSMALL; 57 static const scalar ROOTVSMALL = floatScalarROOTVSMALL; 58 59 scalar readScalar(Istream& is); 60 } 61 62 #elif defined(WM_DP) 63 64 // Define scalar as a double 65 66 namespace Foam 67 { 68 typedef doubleScalar scalar; 69 70 static const scalar GREAT = doubleScalarGREAT; 71 static const scalar VGREAT = doubleScalarVGREAT; 72 static const scalar ROOTVGREAT = doubleScalarROOTVGREAT; 73 static const scalar SMALL = doubleScalarSMALL; 74 static const scalar VSMALL = doubleScalarVSMALL; 75 static const scalar ROOTVSMALL = doubleScalarROOTVSMALL; 76 77 scalar readScalar(Istream& is); 78 } 79 80 #endif 81 82 83 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 84 85 #endif 86 87 // ************************************************************************* //``` I don't find any WM_SP or WM_DP is defined in the openfoam source code. Then I wonder which scalar is adopted when we use volScalarField to declare "p" in the "createFields.H" ? for example : volScalarField p ( IOobject ( "p", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); the floatScalar or the doubleScalar ? could you help me ? Thanks ！

 April 3, 2014, 08:43 #2 Senior Member   Alexey Matveichev Join Date: Aug 2011 Location: Nancy, France Posts: 1,089 Rep Power: 19 Hi, it is passed to the compiler like: Code: ```Making dependency list for source file aFile.C SOURCE=aFile.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unu ...``` it is defined in etc/bashrc Code: ```# WM_PRECISION_OPTION = DP | SP export WM_PRECISION_OPTION=DP``` bieshuxuhe likes this.

 April 3, 2014, 08:45 #3 Member   xuhe-openfoam Join Date: Aug 2013 Location: DaLian，china Posts: 82 Rep Power: 3 Thank you !!!

 Tags volscalarfield;scalar

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Tobi OpenFOAM Programming & Development 496 July 3, 2015 02:41 sharonyue OpenFOAM Programming & Development 4 April 2, 2014 05:44 ChrisA OpenFOAM Programming & Development 1 March 18, 2014 18:17 maybee OpenFOAM Programming & Development 2 February 18, 2014 16:43 immortality OpenFOAM Post-Processing 30 September 15, 2013 06:16

All times are GMT -4. The time now is 03:37.