Moving cfMesh into place. Updated contibutors list
[foam-extend-3.2.git] / src / mesh / cfMesh / meshLibrary / utilities / meshes / polyMeshGen / boundaryPatch / processorBoundaryPatch.H
blob890544efbe32aba5688d2cdf2be9cef7d4a69f37
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     processorBoundaryPatch
27 Description
28     Writes information for a given processor patch
30 SourceFiles
31     processorBoundaryPatch.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef processorBoundaryPatch_H
36 #define processorBoundaryPatch_H
38 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40 #include "boundaryPatchBase.H"
41 #include "typeInfo.H"
43 namespace Foam
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 class processorBoundaryPatch
49 :   public boundaryPatchBase
51     // private data
53         label myProcNo_;
55         label neighbProcNo_;
57 public:
59     // Runtime type information
60         TypeName("processor");
62     // Construct from components
63         processorBoundaryPatch
64         (
65             const word& name,
66             const word& type,
67             const label nFaces,
68             const label startFace,
69             const label myProcNo,
70             const label neighbProcNo
71         );
73         processorBoundaryPatch(const word& name, const dictionary&);
75     // Construct and return a clone
76         virtual autoPtr<boundaryPatchBase> clone() const
77         {
78             return autoPtr<boundaryPatchBase>
79             (
80                 new processorBoundaryPatch
81                 (
82                     patchName(),
83                     patchType(),
84                     patchSize(),
85                     patchStart(),
86                     myProcNo_,
87                     neighbProcNo_
88                 )
89             );
90         }
92         virtual autoPtr<boundaryPatchBase> clone
93         (
94             const processorBoundaryPatch& pp
95         ) const
96         {
97             return autoPtr<boundaryPatchBase>
98             (
99                 new processorBoundaryPatch
100                 (
101                     pp.patchName(),
102                     pp.patchType(),
103                     pp.patchSize(),
104                     pp.patchStart(),
105                     pp.myProcNo_,
106                     pp.neighbProcNo_
107                 )
108             );
109         }
111     // Member functions
112         //- return the owner processor
113         inline label myProcNo() const
114         {
115             return myProcNo_;
116         }
118         //- return the neighbour processor
119         inline label neiProcNo() const
120         {
121             return neighbProcNo_;
122         }
124         //- check if the processor is the owner of the interface
125         inline bool owner() const
126         {
127             if( myProcNo_ < neighbProcNo_ )
128                 return true;
130             return false;
131         }
133         //- Return as dictionary of entries
134         dictionary dict() const;
136     // Write
137         //- write to Ostream
138         void write(Ostream&) const;
140         //- Write dictionary
141         void writeDict(Ostream&) const;
143     // Member operators
144         Ostream& operator<<(Ostream&) const;
146         Istream& operator>>(Istream&);
148         void operator=(const processorBoundaryPatch&);
150         bool operator!=(const processorBoundaryPatch&) const;
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 } // End namespace Foam
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 #endif
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //