ENH: autoLayerDriver: better layering information message
[OpenFOAM-2.0.x.git] / src / OpenFOAM / meshes / pointMesh / pointPatches / constraint / processor / processorPointPatch.H
blob992a5b0c24e7ab6848b62178f4991aceb40d0e59
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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 Class
25     Foam::processorPointPatch
27 Description
28     Processor patch boundary needs to be such that the ordering of
29     points in the patch is the same on both sides.
31     Looking at the creation of the faces on both sides of the processor
32     patch they need to be identical on both sides with the normals pointing
33     in opposite directions.  This is achieved by calling the reverseFace
34     function in the decomposition.  It is therefore possible to re-create
35     the ordering of patch points on the slave side by reversing all the
36     patch faces of the owner.
38 SourceFiles
39     processorPointPatch.C
41 \*---------------------------------------------------------------------------*/
43 #ifndef processorPointPatch_H
44 #define processorPointPatch_H
46 #include "coupledFacePointPatch.H"
47 #include "processorPolyPatch.H"
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 namespace Foam
54 /*---------------------------------------------------------------------------*\
55                       Class processorPointPatch Declaration
56 \*---------------------------------------------------------------------------*/
58 class processorPointPatch
60     public coupledFacePointPatch
62     // Private data
64         const processorPolyPatch& procPolyPatch_;
66         mutable labelList reverseMeshPoints_;
69     // Private Member Functions
71         //- Initialise the calculation of the patch geometry
72         virtual void initGeometry(PstreamBuffers&);
74         //- Calculate the patch geometry
75         virtual void calcGeometry(PstreamBuffers&);
77         //- Initialise the patches for moving points
78         virtual void initMovePoints(PstreamBuffers&, const pointField&);
80         //- Correct patches after moving points
81         virtual void movePoints(PstreamBuffers&, const pointField&);
83         //- Initialise the update of the patch topology
84         virtual void initUpdateMesh(PstreamBuffers&);
86         //- Update of the patch topology
87         virtual void updateMesh(PstreamBuffers&);
90         //- Disallow default construct as copy
91         processorPointPatch(const processorPointPatch&);
93         //- Disallow default assignment
94         void operator=(const processorPointPatch&);
96 public:
98     //- Runtime type information
99     TypeName(processorPolyPatch::typeName_());
102     // Constructors
104         //- Construct from components
105         processorPointPatch
106         (
107             const polyPatch& patch,
108             const pointBoundaryMesh& bm
109         );
112     //- Destructor
113     virtual ~processorPointPatch();
116     // Member functions
118         //- Return true if running parallel
119         virtual bool coupled() const
120         {
121             if (Pstream::parRun())
122             {
123                 return true;
124             }
125             else
126             {
127                 return false;
128             }
129         }
131         //- Return message tag to use for communication
132         virtual int tag() const
133         {
134             return procPolyPatch_.tag();
135         }
137         //- Return the constraint type this pointPatch implements.
138         virtual const word& constraintType() const
139         {
140             return type();
141         }
143         //- Return processor number
144         int myProcNo() const
145         {
146             return procPolyPatch_.myProcNo();
147         }
149         //- Return neigbour processor number
150         int neighbProcNo() const
151         {
152             return procPolyPatch_.neighbProcNo();
153         }
155         //- Is this a master patch
156         bool isMaster() const
157         {
158             return myProcNo() < neighbProcNo();
159         }
161         //- Is this a slave patch
162         bool isSlave() const
163         {
164             return !isMaster();
165         }
167         //- Return the underlying processorPolyPatch
168         const processorPolyPatch& procPolyPatch() const
169         {
170             return procPolyPatch_;
171         }
173         //- Return mesh points in the correct order for the receiving side
174         const labelList& reverseMeshPoints() const;
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 } // End namespace Foam
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 #endif
187 // ************************************************************************* //