CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

Reading a numbered selfmade dictionary

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

Reply
 
LinkBack Thread Tools Display Modes
Old   April 19, 2006, 10:05
Default Hi! I'm trying to write a pre
  #1
Senior Member
 
Francesco Del Citto
Join Date: Mar 2009
Location: Zürich Area, Switzerland
Posts: 214
Rep Power: 9
fra76 is on a distinguished road
Hi!
I'm trying to write a preprocessor utility to set a tensor field on some sub-sets of cells in the mesh.
I guess the best way to give input parameter is using a standard-shaped dictionary file, isn't it?
The dictionary I'd like to read is something like this:

/*---------------------------------------------------------------------------*\
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 1.0 |
| \ / A nd | Web: http://www.openfoam.org |
| \/ M anipulation | |
\*---------------------------------------------------------------------------*/

FoamFile
{
version 2.0;
format ascii;

root "";
case "";
instance "system";
local "";

class dictionary;
object setGDict;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

2
(
box1
{
box (-1 -2 -3) (1 2 3);
x_axes (0 1 0);
y_axes (1 0 0);
G_diag (1e3 1e6 1e6);
}

box2
{
box (-1 -2 -3) (1 2 3);
x_axes (0 0 1);
y_axes (1 0 0);
G_diag (1e3 1e6 1e6);
}

);


// ************************************************** *********************** //



So, I'd like to read the numer of boxes first ("2" in the example above) and then cycle on the entries. This should be more or less what OpenFOAM does while reading constant/polyMesh/boundary

What are the right classes that implements this feature? Where can I find an example, just to see how it works?
Thanks
Francesco
fra76 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
Dictionary maka OpenFOAM Bugs 3 February 18, 2009 11:26
RadialModel is undefined in dictionary mahaputra OpenFOAM Running, Solving & CFD 1 February 9, 2009 01:16
FunkySetFields dictionary gschaider OpenFOAM Running, Solving & CFD 14 December 3, 2008 22:13
RotateMesh Dictionary File titio OpenFOAM Mesh Utilities 2 March 12, 2008 11:15
Dictionary of fluid mechanics Lam Main CFD Forum 1 April 26, 2007 10:18


All times are GMT -4. The time now is 12:56.