CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Reading a numbered selfmade dictionary (http://www.cfd-online.com/Forums/openfoam-solving/60245-reading-numbered-selfmade-dictionary.html)

fra76 April 19, 2006 10:05

Hi! I'm trying to write a pre
 
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


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