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 {
35 }
36 
37 
38 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
39 
41 :
42  regIOobject(io),
43  edgeMesh()
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 
80 (
81  const IOobject& io,
82  const edgeMesh& em
83 )
84 :
86  edgeMesh(em)
87 {}
88 
89 
90 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
91 
93 {
94  is >> *this;
95  return !is.bad();
96 }
97 
98 
100 {
101  os << *this;
102 
103  return os.good();
104 }
105 
106 
107 // ************************************************************************* //
Foam::expressions::patchExpr::debug
int debug
Foam::pointField
vectorField pointField
pointField is a vectorField.
Definition: pointFieldFwd.H:38
Foam::edgeMesh::points
const pointField & points() const noexcept
Definition: edgeMeshI.H:92
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:165
Foam::edgeList
List< edge > edgeList
A List of edges.
Definition: edgeList.H:60
Foam::featureEdgeMesh::featureEdgeMesh
featureEdgeMesh(const IOobject &)
Definition: featureEdgeMesh.C:33
Foam::featureEdgeMesh::writeData
virtual bool writeData(Ostream &) const
Definition: featureEdgeMesh.C:92
Foam::endl
Ostream & endl(Ostream &os)
Definition: Ostream.H:381
Foam::Pout
prefixOSstream Pout
Foam::IOstream::good
bool good() const noexcept
Definition: IOstream.H:229
Foam::Field
Generic templated field type.
Definition: Field.H:59
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:57
Foam::featureEdgeMesh::readData
virtual bool readData(Istream &)
Definition: featureEdgeMesh.C:85
Foam::IOobject::READ_IF_PRESENT
@ READ_IF_PRESENT
Definition: IOobject.H:183
os
OBJstream os(runTime.globalPath()/outputName)
Foam::IOstream::bad
bool bad() const noexcept
Definition: IOstream.H:247
Foam
Definition: atmBoundaryLayer.C:26
Foam::IOobject::readOpt
readOption readOpt() const noexcept
Definition: IOobjectI.H:157
Foam::edgeMesh::edges
const edgeList & edges() const noexcept
Definition: edgeMeshI.H:98
Foam::regIOobject
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:69
Foam::regIOobject::close
void close()
Definition: regIOobjectRead.C:164
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:58
points
const pointField & points
Definition: gmvOutputHeader.H:1
Foam::IOobject::MUST_READ_IF_MODIFIED
@ MUST_READ_IF_MODIFIED
Definition: IOobject.H:182
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:52
Foam::regIOobject::readStream
Istream & readStream(const word &, const bool valid=true)
Definition: regIOobjectRead.C:122
featureEdgeMesh.H
Foam::featureEdgeMesh
edgeMesh + IO.
Definition: featureEdgeMesh.H:50
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)
Foam::edgeMesh
Mesh data needed to do the Finite Area discretisation.
Definition: edgeFaMesh.H:47
Foam::regIOobject::headerOk
bool headerOk()
Definition: regIOobject.C:429
Foam::IOobject::MUST_READ
@ MUST_READ
Definition: IOobject.H:181