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 -------------------------------------------------------------------------------
10 License
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 
28 #include "ensightOutputSurface.H"
29 #include "ensightOutput.H"
30 
31 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32 
33 Foam::ensightOutputSurface::ensightOutputSurface
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 // ************************************************************************* //
Foam::ensightPart::index
label index() const noexcept
Definition: ensightPart.H:120
Foam::ensightFaces
Sorting/classification of faces (2D) into corresponding ensight types.
Definition: ensightFaces.H:65
Foam::ensightFaces::total
label total() const
Definition: ensightFaces.C:129
Foam::ensightOutput::writeFaceConnectivity
void writeFaceConnectivity(ensightGeoFile &os, const ensightFaces::elemType etype, const label nTotal, const UIndirectList< face > &faces, bool parallel)
Definition: ensightOutput.C:362
Foam::ensightGeoFile
Specialized Ensight output with extra geometry file header.
Definition: ensightGeoFile.H:42
ensightOutput.H
Foam::Field
Generic templated field type.
Definition: Field.H:59
Foam::ensightOutputSurface::write
void write(ensightGeoFile &os) const
Definition: ensightOutputSurface.C:44
os
OBJstream os(runTime.globalPath()/outputName)
Foam::ensightPart::name
const string & name() const noexcept
Definition: ensightPart.H:156
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:58
ensightOutputSurface.H
points
const pointField & points
Definition: gmvOutputHeader.H:1
Foam::name
word name(const expressions::valueTypeCode typeCode)
Definition: exprTraits.C:52
Foam::ensightOutput::Detail::writeCoordinates
bool writeCoordinates(ensightGeoFile &os, const label partId, const word &partName, const label nPoints, const FieldContainer< Foam::point > &fld, bool parallel)
Definition: ensightOutputTemplates.C:129
Foam::ensightFaces::classify
void classify(const UList< face > &faces)
Definition: ensightFaces.C:212