1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend 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 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
27 \*---------------------------------------------------------------------------*/
29 #ifndef vtkPV3FoamUpdateInfoFields_H
30 #define vtkPV3FoamUpdateInfoFields_H
32 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34 template<template<class> class patchType, class meshType>
35 void Foam::vtkPV3Foam::updateInfoFields
37 vtkDataArraySelection *select
42 Info<< "<beg> Foam::vtkPV3Foam::updateInfoFields <"
43 << meshType::Mesh::typeName
44 << "> [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]"
48 stringList enabledEntries;
49 // enable 'p' and 'U' on the first call
50 if (select->GetNumberOfArrays() == 0 && !meshPtr_)
52 enabledEntries.setSize(2);
53 enabledEntries[0] = "p";
54 enabledEntries[1] = "U";
58 // preserve the enabled selections
59 enabledEntries = getSelectedArrayEntries(select);
62 select->RemoveAllArrays();
64 // use the db directly since this might be called without a mesh,
65 // but the region must get added back in
67 if (meshRegion_ != polyMesh::defaultRegion)
69 regionPrefix = meshRegion_;
72 // Search for list of objects for this time and mesh region
73 IOobjectList objects(dbPtr_(), dbPtr_().timeName(), regionPrefix);
75 //- Add volume fields to GUI
76 addToSelection<GeometricField<scalar, patchType, meshType> >
81 addToSelection<GeometricField<vector, patchType, meshType> >
86 addToSelection<GeometricField<sphericalTensor, patchType, meshType> >
91 addToSelection<GeometricField<symmTensor, patchType, meshType> >
96 addToSelection<GeometricField<tensor, patchType, meshType> >
102 // restore the enabled selections
103 setSelectedArrayEntries(select, enabledEntries);
107 Info<< "<end> Foam::vtkPV3Foam::updateInfoFields" << endl;
111 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
114 // ************************************************************************* //