processorPointPatch.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
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 
46 #include "coupledFacePointPatch.H"
47 #include "processorPolyPatch.H"
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  mutable labelList reverseMeshPoints_;
67 
68 
69  // Private Member Functions
70 
71  //- Initialise the calculation of the patch geometry
72  virtual void initCalcGeometry(PstreamBuffers&);
73 
74  //- Calculate the patch geometry
75  virtual void calcGeometry(PstreamBuffers&);
76 
77  //- Initialise the patches for moving points
78  virtual void initMovePoints(PstreamBuffers&, const pointField&);
79 
80  //- Correct patches after moving points
81  virtual void movePoints(PstreamBuffers&, const pointField&);
82 
83  //- Initialise the update of the patch topology
84  virtual void initTopoChange(PstreamBuffers&);
85 
86  //- Update of the patch topology
87  virtual void topoChange(PstreamBuffers&);
88 
89 
90  //- Disallow default bitwise copy construction
92 
93  //- Disallow default bitwise assignment
94  void operator=(const processorPointPatch&);
95 
96 public:
97 
98  //- Runtime type information
99  TypeName(processorPolyPatch::typeName_());
100 
101 
102  // Constructors
103 
104  //- Construct from components
106  (
107  const polyPatch& patch,
108  const pointBoundaryMesh& bm
109  );
110 
111 
112  //- Destructor
113  virtual ~processorPointPatch();
114 
115 
116  // Member Functions
117 
118  //- Return message tag to use for communication
119  virtual int tag() const
120  {
121  return procPolyPatch_.tag();
122  }
123 
124  //- Return communicator used for communication
125  virtual label comm() const
126  {
127  return procPolyPatch_.comm();
128  }
129 
130  //- Return processor number
131  int myProcNo() const
132  {
133  return procPolyPatch_.myProcNo();
134  }
135 
136  //- Return neighbour processor number
137  int neighbProcNo() const
138  {
139  return procPolyPatch_.neighbProcNo();
140  }
141 
142  //- Is this a master patch
143  bool isMaster() const
144  {
145  return myProcNo() < neighbProcNo();
146  }
147 
148  //- Is this a slave patch
149  bool isSlave() const
150  {
151  return !isMaster();
152  }
153 
154  //- Return mesh points in the correct order for the receiving side
155  const labelList& reverseMeshPoints() const;
156 };
157 
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 } // End namespace Foam
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 #endif
166 
167 // ************************************************************************* //
Buffers for inter-processor communications streams (UOPstream, UIPstream).
coupled patch for post-processing. Used as the base class for processor and cyclic pointPatches
friend class processorPointPatch
const polyPatch & patch() const
Return the polyPatch.
Foam::pointBoundaryMesh.
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:70
Processor patch boundary needs to be such that the ordering of points in the patch is the same on bot...
int myProcNo() const
Return processor number.
int neighbProcNo() const
Return neighbour processor number.
bool isMaster() const
Is this a master patch.
virtual label comm() const
Return communicator used for communication.
TypeName(processorPolyPatch::typeName_())
Runtime type information.
bool isSlave() const
Is this a slave patch.
const labelList & reverseMeshPoints() const
Return mesh points in the correct order for the receiving side.
virtual int tag() const
Return message tag to use for communication.
virtual ~processorPointPatch()
Destructor.
Neighbour processor patch.
int myProcNo() const
Return processor number.
int neighbProcNo() const
Return neighbour processor number.
virtual label comm() const
Return communicator used for communication.
virtual int tag() const
Return message tag to use for communication.
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59