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 A class containing point coordinates, moving distance,
29 global label of the mapped point and projected patch. It is used for
30 exchanging data over processors
34 \*---------------------------------------------------------------------------*/
36 #ifndef parMapperHelper_H
37 #define parMapperHelper_H
41 #include "contiguous.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 /*---------------------------------------------------------------------------*\
49 Class parMapperHelper Declaration
50 \*---------------------------------------------------------------------------*/
63 explicit inline parMapperHelper()
71 explicit inline parMapperHelper
74 const scalar& movingDst,
75 const label globalLabel,
76 const label patchLabel
80 movingDist_(movingDst),
81 globalLabel_(globalLabel),
90 //- return point coordinates
91 inline const point& coordinates() const
96 //- return moving distance
97 inline const scalar& movingDistance() const
102 //- return global label
103 inline label globalLabel() const
108 //- return patch the point is mapped to
109 inline label pointPatch() const
116 inline void operator=(const parMapperHelper& h)
119 movingDist_ = h.movingDist_;
120 globalLabel_ = h.globalLabel_;
124 inline bool operator!=(const parMapperHelper& h) const
126 if( globalLabel_ != h.globalLabel_ )
133 friend Ostream& operator<<(Ostream& os, const parMapperHelper& h)
135 os << token::BEGIN_LIST;
136 os << h.p_ << token::SPACE;
137 os << h.movingDist_ << token::SPACE;
138 os << h.globalLabel_ << token::SPACE;
139 os << h.patch_ << token::END_LIST;
141 // Check state of Ostream
142 os.check("operator<<(Ostream&, const parMapperHelper&");
146 friend Istream& operator>>(Istream& is, parMapperHelper& h)
148 // Read beginning of parMapperHelper
149 is.readBegin("parMapperHelper");
153 is >> h.globalLabel_;
156 // Read end of parMapperHelper
157 is.readEnd("parMapperHelper");
159 // Check state of Istream
160 is.check("operator>>(Istream&, parMapperHelper");
166 //- Specify data associated with parMapperHelper type is contiguous
168 inline bool contiguous<parMapperHelper>() {return true;}
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 } // End namespace Foam
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 // ************************************************************************* //