1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 #include "sampledSurfaces.H"
27 #include "volFields.H"
28 #include "IOobjectList.H"
29 #include "stringListOps.H"
31 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
33 void Foam::sampledSurfaces::clearFieldGroups()
35 scalarFields_.clear();
36 vectorFields_.clear();
37 sphericalTensorFields_.clear();
38 symmTensorFields_.clear();
39 tensorFields_.clear();
43 Foam::label Foam::sampledSurfaces::appendFieldGroup
45 const word& fieldName,
49 if (fieldType == volScalarField::typeName)
51 scalarFields_.append(fieldName);
54 else if (fieldType == volVectorField::typeName)
56 vectorFields_.append(fieldName);
59 else if (fieldType == volSphericalTensorField::typeName)
61 sphericalTensorFields_.append(fieldName);
64 else if (fieldType == volSymmTensorField::typeName)
66 symmTensorFields_.append(fieldName);
69 else if (fieldType == volTensorField::typeName)
71 tensorFields_.append(fieldName);
79 Foam::label Foam::sampledSurfaces::classifyFields()
84 // check files for a particular time
87 IOobjectList objects(mesh_, mesh_.time().timeName());
88 wordList allFields = objects.sortedNames();
90 labelList indices = findStrings(fieldSelection_, allFields);
92 forAll(indices, fieldI)
94 const word& fieldName = allFields[indices[fieldI]];
96 nFields += appendFieldGroup
99 objects.find(fieldName)()->headerClassName()
105 wordList allFields = mesh_.sortedNames();
106 labelList indices = findStrings(fieldSelection_, allFields);
108 forAll(indices, fieldI)
110 const word& fieldName = allFields[indices[fieldI]];
112 nFields += appendFieldGroup
115 mesh_.find(fieldName)()->type()
124 // ************************************************************************* //