extendedFeatureEdgeMesh.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) 2011-2014 OpenFOAM Foundation
9  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::extendedFeatureEdgeMesh
29 
30 Description
31 
32  extendedEdgeMesh + IO.
33 
34 SourceFiles
35  extendedFeatureEdgeMesh.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef extendedFeatureEdgeMesh_H
40 #define extendedFeatureEdgeMesh_H
41 
42 #include "extendedEdgeMesh.H"
43 #include "regIOobject.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 // Forward Declarations
51 class objectRegistry;
52 
53 /*---------------------------------------------------------------------------*\
54  Class extendedFeatureEdgeMesh Declaration
55 \*---------------------------------------------------------------------------*/
56 
58 :
59  public regIOobject,
60  public extendedEdgeMesh
61 {
62 
63 public:
64 
65  //- Runtime type information
66  TypeName("extendedFeatureEdgeMesh");
67 
68 
69  // Constructors
70 
71  //- Construct (read) given an IOobject
72  explicit extendedFeatureEdgeMesh(const IOobject& io);
73 
74  //- Copy construct with IOobject
76  (
77  const IOobject& io,
78  const extendedEdgeMesh&
79  );
80 
81  //- Construct given a surface with selected edges,point
82  // (surfaceFeatures), an objectRegistry and a
83  // fileName to write to.
84  // Extracts, classifies and reorders the data from surfaceFeatures.
86  (
87  const surfaceFeatures& sFeat,
88  const objectRegistry& obr,
89  const fileName& sFeatFileName,
90  const boolList& surfBaffleRegions
91  );
92 
93  //- Construct from PrimitivePatch
95  (
96  const IOobject& io,
98  const labelUList& featureEdges,
99  const labelUList& regionFeatureEdges,
100  const labelUList& featurePoints
101  );
102 
103  //- Construct from all components
105  (
106  const IOobject& io,
107  const pointField& pts,
108  const edgeList& eds,
109  label concaveStart,
110  label mixedStart,
111  label nonFeatureStart,
112  label internalStart,
113  label flatStart,
114  label openStart,
115  label multipleStart,
116  const vectorField& normals,
120  const labelListList& edgeNormals,
123  const labelList& regionEdges
124  );
125 
126 
127  //- Destructor
128  virtual ~extendedFeatureEdgeMesh() = default;
129 
130 
131  // IO
132 
133  //- Give precedence to the regIOobject write
134  using regIOobject::write;
135 
136  //- ReadData function required for regIOobject read operation
137  virtual bool readData(Istream&);
138 
139  //- WriteData function required for regIOobject write operation
140  virtual bool writeData(Ostream&) const;
141 
142  //- Is object global
143  virtual bool global() const
144  {
145  return true;
146  }
147 
148  //- Return complete path + object name if the file exists
149  //- either in the case/processor or case otherwise null
150  virtual fileName filePath() const
151  {
152  return globalFilePath(type());
153  }
154 };
155 
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 //- Global file type for extendedFeatureEdgeMesh
160 template<>
161 struct is_globalIOobject<extendedFeatureEdgeMesh> : std::true_type {};
162 
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 } // End namespace Foam
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 #endif
171 
172 // ************************************************************************* //
label nonFeatureStart() const
Return the index of the start of the non-feature points.
const labelListList & featurePointNormals() const
Return the indices of the normals that are adjacent to the.
A class for handling file names.
Definition: fileName.H:72
const labelListList & edgeNormals() const
Return the indices of the normals that are adjacent to the.
const labelListList & normalDirections() const
TypeName("extendedFeatureEdgeMesh")
Runtime type information.
fileName globalFilePath(const word &typeName, const bool search=true) const
Redirect to fileHandler filePath, searching up if in parallel.
Definition: IOobject.C:547
const List< sideVolumeType > & normalVolumeTypes() const
Return.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
Description of feature edges and points.
label multipleStart() const
Return the index of the start of the multiply-connected feature.
Trait for specifying global vs. local file types.
Definition: IOobject.H:981
const vectorField & normals() const
Return the normals of the surfaces adjacent to the feature edges.
label openStart() const
Return the index of the start of the open feature edges.
const labelList & regionEdges() const
Return the feature edges which are on the boundary between.
virtual bool global() const
Is object global.
virtual fileName filePath() const
Return complete path + object name if the file exists either in the case/processor or case otherwise ...
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: POSIX.C:799
A list of faces which address into the list of points.
label flatStart() const
Return the index of the start of the flat feature edges.
label internalStart() const
Return the index of the start of the internal feature edges.
virtual bool write(const bool writeOnProc=true) const
Write using setting from DB.
label mixedStart() const
Return the index of the start of the mixed type feature points.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
const labelListList & featurePointEdges() const
Return the edge labels for a given feature point. Edges are.
virtual bool writeData(Ostream &) const
WriteData function required for regIOobject write operation.
const vectorField & edgeDirections() const
Return the edgeDirection vectors.
virtual ~extendedFeatureEdgeMesh()=default
Destructor.
extendedFeatureEdgeMesh(const IOobject &io)
Construct (read) given an IOobject.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:66
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
Registry of regIOobjects.
Defines the attributes of an object for which implicit objectRegistry management is supported...
Definition: IOobject.H:172
virtual bool readData(Istream &)
ReadData function required for regIOobject read operation.
Holds feature edges/points of surface.
Namespace for OpenFOAM.
label concaveStart() const
Return the index of the start of the concave feature points.
const pointField & pts