|
[Sponsors] |
April 3, 2014, 09:40 |
about volScalarField we used
|
#1 |
Member
xuhe-openfoam
Join Date: Aug 2013
Location: DaLian,china
Posts: 82
Rep Power: 13 |
hello !
in the volFieldsFwd.H , there is: typedef GeometricField<scalar, fvPatchField, volMesh> 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 // ************************************************************************* // 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, 09:43 |
|
#2 |
Senior Member
|
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 ... Code:
# WM_PRECISION_OPTION = DP | SP export WM_PRECISION_OPTION=DP |
|
April 3, 2014, 09:45 |
|
#3 |
Member
xuhe-openfoam
Join Date: Aug 2013
Location: DaLian,china
Posts: 82
Rep Power: 13 |
Thank you !!!
|
|
Tags |
volscalarfield;scalar |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[openSmoke] libOpenSMOKE | Tobi | OpenFOAM Community Contributions | 562 | January 25, 2023 10:21 |
make a dimensionedScalar to be volScalarField | sharonyue | OpenFOAM Programming & Development | 4 | April 2, 2014 06:44 |
Boundary condition cannot find volScalarField | ChrisA | OpenFOAM Programming & Development | 1 | March 18, 2014 18:17 |
multiplicate all elements of volScalarField with scalar to get new volScalarField | maybee | OpenFOAM Programming & Development | 2 | February 18, 2014 16:43 |
writing execFlowFunctionObjects | immortality | OpenFOAM Post-Processing | 30 | September 15, 2013 07:16 |