rawSurfaceWriter.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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
19  for more details.
20 
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/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "rawSurfaceWriter.H"
27 #include "OFstream.H"
28 #include "OSspecific.H"
29 #include "primitivePatch.H"
31 
32 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33 
34 namespace Foam
35 {
38 }
39 
40 
41 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
42 
44 {}
45 
46 
47 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
48 
50 (
51  const fileName& outputDir,
52  const fileName& surfaceName,
53  const pointField& points,
54  const faceList& faces,
55  const wordList& fieldNames,
56  const bool writePointValues
57  #define FieldTypeValuesConstArg(Type, nullArg) \
58  , const UPtrList<const Field<Type>>& field##Type##Values
61 ) const
62 {
63  const primitivePatch patch(SubList<face>(faces, faces.size()), points);
64 
65  const coordSet set
66  (
67  false,
68  writePointValues ? "point" : "face",
69  writePointValues ? patch.points() : patch.faceCentres()
70  );
71 
72  rawSetWriter(writeFormat_, writeCompression_).write
73  (
74  outputDir,
75  surfaceName,
76  set,
78  #define FieldTypeValuesParameter(Type, nullArg) , field##Type##Values
81  );
82 }
83 
84 
85 // ************************************************************************* //
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
Macros for easy insertion into run-time selection tables.
void size(const label)
Override size to be inconsistent with allocated storage.
Definition: ListI.H:164
A list of faces which address into the list of points.
const Field< PointType > & points() const
Return reference to global points.
const Field< PointType > & faceCentres() const
Return face centres for patch.
A List obtained as a section of another List.
Definition: SubList.H:56
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: UPtrList.H:66
Holds list of sampling positions.
Definition: coordSet.H:51
A class for handling file names.
Definition: fileName.H:82
Write set in raw tabulated format.
Definition: rawSetWriter.H:51
virtual void write(const fileName &outputDir, const fileName &setName, const coordSet &set, const wordList &valueSetNames #define TypeValueSetsConstArg(Type, nullArg)) const
Write a coordSet and associated data.
Definition: rawSetWriter.C:90
A surfaceWriter for raw output.
virtual void write(const fileName &outputDir, const fileName &surfaceName, const pointField &points, const faceList &faces, const wordList &fieldNames, const bool writePointValues #define FieldTypeValuesConstArg(Type, nullArg)) const
Write fields for a single surface to file.
virtual ~rawSurfaceWriter()
Destructor.
Base class for surface writers.
Definition: surfaceWriter.H:55
A class for handling words, derived from string.
Definition: word.H:62
static List< word > fieldNames
Definition: globalFoam.H:46
const pointField & points
Namespace for OpenFOAM.
FOR_ALL_FIELD_TYPES(DefineContiguousFvWallLocationDataType)
defineTypeNameAndDebug(combustionModel, 0)
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
#define FieldTypeValuesConstArg(Type, nullArg)
#define FieldTypeValuesParameter(Type, nullArg)