CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   read scalarListList from a subDictionary (https://www.cfd-online.com/Forums/openfoam-programming-development/156198-read-scalarlistlist-subdictionary.html)

huyidao July 5, 2015 09:38

read scalarListList from a subDictionary
 
Hello,everyone!
I want to read a scalarListList from a subDictionary of a dictionary ,it looks like this:
m1
{
a1
(
(1.0 2.0 3.0)
(2.0 4.0 5.0)
)
}

m2
{
a2
(
(7.0 8.0 9.0)
(9.0 2.0 6.0)
)
}
In which,m1 and m2 are the subdictionary and a1 a2 are the scalarListList.how can I do this,can anyone give me some advice?Thanks..

hk318i July 14, 2015 10:31

Try something like that,

Code:

a1 = List<scalarField> (dict.subDict("m1").lookup("a1"))
a2= List<scalarField> (dict.subDict("m2").lookup("a2"))



All times are GMT -4. The time now is 16:59.