FreeFOAM The Cross-Platform CFD Toolkit
processorPointPatch.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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.
20 
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/>.
23 
24 Class
25  Foam::processorPointPatch
26 
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.
30 
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.
37 
38 SourceFiles
39  processorPointPatch.C
40 
41 \*---------------------------------------------------------------------------*/
42 
43 #ifndef processorPointPatch_H
44 #define processorPointPatch_H
45 
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
51 namespace Foam
52 {
53 
54 /*---------------------------------------------------------------------------*\
55  Class processorPointPatch Declaration
56 \*---------------------------------------------------------------------------*/
57 
59 :
61 {
62  // Private data
63 
64  const processorPolyPatch& procPolyPatch_;
65 
66 
67  // Private Member Functions
68 
69  //- Initialise the calculation of the patch geometry
70  virtual void initGeometry();
71 
72  //- Calculate the patch geometry
73  virtual void calcGeometry();
74 
75  //- Initialise the points on this patch which are should also be
76  // on a neighbouring patch but are not part of faces of that patch
77  void initPatchPatchPoints();
78 
79  //- Calculate the points on this patch which are should also be
80  // on a neighbouring patch but are not part of faces of that patch
81  void calcPatchPatchPoints();
82 
83  //- Initialise the patches for moving points
84  virtual void initMovePoints(const pointField&);
85 
86  //- Correct patches after moving points
87  virtual void movePoints(const pointField&);
88 
89  //- Initialise the update of the patch topology
90  virtual void initUpdateMesh();
91 
92  //- Update of the patch topology
93  virtual void updateMesh();
94 
95 
96  //- Disallow default construct as copy
98 
99  //- Disallow default assignment
100  void operator=(const processorPointPatch&);
101 
102 public:
103 
104  //- Runtime type information
105  TypeName(processorPolyPatch::typeName_());
106 
107 
108  // Constructors
109 
110  //- Construct from components
112  (
113  const polyPatch& patch,
114  const pointBoundaryMesh& bm
115  );
116 
117 
118  // Destructor
119 
120  virtual ~processorPointPatch();
121 
122 
123  // Member functions
124 
125  //- Return true if running parallel
126  virtual bool coupled() const
127  {
128  if (Pstream::parRun())
129  {
130  return true;
131  }
132  else
133  {
134  return false;
135  }
136  }
137 
138  //- Return processor number
139  int myProcNo() const
140  {
141  return procPolyPatch_.myProcNo();
142  }
143 
144  //- Return neigbour processor number
145  int neighbProcNo() const
146  {
147  return procPolyPatch_.neighbProcNo();
148  }
149 
150  //- Is this a master patch
151  bool isMaster() const
152  {
153  return myProcNo() < neighbProcNo();
154  }
155 
156  //- Is this a slave patch
157  bool isSlave() const
158  {
159  return !isMaster();
160  }
161 
162  //- Return the underlying processorPolyPatch
164  {
165  return procPolyPatch_;
166  }
167 };
168 
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 } // End namespace Foam
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 #endif
177 
178 // ************************ vim: set sw=4 sts=4 et: ************************ //