featureEdgeMesh.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) 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 \*---------------------------------------------------------------------------*/
27 
28 #include "featureEdgeMesh.H"
29 
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
31 
32 namespace Foam
33 {
34  defineTypeNameAndDebug(featureEdgeMesh, 0);
35 }
36 
37 
38 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
39 
41 :
42  regIOobject(io),
44 {
45  if
46  (
50  )
51  {
52  readStream(typeName) >> *this;
53  close();
54  }
55 
56  if (debug)
57  {
58  Pout<< "featureEdgeMesh::featureEdgeMesh :"
59  << " constructed from IOobject :"
60  << " points:" << points().size()
61  << " edges:" << edges().size()
62  << endl;
63  }
64 }
65 
66 
68 (
69  const IOobject& io,
70  const pointField& points,
71  const edgeList& edges
72 )
73 :
74  regIOobject(io),
75  edgeMesh(points, edges)
76 {}
77 
78 
79 // Construct as copy
81 (
82  const IOobject& io,
83  const featureEdgeMesh& em
84 )
85 :
86  regIOobject(io),
87  edgeMesh(em)
88 {}
89 
90 
91 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
92 
94 {
95  is >> *this;
96  return !is.bad();
97 }
98 
99 
101 {
102  os << *this;
103 
104  return os.good();
105 }
106 
107 
108 // ************************************************************************* //
Foam::expressions::patchExpr::debug
int debug
Static debugging option.
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:104
Foam::featureEdgeMesh::featureEdgeMesh
featureEdgeMesh(const IOobject &)
Construct (read) given an IOobject.
Definition: featureEdgeMesh.C:40
Foam::featureEdgeMesh::writeData
virtual bool writeData(Ostream &) const
WriteData function required for regIOobject write operation.
Definition: featureEdgeMesh.C:100
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:350
Foam::Pout
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
Foam::Field< vector >
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::featureEdgeMesh::readData
virtual bool readData(Istream &)
ReadData function required for regIOobject read operation.
Definition: featureEdgeMesh.C:93
Foam::edgeMesh::points
const pointField & points() const
Return points.
Definition: edgeMeshI.H:99
Foam::IOobject::READ_IF_PRESENT
Definition: IOobject.H:122
Foam::edgeMesh::edges
const edgeList & edges() const
Return edges.
Definition: edgeMeshI.H:105
Foam::IOstream::bad
bool bad() const
Return true if stream is corrupted.
Definition: IOstream.H:242
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::regIOobject
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:71
Foam::regIOobject::close
void close()
Close Istream.
Definition: regIOobjectRead.C:182
Foam::List< edge >
Foam::IOobject::readOpt
readOption readOpt() const
The read option.
Definition: IOobjectI.H:165
points
const pointField & points
Definition: gmvOutputHeader.H:1
Foam::IOobject::MUST_READ_IF_MODIFIED
Definition: IOobject.H:121
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::regIOobject::readStream
Istream & readStream(const word &, const bool valid=true)
Return Istream and check object type against that given.
Definition: regIOobjectRead.C:140
featureEdgeMesh.H
Foam::IOstream::good
bool good() const
Return true if next operation might succeed.
Definition: IOstream.H:224
Foam::featureEdgeMesh
edgeMesh + IO.
Definition: featureEdgeMesh.H:54
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)
Foam::edgeMesh
Mesh data needed to do the Finite Area discretisation.
Definition: edgeFaMesh.H:52
Foam::regIOobject::headerOk
bool headerOk()
Read and check header info.
Definition: regIOobject.C:453
Foam::IOobject::MUST_READ
Definition: IOobject.H:120