OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

getFieldNames.H

Go to the documentation of this file.
00001 HashSet<word> volScalarHash;
00002 HashSet<word> volVectorHash;
00003 HashSet<word> surfScalarHash;
00004 HashSet<word> surfVectorHash;
00005 HashSet<word> sprayScalarHash;
00006 HashSet<word> sprayVectorHash;
00007 
00008 forAll(timeDirs, timeI)
00009 {
00010     runTime.setTime(timeDirs[timeI], timeI);
00011 
00012     // Add all fields to hashtable
00013     IOobjectList objects(mesh, runTime.timeName());
00014     {
00015         wordList fieldNames(objects.names(volScalarField::typeName));
00016         forAll(fieldNames, fieldI)
00017         {
00018             volScalarHash.insert(fieldNames[fieldI]);
00019         }
00020     }
00021     {
00022         wordList fieldNames(objects.names(volVectorField::typeName));
00023         forAll(fieldNames, fieldI)
00024         {
00025             volVectorHash.insert(fieldNames[fieldI]);
00026         }
00027     }
00028     {
00029         wordList fieldNames(objects.names(surfaceScalarField::typeName));
00030         forAll(fieldNames, fieldI)
00031         {
00032             surfScalarHash.insert(fieldNames[fieldI]);
00033         }
00034     }
00035     {
00036         wordList fieldNames(objects.names(surfaceVectorField::typeName));
00037         forAll(fieldNames, fieldI)
00038         {
00039             surfVectorHash.insert(fieldNames[fieldI]);
00040         }
00041     }
00042 
00043 
00044     // Same for spray
00045     IOobjectList sprayObjects(mesh, runTime.timeName(), cloud::prefix);
00046     {
00047         wordList fieldNames(sprayObjects.names(scalarIOField::typeName));
00048         forAll(fieldNames, fieldI)
00049         {
00050             sprayScalarHash.insert(fieldNames[fieldI]);
00051         }
00052     }
00053     {
00054         wordList fieldNames(sprayObjects.names(vectorIOField::typeName));
00055         forAll(fieldNames, fieldI)
00056         {
00057             sprayVectorHash.insert(fieldNames[fieldI]);
00058         }
00059     }
00060 }
00061 
00062 
00063 wordList volScalarNames(volScalarHash.toc());
00064 wordList volVectorNames(volVectorHash.toc());
00065 wordList surfScalarNames(surfScalarHash.toc());
00066 wordList surfVectorNames(surfVectorHash.toc());
00067 wordList sprayScalarNames(sprayScalarHash.toc());
00068 wordList sprayVectorNames(sprayVectorHash.toc());
Copyright © 2000-2009 OpenCFD Ltd