CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

Dynamic .lookup("keyword") function

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

Reply
 
LinkBack Thread Tools Display Modes
Old   July 12, 2013, 14:18
Default Dynamic .lookup("keyword") function
  #1
Member
 
Join Date: Aug 2012
Posts: 74
Rep Power: 5
HakikiCanakkaleli is on a distinguished road
Hi,

== 1 ==
Is it possible to have an array type, dynamically changing "keyword" entry for the "Dictionary lookup"?

e.g.

Code:
class object(dict.lookup("keyword"));
== 2 ==
I would like to look up multiple keywords in a dictionary. So, I made the following:

Code:
const label arraySizeName = 1000; 
word names[arraySizeName];
const word fileName = "radius";

for (label k = 0; k < 10; k++)
{

names[k] = fileName+name(k);
const scalar a(readScalar(dict.lookup(names[k])));

}
So, I did not put the ditto marks of "keyword".

== 3 ==

I compiled it and it did not give any errors. But, for some arbitrary reason, I cannot test it whether it works well or not.

I appreciate any comment.

Many thanks in advance.
HakikiCanakkaleli is offline   Reply With Quote

Old   July 12, 2013, 15:56
Default
  #2
Member
 
Join Date: Aug 2012
Posts: 74
Rep Power: 5
HakikiCanakkaleli is on a distinguished road
Revealed that it is possible. :]
HakikiCanakkaleli is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to define to right point for locationInMesh Mirage12 OpenFOAM Native Meshers: snappyHexMesh and Others 4 April 10, 2014 10:12
non-orthogonal faces and incorrect orientation? nennbs OpenFOAM Native Meshers: blockMesh 7 April 17, 2013 05:42
dynamic viskosity field function jarry STAR-CCM+ 2 August 18, 2010 04:53
Version 15 on Mac OS X gschaider OpenFOAM Installation 120 December 2, 2009 11:23
LibvtkFoamso fred OpenFOAM Paraview & paraFoam 2 November 18, 2005 20:01


All times are GMT -4. The time now is 18:52.