Forward compatibility: flex
[foam-extend-3.2.git] / src / mesh / cfMesh / utilities / helperClasses / parallelHelpers / parPartTet / parPartTet.H
bloba5c3133bdbebc493dcfe65e9343047e923ff7eee
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | cfMesh: A library for mesh generation
4    \\    /   O peration     |
5     \\  /    A nd           | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6      \\/     M anipulation  | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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/>.
24 Class
25     parPartTet
27 Description
28     Holds labels and coordinates of points making a tet.
29     It is used for exchanging data over processors
31 SourceFiles
33 \*---------------------------------------------------------------------------*/
35 #ifndef parPartTet_H
36 #define parPartTet_H
38 #include "labelledPoint.H"
39 #include "contiguous.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 namespace Foam
46 /*---------------------------------------------------------------------------*\
47                            Class parPartTet Declaration
48 \*---------------------------------------------------------------------------*/
50 class parPartTet
52     // Private data
53         labelledPoint pts_[4];
55 public:
57     // Constructors
59         inline parPartTet()
60         {}
62         explicit inline parPartTet
63         (
64             const labelledPoint& p0,
65             const labelledPoint& p1,
66             const labelledPoint& p2,
67             const labelledPoint& p3
68         )
69         {
70             pts_[0] = p0;
71             pts_[1] = p1;
72             pts_[2] = p2;
73             pts_[3] = p3;
74         }
76     // Destructor
78         ~parPartTet()
79         {}
81     // Member functions
83     // Member operators
85         inline const labelledPoint& operator[](const label i) const
86         {
87             return pts_[i];
88         }
90         inline bool operator !=(const parPartTet& ptf) const
91         {
92             Serr << "Not implemented" << endl;
93             ::exit(1);
95             return true;
96         }
98     // Friend operators
100         inline friend Ostream& operator<<(Ostream& os, const parPartTet& ppt)
101         {
102             os << token::BEGIN_LIST;
103             os << ppt.pts_[0] << token::SPACE;
104             os << ppt.pts_[1] << token::SPACE;
105             os << ppt.pts_[2] << token::SPACE;
106             os << ppt.pts_[3];
107             os << token::END_LIST;
109             // Check state of Ostream
110             os.check("operator<<(Ostream&, const parPartTet&");
111             return os;
112         }
114         inline friend Istream& operator>>(Istream& is, parPartTet& ppt)
115         {
116             // Read beginning of parPartTet
117             is.readBegin("parPartTet");
119             for(label i=0;i<4;++i)
120                 is >> ppt.pts_[i];
122             // Read end of parHelper
123             is.readEnd("parPartTet");
125             // Check state of Istream
126             is.check("operator>>(Istream&, parPartTet");
128             return is;
129         }
132 //- Specify data associated with parPartTet type is contiguous
133 template<>
134 inline bool contiguous<parPartTet>() {return true;}
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 } // End namespace Foam
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 #endif
144 // ************************************************************************* //