initial commit for version 1.5.x patch release
[OpenFOAM-1.5.x.git] / src / OpenFOAM / meshes / pointMesh / pointPatches / constraint / processor / processorPointPatch.H
blob6d759a1850894d2bbdba169072c42c0d3fd9b68b
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2008 OpenCFD Ltd.
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 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
19     for more details.
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
25 Class
26     Foam::processorPointPatch
28 Description
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.
39 SourceFiles
40     processorPointPatch.C
42 \*---------------------------------------------------------------------------*/
44 #ifndef processorPointPatch_H
45 #define processorPointPatch_H
47 #include "coupledFacePointPatch.H"
48 #include "processorPolyPatch.H"
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 namespace Foam
55 /*---------------------------------------------------------------------------*\
56                       Class processorPointPatch Declaration
57 \*---------------------------------------------------------------------------*/
59 class processorPointPatch
61     public coupledFacePointPatch
63     // Private data
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&);
103 public:
105     //- Runtime type information
106     TypeName(processorPolyPatch::typeName_());
109     // Constructors
111         //- Construct from components
112         processorPointPatch
113         (
114             const polyPatch& patch,
115             const pointBoundaryMesh& bm
116         );
119     // Destructor
121         virtual ~processorPointPatch();
124     // Member functions
126         //- Return true if running parallel
127         virtual bool coupled() const
128         {
129             if (Pstream::parRun())
130             {
131                 return true;
132             }
133             else
134             {
135                 return false;
136             }
137         }
139         //- Return processor number
140         int myProcNo() const
141         {
142             return procPolyPatch_.myProcNo();
143         }
145         //- Return neigbour processor number
146         int neighbProcNo() const
147         {
148             return procPolyPatch_.neighbProcNo();
149         }
151         //- Is this a master patch
152         bool isMaster() const
153         {
154             return myProcNo() < neighbProcNo();
155         }
157         //- Is this a slave patch
158         bool isSlave() const
159         {
160             return !isMaster();
161         }
163         //- Return the underlying processorPolyPatch
164         const processorPolyPatch& procPolyPatch() const
165         {
166             return procPolyPatch_;
167         }
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 } // End namespace Foam
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 #endif
179 // ************************************************************************* //