ensightMeshOptions.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) 2016-2018 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 "ensightMesh.H"
29 
30 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31 
33 :
34  options(IOstream::streamFormat::BINARY)
35 {}
36 
37 
39 :
40  format_(format),
41  lazy_(false),
42  internal_(true),
43  boundary_(true),
44  patchPatterns_(),
45  faceZonePatterns_()
46 {}
47 
48 
49 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
50 
52 {
53  return format_;
54 }
55 
56 
58 {
59  return lazy_;
60 }
61 
62 
64 {
65  return internal_;
66 }
67 
68 
70 {
71  return boundary_;
72 }
73 
74 
76 {
77  return faceZonePatterns_.size();
78 }
79 
80 
82 {
83  internal_ = true;
84  boundary_ = true;
85  patchPatterns_.clear();
86  faceZonePatterns_.clear();
87 }
88 
89 
91 {
92  lazy_ = beLazy;
93 }
94 
95 
97 {
98  internal_ = on;
99 }
100 
101 
103 {
104  boundary_ = on;
105 
106  if (!boundary_ && patchPatterns_.size())
107  {
108  patchPatterns_.clear();
109 
111  << "Deactivating boundary and removing old patch selection"
112  << endl;
113  }
114 }
115 
116 
118 (
119  const UList<wordRe>& patterns
120 )
121 {
122  patchPatterns_ = wordRes(patterns);
123 
124  if (!boundary_ && patchPatterns_.size())
125  {
126  patchPatterns_.clear();
127 
129  << "Ignoring patch selection, boundary is not active"
130  << endl;
131  }
132 }
133 
134 
136 (
137  List<wordRe>&& patterns
138 )
139 {
140  patchPatterns_ = wordRes(std::move(patterns));
141 
142  if (!boundary_ && patchPatterns_.size())
143  {
144  patchPatterns_.clear();
145 
147  << "Ignoring patch selection, boundary is not active"
148  << endl;
149  }
150 }
151 
152 
154 (
155  const UList<wordRe>& patterns
156 )
157 {
158  faceZonePatterns_ = wordRes(patterns);
159 }
160 
161 
163 (
164  List<wordRe>&& patterns
165 )
166 {
167  faceZonePatterns_ = wordRes(std::move(patterns));
168 }
169 
170 
172 {
173  return patchPatterns_;
174 }
175 
176 
178 {
179  return faceZonePatterns_;
180 }
181 
182 
183 // ************************************************************************* //
Foam::ensightMesh::options::useBoundaryMesh
bool useBoundaryMesh() const
Using boundary?
Definition: ensightMeshOptions.C:69
Foam::ensightMesh::format
IOstream::streamFormat format() const
Ascii/Binary file output.
Definition: ensightMeshI.H:42
Foam::ensightMesh::options::faceZoneSelection
const wordRes & faceZoneSelection() const
Selection of faceZones. Empty if unspecified.
Definition: ensightMeshOptions.C:177
Foam::IOstream
An IOstream is an abstract base class for all input/output systems; be they streams,...
Definition: IOstream.H:75
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:337
Foam::ensightMesh::options::useFaceZones
bool useFaceZones() const
Using faceZones?
Definition: ensightMeshOptions.C:75
Foam::ensightMesh::options::format
IOstream::streamFormat format() const
File output format (ascii | binary)
Definition: ensightMeshOptions.C:51
ensightMesh.H
Foam::ensightMesh::options::useInternalMesh
bool useInternalMesh() const
Using internal?
Definition: ensightMeshOptions.C:63
Foam::IOstreamOption::streamFormat
streamFormat
Data format (ascii | binary)
Definition: IOstreamOption.H:64
Foam::ensightMesh::options::reset
void reset()
Reset to defaults.
Definition: ensightMeshOptions.C:81
Foam::ensightMesh::options::lazy
bool lazy() const
Lazy creation? (ie, ensightMesh starts as needsUpdate)
Definition: ensightMeshOptions.C:57
Foam::ensightMesh::options::patchSelection
const wordRes & patchSelection() const
Selection of patches. Empty if unspecified.
Definition: ensightMeshOptions.C:171
Foam::ensightMesh::options
Configuration options for the ensightMesh.
Definition: ensightMesh.H:394
Foam::List< wordRe >
Foam::UList
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:103
Foam::wordRes
A List of wordRe with additional matching capabilities.
Definition: wordRes.H:51
Foam::ensightMesh::options::options
options()
Construct for binary output.
Definition: ensightMeshOptions.C:32
WarningInFunction
#define WarningInFunction
Report a warning using Foam::Warning.
Definition: messageStream.H:294