1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 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, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 Foam::processorPointPatch
29 Processor patch boundary needs to be such that the ordering of
30 points in the patch is the same on both sides.
32 Looking at the creation of the faces on both sides of the processor
33 patch they need to be identical on both sides with the normals pointing
34 in opposite directions. This is achieved by calling the reverseFace
35 function in the decomposition. It is therefore possible to re-create
36 the ordering of patch points on the slave side by reversing all the
37 patch faces of the owner.
42 \*---------------------------------------------------------------------------*/
44 #ifndef processorPointPatch_H
45 #define processorPointPatch_H
47 #include "coupledFacePointPatch.H"
48 #include "processorPolyPatch.H"
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55 /*---------------------------------------------------------------------------*\
56 Class processorPointPatch Declaration
57 \*---------------------------------------------------------------------------*/
59 class processorPointPatch
61 public coupledFacePointPatch
65 const processorPolyPatch& procPolyPatch_;
68 // Private Member Functions
70 //- Initialise the calculation of the patch geometry
71 virtual void initGeometry();
73 //- Calculate the patch geometry
74 virtual void calcGeometry();
76 //- Initialise the points on this patch which are should also be
77 // on a neighbouring patch but are not part of faces of that patch
78 void initPatchPatchPoints();
80 //- Calculate the points on this patch which are should also be
81 // on a neighbouring patch but are not part of faces of that patch
82 void calcPatchPatchPoints();
84 //- Initialise the patches for moving points
85 virtual void initMovePoints(const pointField&);
87 //- Correct patches after moving points
88 virtual void movePoints(const pointField&);
90 //- Initialise the update of the patch topology
91 virtual void initUpdateMesh();
93 //- Update of the patch topology
94 virtual void updateMesh();
97 //- Disallow default construct as copy
98 processorPointPatch(const processorPointPatch&);
100 //- Disallow default assignment
101 void operator=(const processorPointPatch&);
105 //- Runtime type information
106 TypeName(processorPolyPatch::typeName_());
111 //- Construct from components
114 const polyPatch& patch,
115 const pointBoundaryMesh& bm
121 virtual ~processorPointPatch();
126 //- Return true if running parallel
127 virtual bool coupled() const
129 if (Pstream::parRun())
139 //- Return processor number
142 return procPolyPatch_.myProcNo();
145 //- Return neigbour processor number
146 int neighbProcNo() const
148 return procPolyPatch_.neighbProcNo();
151 //- Is this a master patch
152 bool isMaster() const
154 return myProcNo() < neighbProcNo();
157 //- Is this a slave patch
163 //- Return the underlying processorPolyPatch
164 const processorPolyPatch& procPolyPatch() const
166 return procPolyPatch_;
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 } // End namespace Foam
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 // ************************************************************************* //