OpenFOAM: API Guide
v2112
The open source CFD toolbox
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
40
Foam::featureEdgeMesh::featureEdgeMesh
(
const
IOobject
&
io
)
41
:
42
regIOobject
(
io
),
43
edgeMesh
()
44
{
45
if
46
(
47
io
.
readOpt
() ==
IOobject::MUST_READ
48
||
io
.
readOpt
() ==
IOobject::MUST_READ_IF_MODIFIED
49
|| (
io
.
readOpt
() ==
IOobject::READ_IF_PRESENT
&&
headerOk
())
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
67
Foam::featureEdgeMesh::featureEdgeMesh
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
Foam::featureEdgeMesh::featureEdgeMesh
80
(
81
const
IOobject
&
io
,
82
const
edgeMesh
& em
83
)
84
:
85
regIOobject
(
io
),
86
edgeMesh
(em)
87
{}
88
89
90
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
91
92
bool
Foam::featureEdgeMesh::readData
(
Istream
& is)
93
{
94
is >> *
this
;
95
return
!is.
bad
();
96
}
97
98
99
bool
Foam::featureEdgeMesh::writeData
(
Ostream
&
os
)
const
100
{
101
os
<< *
this
;
102
103
return
os
.
good
();
104
}
105
106
107
// ************************************************************************* //
Foam::Field< vector >
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition:
IOobject.H:170
Foam::IOobject::readOpt
readOption readOpt() const noexcept
The read option.
Definition:
IOobjectI.H:164
Foam::IOobject::MUST_READ_IF_MODIFIED
@ MUST_READ_IF_MODIFIED
Definition:
IOobject.H:180
Foam::IOobject::READ_IF_PRESENT
@ READ_IF_PRESENT
Definition:
IOobject.H:181
Foam::IOobject::MUST_READ
@ MUST_READ
Definition:
IOobject.H:179
Foam::IOstream::good
bool good() const noexcept
True if next operation might succeed.
Definition:
IOstream.H:233
Foam::IOstream::bad
bool bad() const noexcept
True if stream is corrupted.
Definition:
IOstream.H:251
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition:
Istream.H:64
Foam::List< edge >
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition:
Ostream.H:62
Foam::UList::size
void size(const label n)
Older name for setAddressableSize.
Definition:
UList.H:114
Foam::edgeMesh
Mesh data needed to do the Finite Area discretisation.
Definition:
edgeFaMesh.H:56
Foam::edgeMesh::points
const pointField & points() const noexcept
Return points.
Definition:
edgeMeshI.H:99
Foam::edgeMesh::edges
const edgeList & edges() const noexcept
Return edges.
Definition:
edgeMeshI.H:105
Foam::featureEdgeMesh
edgeMesh + IO.
Definition:
featureEdgeMesh.H:58
Foam::featureEdgeMesh::writeData
virtual bool writeData(Ostream &) const
WriteData function required for regIOobject write operation.
Definition:
featureEdgeMesh.C:99
Foam::featureEdgeMesh::readData
virtual bool readData(Istream &)
ReadData function required for regIOobject read operation.
Definition:
featureEdgeMesh.C:92
Foam::regIOobject
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition:
regIOobject.H:76
Foam::regIOobject::close
void close()
Close Istream.
Definition:
regIOobjectRead.C:173
Foam::regIOobject::readStream
Istream & readStream(const word &, const bool valid=true)
Return Istream and check object type against that given.
Definition:
regIOobjectRead.C:131
Foam::regIOobject::headerOk
bool headerOk()
Read and check header info. Does not check the headerClassName.
Definition:
regIOobject.C:438
defineTypeNameAndDebug
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition:
className.H:121
os
OBJstream os(runTime.globalPath()/outputName)
featureEdgeMesh.H
points
const pointField & points
Definition:
gmvOutputHeader.H:1
io
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
Foam
Namespace for OpenFOAM.
Definition:
atmBoundaryLayer.C:34
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition:
Ostream.H:372
Foam::Pout
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
src
meshTools
edgeMesh
featureEdgeMesh
featureEdgeMesh.C
Generated by
1.9.5
OPENFOAM® is a registered
trademark
of OpenCFD Ltd.