1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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.
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
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/>.
24 \*---------------------------------------------------------------------------*/
26 #include "tetIndices.H"
28 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
30 Foam::tetIndices::tetIndices()
41 Foam::tetIndices::tetIndices
53 faceBasePtI_(faceBasePtI),
60 Foam::tetIndices::tetIndices
75 const faceList& pFaces = mesh.faces();
76 const labelList& pOwner = mesh.faceOwner();
78 const Foam::face& f = pFaces[faceI_];
80 bool own = (pOwner[faceI_] == cellI_);
82 faceBasePtI_ = mesh.tetBasePtIs()[faceI_];
84 label facePtI = (tetPtI_ + faceBasePtI_) % f.size();
85 label otherFacePtI = f.fcIndex(facePtI);
90 facePtBI_ = otherFacePtI;
94 facePtAI_ = otherFacePtI;
100 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
102 Foam::tetIndices::~tetIndices()
106 // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
108 Foam::Istream& Foam::operator>>(Istream& is, tetIndices& tI)
117 // Check state of Istream
120 "Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::tetIndices&)"
127 Foam::Ostream& Foam::operator<<(Ostream& os, const tetIndices& tI)
129 os << tI.cell() << token::SPACE
130 << tI.face() << token::SPACE
131 << tI.faceBasePt() << token::SPACE
132 << tI.facePtA() << token::SPACE
133 << tI.facePtB() << token::SPACE
134 << tI.tetPt() << token::SPACE
137 // Check state of Ostream
140 "Foam::Ostream& Foam::operator<<(Foam::Ostream&, "
141 "const Foam::tetIndices&)"
148 // ************************************************************************* //