|
[Sponsors] |
dimensionedScalar Dimension setting in lookup |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 29, 2016, 09:51 |
dimensionedScalar Dimension setting in lookup
|
#1 |
Member
Muhammad Usman
Join Date: Feb 2014
Posts: 91
Rep Power: 0 |
In creatFields.H i want to specify dimensions of a specific variable which i am getting from controlDict using lookupOrDefault. But i am unable to set proper dimensions to the variable. what i did is
dimensionedScalar heightOfOrigin ( runTime.controlDict().lookup("heightOfOrigin"), dimensionSet( 0, 1, 0, 0, 0, 0, 0), ); But it gives me error. Please help me |
|
March 1, 2016, 03:38 |
|
#2 |
Senior Member
|
Hi,
Since you are constructing dimensionedScalar, use one of the constructors of the class (http://foam.sourceforge.net/docs/cpp/a00525.html) instead random attempts to guess the syntax: Code:
dimensionedScalar heightOfOrigin ( "heightOfOrigin", dimLength, readScalar(runTime.controlDict().lookup("heightOfOrigin")) ); Code:
dimensionedScalar heightOfOrigin ( "heightOfOrigin", dimLength, runTime.controlDict().lookupOrDefault<scalar>("heightOfOrigin", 0.0) ); Code:
dimensionedScalar heightOfOrigin(runTime.controlDict().lookup("heightOfOrigin")); |
|
March 1, 2016, 08:48 |
|
#3 |
Member
Muhammad Usman
Join Date: Feb 2014
Posts: 91
Rep Power: 0 |
Sir thank you i understand now. But please guide me how you get help from sourceforge???? the link you sent.
|
|
March 1, 2016, 08:56 |
|
#4 |
Member
Muhammad Usman
Join Date: Feb 2014
Posts: 91
Rep Power: 0 |
I am sorry i am a new member........ Learning......
|
|
February 21, 2022, 08:45 |
Error compiling lookup
|
#5 |
Member
Rosario Arnau
Join Date: Feb 2017
Location: Spain
Posts: 57
Rep Power: 9 |
Dear foamers,
We have a problem compiling a solver in v2006 that was previously compiled in v1806 version. This is the problem shown: Code:
createFields.H:247:1 warning 'Foam::dimensioned<Type>::dimensioned(Foam::Istream&) [with Type = double]' is depracted (declared at 7share/apps/OpenFOAM-v2006/src/OpenFOAM/lnInclude/dimensionedType.C:305): Since 2018-11 [-Wdeprecated-declarations] ); Code:
IOdictionary diffusionProperties ( IOobject ( "diffusionProperties", runTime.constant(), mesh, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); Info<< "Reading diffusivity DX\n" << endl; dimensionedScalar DX ( diffusionProperties.lookup("DX") ); |
|
February 21, 2022, 10:17 |
|
#6 | ||
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40 |
Quote:
As the message states it is a deprecation, which means that it not a compilation error, but a suggestion. The message furthermore states "deprecated since 2018-11", which is a clear indication why it compiled without warnings in v1806 but now starts emitting warnings with a new version. From the docs (https://www.openfoam.com/documentati...d.html#details) it states Quote:
Which further information should we provide??? |
|||
February 21, 2022, 12:22 |
|
#7 |
Member
Rosario Arnau
Join Date: Feb 2017
Location: Spain
Posts: 57
Rep Power: 9 |
Thanks olesen for your quick reply. I thought it was wrong in my code so it is enough to know that it is just a suggestion.
rarnaunot |
|
Tags |
lookup, lookupordefault |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
DPMFoam - Serious Error --particle-laden flow in simple geometric config | benz25 | OpenFOAM Running, Solving & CFD | 27 | December 19, 2017 21:47 |
[snappyHexMesh] determining displacement for added points | CFDnewbie147 | OpenFOAM Meshing & Mesh Conversion | 1 | October 22, 2013 10:53 |
Convergence on anisotropic tetahedral meshes | pbo | OpenFOAM Running, Solving & CFD | 12 | December 14, 2010 12:59 |
Cells with t below lower limit | Purushothama | Siemens | 2 | May 31, 2010 22:58 |
Warning 097- | AB | Siemens | 6 | November 15, 2004 05:41 |