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

Dynamic .lookup("keyword") function

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 12, 2013, 14:18
Default Dynamic .lookup("keyword") function
  #1
Senior Member
 
Canakkale Dardanelspor
Join Date: Aug 2012
Posts: 135
Rep Power: 13
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
Senior Member
 
Canakkale Dardanelspor
Join Date: Aug 2012
Posts: 135
Rep Power: 13
HakikiCanakkaleli is on a distinguished road
Revealed that it is possible. :]
HakikiCanakkaleli is offline   Reply With Quote

Reply


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[snappyHexMesh] How to define to right point for locationInMesh Mirage12 OpenFOAM Meshing & Mesh Conversion 7 March 13, 2016 14:07
[blockMesh] non-orthogonal faces and incorrect orientation? nennbs OpenFOAM Meshing & Mesh Conversion 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 113 December 2, 2009 10:23
[OpenFOAM] LibvtkFoamso fred ParaView 2 November 18, 2005 19:01


All times are GMT -4. The time now is 17:29.