|
[Sponsors] |
warning: ‘Foam::dimensioned<Type>::dimensioned(Foam::Istrea m&) [with Type = double]’ |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 11, 2023, 01:28 |
warning: ‘Foam::dimensioned<Type>::dimensioned(Foam::Istrea m&) [with Type = double]’
|
#1 |
New Member
Join Date: Apr 2023
Posts: 11
Rep Power: 3 |
Hi
Wish you a nice day! Sorry to bother you, this is solved. The warning happens due to the syntax is different for the latest OpenFOAM version. The current syntax should goes like this: Code:
dimensionedScalar rho3("rho3",transportProperties); Question from newbe me before: ------------------------------------------------------------ There is a warning info when I try to compile a solver. HTML Code:
readTransportProperties.H: In function ‘int main(int, char**)’:
readTransportProperties.H:18:5: warning: ‘Foam::dimensioned<Type>::dimensioned(Foam::Istream&) [with Type = double]’ is deprecated: Since 2018-11 [-Wdeprecated-declarations]
18 | );
| ^
Here is the "readTranspotProperties.H" Code:
IOdictionary transportProperties ( IOobject ( "transportProperties", runTime.constant(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE ) ); dimensionedScalar rho3 ( transportProperties.lookup("rho3") ); Does anyone have an idea about how to debug the warning? Thank you very much for your kindness and patience. Ary Last edited by Ary; April 12, 2023 at 05:56. Reason: SOLVED |
|
April 13, 2023, 16:36 |
|
#2 |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,684
Rep Power: 40 |
The dictionary "lookup" method returns a stream of tokens. If you construct from that, the constructor will use as many tokens as needed. This works fine, so you can simply ignore the compilation warnings.
However, consider the following example: Code:
nu nu [ 0 2 -1 0 0 0 0 ] 1e-05 enabled true; nu0 nu0 [ 0 2 -1 0 0 0 0 ] 1e-06 Code:
nu nu [ 0 2 -1 0 0 0 0 ] 1e-05 enabled true; nu0 nu0 [ 0 2 -1 0 0 0 0 ] 1e-06; If you use the lookup syntax, you are less likely to notice your bad input. In this case, you thought you had an "enabled" entry, but it's just some trailing rubbish on the "nu" entry. Much better to have the bad input flagged immediately instead of waiting a day for the simulation to run and not even realise that the "enabled" wasn't actually seen. |
|
April 23, 2023, 23:00 |
|
#3 |
New Member
Join Date: Apr 2023
Posts: 11
Rep Power: 3 |
Dear Olesen,
Thank you so much for the introduction. There are so many details for me to learn. Thank you! Ary |
|
Tags |
#openfoam #debug |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
foamToTecplot360 | thomasduerr | OpenFOAM Post-Processing | 121 | June 11, 2021 10:05 |
[OpenFOAM.org] compile error in dynamicMesh and thermophysicalModels libraries | NickG | OpenFOAM Installation | 3 | December 30, 2019 00:21 |
time step continuity problem in VAWT simulation | lpz_michele | OpenFOAM Running, Solving & CFD | 5 | February 22, 2018 19:50 |
rhoPimpleFoam hardship | petrus | OpenFOAM Running, Solving & CFD | 0 | October 7, 2016 02:41 |
[swak4Foam] installation problem with version 0.2.3 | Claudio87 | OpenFOAM Community Contributions | 9 | May 8, 2013 10:20 |