1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | cfMesh: A library for mesh generation
5 \\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6 \\/ M anipulation | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of cfMesh.
11 cfMesh is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 3 of the License, or (at your
14 option) any later version.
16 cfMesh 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 cfMesh. If not, see <http://www.gnu.org/licenses/>.
28 Hold point labels and their coordinates. It is used for exchanging data
33 \*---------------------------------------------------------------------------*/
41 #include "contiguous.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 /*---------------------------------------------------------------------------*\
49 Class parTriFace Declaration
50 \*---------------------------------------------------------------------------*/
55 label globalLabels_[3];
57 triangle<point, point> triPoints_;
65 triPoints_(vector::zero, vector::zero, vector::zero)
68 explicit inline parTriFace
70 const label globalLabel0,
71 const label globalLabel1,
72 const label globalLabel2,
73 const triangle<point, point>& pts
78 globalLabels_[0] = globalLabel0;
79 globalLabels_[1] = globalLabel1;
80 globalLabels_[2] = globalLabel2;
90 inline label globalLabelOfPoint(const label i) const
92 return globalLabels_[i];
95 inline const triangle<point, point>& trianglePoints() const
102 inline bool operator !=(const parTriFace& ptf) const
104 Serr << "parTriFace::operator!= Not implemented" << endl;
112 inline friend Ostream& operator<<(Ostream& os, const parTriFace& ptf)
114 os << token::BEGIN_LIST;
115 os << ptf.globalLabels_[0] << token::SPACE;
116 os << ptf.globalLabels_[1] << token::SPACE;
117 os << ptf.globalLabels_[2] << token::SPACE;
118 os << ptf.triPoints_ << token::END_LIST;
120 // Check state of Ostream
121 os.check("operator<<(Ostream&, const parTriFace&");
125 inline friend Istream& operator>>(Istream& is, parTriFace& ptf)
127 // Read beginning of parTriFace
128 is.readBegin("parTriFace");
130 is >> ptf.globalLabels_[0];
131 is >> ptf.globalLabels_[1];
132 is >> ptf.globalLabels_[2];
133 is >> ptf.triPoints_;
135 // Read end of parHelper
136 is.readEnd("parTriFace");
138 // Check state of Istream
139 is.check("operator>>(Istream&, parTriFace");
145 //- Specify data associated with parTriFace type is contiguous
147 inline bool contiguous<parTriFace>() {return true;}
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 } // End namespace Foam
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 // ************************************************************************* //