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

Writing/Reading Field<Type> to/from Dictionary

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   January 19, 2012, 06:51
Default Writing/Reading Field<Type> to/from Dictionary
  #1
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Dear all,

I have a small problem with IO of Field<Type> to and from dictionaries. I have, say, a vectorField named k of size 50 and a dictionary named dict.

I add the field k to dict in a preprocessing program by

dict.add("waveNumber", k, true);

In the dictionary, I get the following:

waveNumber 50 ( (<vector0>) ... (<vector49>) );

However, because it does not look like

waveNumber nonuniform List<vector> 50 ( (<vector0>) ... (<vector49>) );

I cannot read the field into another program in the constructor with the command

k_("waveNumber", dict, 50 )

Adding "nonuniform List<vector>" by hand solves the problem.

My question is, how I can write the field in the correct way from the very start?

Thanks a lot for your help,

Niels
ngj is offline   Reply With Quote

 


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
writing subDict in a dictionary ubaid OpenFOAM Programming & Development 3 October 25, 2014 17:17
Doubt in term representation in the fvSchemes dictionary titio OpenFOAM Running, Solving & CFD 0 July 17, 2009 13:21
Reading from User Defined Dictionary File brosemu OpenFOAM Running, Solving & CFD 2 March 30, 2009 15:25
Problem with rhoSimpleFoam matteo_gautero OpenFOAM Running, Solving & CFD 0 February 28, 2008 06:51
FoamX error aachenBomb case Ervin Adorean (Adorean) OpenFOAM Pre-Processing 13 March 7, 2005 03:50


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