tetIndices.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "tetIndices.H"
27 
28 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
29 
31 :
32  celli_(-1),
33  facei_(-1),
34  tetPti_(-1)
35 {}
36 
37 
39 (
40  label celli,
41  label facei,
42  label tetPtI
43 )
44 :
45  celli_(celli),
46  facei_(facei),
47  tetPti_(tetPtI)
48 {}
49 
50 
51 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
52 
54 {}
55 
56 
57 // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
58 
60 {
61  is >> tI.cell() >> tI.face() >> tI.tetPt();
62 
63  // Check state of Istream
64  is.check
65  (
66  "Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::tetIndices&)"
67  );
68 
69  return is;
70 }
71 
72 
74 {
75  os << tI.cell() << token::SPACE
76  << tI.face() << token::SPACE
77  << tI.tetPt() << token::SPACE
78  << endl;
79 
80  // Check state of Ostream
81  os.check
82  (
83  "Foam::Ostream& Foam::operator<<(Foam::Ostream&, "
84  "const Foam::tetIndices&)"
85  );
86 
87  return os;
88 }
89 
90 
91 // ************************************************************************* //
virtual bool check(const char *operation) const
Check IOstream status for given operation.
Definition: IOstream.C:92
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:60
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
Storage and named access for the indices of a tet which is part of the decomposition of a cell.
Definition: tetIndices.H:82
label face() const
Return the face.
Definition: tetIndicesI.H:43
label tetPt() const
Return the characterising tetPtI.
Definition: tetIndicesI.H:55
label cell() const
Return the cell.
Definition: tetIndicesI.H:31
tetIndices()
Construct null.
Definition: tetIndices.C:30
~tetIndices()
Destructor.
Definition: tetIndices.C:53
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:257
Istream & operator>>(Istream &, pistonPointEdgeData &)
Ostream & operator<<(Ostream &os, const fvConstraints &constraints)