1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 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, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 \*---------------------------------------------------------------------------*/
30 #ifndef vtkPV3FoamUpdateInfoFields_H
31 #define vtkPV3FoamUpdateInfoFields_H
33 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
35 template<template<class> class patchType, class meshType>
36 void Foam::vtkPV3Foam::updateInfoFields
38 vtkDataArraySelection *select
43 Info<< "<beg> Foam::vtkPV3Foam::updateInfoFields <"
44 << meshType::Mesh::typeName
45 << "> [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]"
49 stringList enabledEntries;
50 // enable 'p' and 'U' on the first call
51 if (select->GetNumberOfArrays() == 0 && !meshPtr_)
53 enabledEntries.setSize(2);
54 enabledEntries[0] = "p";
55 enabledEntries[1] = "U";
59 // preserve the enabled selections
60 enabledEntries = getSelectedArrayEntries(select);
63 select->RemoveAllArrays();
65 // use the db directly since this might be called without a mesh,
66 // but the region must get added back in
68 if (meshRegion_ != polyMesh::defaultRegion)
70 regionPrefix = meshRegion_;
73 // Search for list of objects for this time and mesh region
74 IOobjectList objects(dbPtr_(), dbPtr_().timeName(), regionPrefix);
76 //- Add volume fields to GUI
77 addToSelection<GeometricField<scalar, patchType, meshType> >
82 addToSelection<GeometricField<vector, patchType, meshType> >
87 addToSelection<GeometricField<sphericalTensor, patchType, meshType> >
92 addToSelection<GeometricField<symmTensor, patchType, meshType> >
97 addToSelection<GeometricField<tensor, patchType, meshType> >
103 // restore the enabled selections
104 setSelectedArrayEntries(select, enabledEntries);
108 Info<< "<end> Foam::vtkPV3Foam::updateInfoFields" << endl;
112 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115 // ************************************************************************* //