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-2023 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 public:
91 
92  //- Runtime type information
93  TypeName(processorPolyPatch::typeName_());
94 
95 
96  // Constructors
97 
98  //- Construct from components
100  (
101  const polyPatch& patch,
102  const pointBoundaryMesh& bm
103  );
104 
105  //- Disallow default bitwise copy construction
106  processorPointPatch(const processorPointPatch&) = delete;
107 
108 
109  //- Destructor
110  virtual ~processorPointPatch();
111 
112 
113  // Member Functions
114 
115  //- Return message tag to use for communication
116  virtual int tag() const
117  {
118  return procPolyPatch_.tag();
119  }
120 
121  //- Return communicator used for communication
122  virtual label comm() const
123  {
124  return procPolyPatch_.comm();
125  }
126 
127  //- Return processor number
128  int myProcNo() const
129  {
130  return procPolyPatch_.myProcNo();
131  }
132 
133  //- Return neighbour processor number
134  int neighbProcNo() const
135  {
136  return procPolyPatch_.neighbProcNo();
137  }
138 
139  //- Is this a master patch
140  bool isMaster() const
141  {
142  return myProcNo() < neighbProcNo();
143  }
144 
145  //- Is this a slave patch
146  bool isSlave() const
147  {
148  return !isMaster();
149  }
150 
151  //- Return mesh points in the correct order for the receiving side
152  const labelList& reverseMeshPoints() const;
153 
154 
155  // Member Operators
156 
157  //- Disallow default bitwise assignment
158  void operator=(const processorPointPatch&) = delete;
159 };
160 
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 } // End namespace Foam
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 #endif
169 
170 // ************************************************************************* //
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.
void operator=(const processorPointPatch &)=delete
Disallow default bitwise assignment.
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