1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
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
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/>.
25 Foam::processorPointPatch
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.
41 \*---------------------------------------------------------------------------*/
43 #ifndef processorPointPatch_H
44 #define processorPointPatch_H
46 #include "coupledFacePointPatch.H"
47 #include "processorPolyPatch.H"
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 /*---------------------------------------------------------------------------*\
55 Class processorPointPatch Declaration
56 \*---------------------------------------------------------------------------*/
58 class processorPointPatch
60 public coupledFacePointPatch
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&);
98 //- Runtime type information
99 TypeName(processorPolyPatch::typeName_());
104 //- Construct from components
107 const polyPatch& patch,
108 const pointBoundaryMesh& bm
113 virtual ~processorPointPatch();
118 //- Return true if running parallel
119 virtual bool coupled() const
121 if (Pstream::parRun())
131 //- Return message tag to use for communication
132 virtual int tag() const
134 return procPolyPatch_.tag();
137 //- Return the constraint type this pointPatch implements.
138 virtual const word& constraintType() const
143 //- Return processor number
146 return procPolyPatch_.myProcNo();
149 //- Return neigbour processor number
150 int neighbProcNo() const
152 return procPolyPatch_.neighbProcNo();
155 //- Is this a master patch
156 bool isMaster() const
158 return myProcNo() < neighbProcNo();
161 //- Is this a slave patch
167 //- Return the underlying processorPolyPatch
168 const processorPolyPatch& procPolyPatch() const
170 return procPolyPatch_;
173 //- Return mesh points in the correct order for the receiving side
174 const labelList& reverseMeshPoints() const;
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 } // End namespace Foam
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 // ************************************************************************* //