ensightOutputSurface.C
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2020 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26\*---------------------------------------------------------------------------*/
27
29#include "ensightOutput.H"
30
31// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32
34(
35 const pointField& points,
36 const faceList& faces,
37 const string& description
38)
39:
40 ensightFaces(description),
41 points_(points),
42 faces_(faces)
43{
44 // Classify face types
45 classify(faces);
46}
47
48
49// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
50
52{
53 if (!total())
54 {
55 return;
56 }
57
58 // Coordinates
60 (
61 os,
62 index(),
63 name(),
64 points_.size(),
65 points_,
66 false // serial
67 );
68
69 // Faces
71 (
72 os,
73 *this,
74 faces_,
75 false // serial
76 );
77}
78
79
80// ************************************************************************* //
Sorting/classification of faces (2D) into corresponding ensight types.
Definition: ensightFaces.H:75
void classify(const UList< face > &faces)
Classify the face types and set the element lists.
Definition: ensightFaces.C:219
Specialized Ensight output with extra geometry file header.
A variant of ensightFaces that holds references to contiguous points/faces with its own encapsulated ...
virtual bool write()
Write the output fields.
OBJstream os(runTime.globalPath()/outputName)
const pointField & points
bool writeCoordinates(ensightGeoFile &os, const label partId, const word &partName, const label nPoints, const FieldContainer< Foam::point > &fld, bool parallel)
Write coordinates (component-wise) for the given part.
void writeFaceConnectivity(ensightGeoFile &os, const ensightFaces::elemType etype, const label nTotal, const UIndirectList< face > &faces, bool parallel)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59