featureEdgeMesh.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-2017 OpenFOAM Foundation
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 Class
27  Foam::featureEdgeMesh
28 
29 Description
30  edgeMesh + IO.
31 
32 See also
33  Foam::extendedFeatureEdgeMesh
34 
35 SourceFiles
36  featureEdgeMesh.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef featureEdgeMesh_H
41 #define featureEdgeMesh_H
42 
43 #include "edgeMesh.H"
44 #include "regIOobject.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class featureEdgeMesh Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 class featureEdgeMesh
56 :
57  public regIOobject,
58  public edgeMesh
59 {
60 public:
61 
62  TypeName("featureEdgeMesh");
63 
64 
65  // Constructors
66 
67  //- Construct (read) given an IOobject
68  explicit featureEdgeMesh(const IOobject&);
69 
70  //- Construct from featureEdgeMesh data
72  (
73  const IOobject& io,
74  const pointField& points,
75  const edgeList& edges
76  );
77 
78  //- Construct as copy
79  featureEdgeMesh(const IOobject& io, const edgeMesh& em);
80 
81 
82  // IO
83 
84  //- ReadData function required for regIOobject read operation
85  virtual bool readData(Istream&);
86 
87  //- WriteData function required for regIOobject write operation
88  virtual bool writeData(Ostream&) const;
89 
90  //- Is object global
91  virtual bool global() const
92  {
93  return true;
94  }
95 
96  //- Return complete path + object name if the file exists
97  // either in the case/processor or case otherwise null
98  virtual fileName filePath() const
99  {
100  return globalFilePath(type());
101  }
102 };
103 
104 
105 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
106 
107 //- Global file type for featureEdgeMesh
108 template<>
109 struct is_globalIOobject<featureEdgeMesh> : std::true_type {};
110 
111 
112 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
113 
114 } // End namespace Foam
115 
116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117 
118 #endif
119 
120 // ************************************************************************* //
A class for handling file names.
Definition: fileName.H:72
const pointField & points() const noexcept
Return points.
Definition: edgeMeshI.H:92
fileName globalFilePath(const word &typeName, const bool search=true) const
Redirect to fileHandler filePath, searching up if in parallel.
Definition: IOobject.C:547
virtual fileName filePath() const
Return complete path + object name if the file exists.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
virtual bool global() const
Is object global.
Trait for specifying global vs. local file types.
Definition: IOobject.H:981
virtual bool writeData(Ostream &) const
WriteData function required for regIOobject write operation.
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
TypeName("featureEdgeMesh")
virtual bool readData(Istream &)
ReadData function required for regIOobject read operation.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
Mesh data needed to do the Finite Area discretisation.
Definition: edgeFaMesh.H:47
const edgeList & edges() const noexcept
Return edges.
Definition: edgeMeshI.H:98
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)
Defines the attributes of an object for which implicit objectRegistry management is supported...
Definition: IOobject.H:172
featureEdgeMesh(const IOobject &)
Construct (read) given an IOobject.
Namespace for OpenFOAM.