/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright held by original author \\/ M anipulation | ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Application foamToVTK Description Legacy VTK file format writer. - handles volScalar, volVector, pointScalar, pointVector, surfaceScalar fields. - mesh topo changes. - both ascii and binary. - single time step writing. - write subset only. - automatic decomposition of cells; polygons on boundary undecomposed since handled by vtk. Usage - foamToVTK [OPTION] @param -ascii \n Write VTK data in ASCII format instead of binary. @param -mesh \\n Use a different mesh name (instead of -region) @param -fields \\n Convert selected fields only. For example, @verbatim -fields "( p T U )" @endverbatim The quoting is required to avoid shell expansions and to pass the information as a single argument. @param -surfaceFields \n Write surfaceScalarFields (e.g., phi) @param -cellSet \\n @param -faceSet \\n @param -pointSet \\n Restrict conversion to the cellSet, faceSet or pointSet. @param -nearCellValue \n Output cell value on patches instead of patch value itself @param -noInternal \n Do not generate file for mesh, only for patches @param -noPointValues \n No pointFields @param -noFaceZones \n No faceZones @param -noLinks \n (in parallel) do not link processor files to master @param -allPatches \n Combine all patches into a single file @param -excludePatches \\n Specify patches to exclude. For example, @verbatim -excludePatches "( inlet_1 inlet_2 )" @endverbatim The quoting is required to avoid shell expansions and to pass the information as a single argument. @param -faMesh \n Write finite area mesh and fields Note mesh subset is handled by vtkMesh. Slight inconsistency in interpolation: on the internal field it interpolates the whole volfield to the whole-mesh pointField and then selects only those values it needs for the subMesh (using the fvMeshSubset cellMap(), pointMap() functions). For the patches however it uses the fvMeshSubset.interpolate function to directly interpolate the whole-mesh values onto the subset patch. Note new file format: \n no automatic timestep recognition. However can have .pvd file format which refers to time simulation if XML *.vtu files are available: @verbatim @endverbatim \*---------------------------------------------------------------------------*/ #include "fvCFD.H" #include "pointMesh.H" #include "volPointInterpolation.H" #include "emptyPolyPatch.H" #include "labelIOField.H" #include "scalarIOField.H" #include "sphericalTensorIOField.H" #include "symmTensorIOField.H" #include "tensorIOField.H" #include "faceZoneMesh.H" #include "Cloud.H" #include "passiveParticle.H" #include "faCFD.H" #include "vtkMesh.H" #include "readFields.H" #include "writeFuns.H" #include "internalWriter.H" #include "patchWriter.H" #include "faMeshWriter.H" #include "lagrangianWriter.H" #include "writeFaceSet.H" #include "writePointSet.H" #include "writePatchGeom.H" #include "writeSurfFields.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // static const label VTK_TETRA = 10; static const label VTK_PYRAMID = 14; static const label VTK_WEDGE = 13; static const label VTK_HEXAHEDRON = 12; template void print(const char* msg, Ostream& os, const PtrList& flds) { if (flds.size()) { os << msg; forAll(flds, i) { os<< ' ' << flds[i].name(); } os << endl; } } void print(Ostream& os, const wordList& flds) { forAll(flds, i) { os<< ' ' << flds[i]; } os << endl; } labelList getSelectedPatches ( const polyBoundaryMesh& patches, const HashSet& excludePatches ) { DynamicList