ensightMeshI.H
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) 2016-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 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
29 
31 {
32  return mesh_;
33 }
34 
35 
37 {
38  return *options_;
39 }
40 
41 
44 {
45  return cellZoneParts_;
46 }
47 
48 
51 {
52  return faceZoneParts_;
53 }
54 
55 
58 {
59  return boundaryParts_;
60 }
61 
62 
64 {
65  clear();
66 
67  // Already marked as expired
68  if (needsUpdate_)
69  {
70  return false;
71  }
72 
73  needsUpdate_ = true;
74  return true;
75 }
76 
77 
78 inline bool Foam::ensightMesh::needsUpdate() const
79 {
80  return needsUpdate_;
81 }
82 
83 
84 inline bool Foam::ensightMesh::empty() const
85 {
86  return
87  (
88  cellZoneParts_.empty()
89  && faceZoneParts_.empty()
90  && boundaryParts_.empty()
91  );
92 }
93 
94 
95 inline Foam::label Foam::ensightMesh::size() const
96 {
97  return
98  (
99  cellZoneParts_.size()
100  + faceZoneParts_.size()
101  + boundaryParts_.size()
102  );
103 }
104 
105 
106 inline void Foam::ensightMesh::write
107 (
109  bool parallel
110 ) const
111 {
112  write(os.ref(), parallel);
113 }
114 
115 
116 // ************************************************************************* //
Foam::ensightMesh::needsUpdate
bool needsUpdate() const
Does the content need an update?
Definition: ensightMeshI.H:78
Foam::ensightMesh::boundaryParts
const Map< ensightFaces > & boundaryParts() const
Face elements per selected patch, lookup by patch index.
Definition: ensightMeshI.H:57
Foam::Map< Foam::ensightCells >
Foam::ensightMesh::write
void write(autoPtr< ensightGeoFile > &os, bool parallel=Pstream::parRun()) const
Write geometry to file. Normally in parallel.
Definition: ensightMeshI.H:107
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::ensightMesh::size
label size() const
Number of parts.
Definition: ensightMeshI.H:95
Foam::ensightMesh::empty
bool empty() const
Any parts?
Definition: ensightMeshI.H:84
Foam::ensightMesh::expire
bool expire()
Mark as needing an update.
Definition: ensightMeshI.H:63
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
clear
patchWriters clear()
Foam::ensightMesh::options
Configuration options for the ensightMesh.
Definition: ensightMesh.H:213
Foam::autoPtr::ref
T & ref()
Return reference to the managed object without nullptr checking.
Definition: autoPtr.H:167
Foam::vtk::write
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
Definition: foamVtkOutputTemplates.C:35
Foam::ensightMesh::cellZoneParts
const Map< ensightCells > & cellZoneParts() const
Face elements per selected patch, lookup by patch index.
Definition: ensightMeshI.H:43
Foam::ensightMesh::faceZoneParts
const Map< ensightFaces > & faceZoneParts() const
Face elements per faceZone, lookup by zone index.
Definition: ensightMeshI.H:50
Foam::ensightMesh::option
const ensightMesh::options & option() const
Reference to the writer/mesh options.
Definition: ensightMeshI.H:36
Foam::ensightMesh::mesh
const polyMesh & mesh() const
Reference to the underlying polyMesh.
Definition: ensightMeshI.H:30