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-2018 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 initGeometry(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 initUpdateMesh(PstreamBuffers&);
85 
86  //- Update of the patch topology
87  virtual void updateMesh(PstreamBuffers&);
88 
89 
90  //- Disallow default construct as copy
92 
93  //- Disallow default 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 the constraint type this pointPatch implements.
131  virtual const word& constraintType() const
132  {
133  return type();
134  }
135 
136  //- Return processor number
137  int myProcNo() const
138  {
139  return procPolyPatch_.myProcNo();
140  }
141 
142  //- Return neighbour processor number
143  int neighbProcNo() const
144  {
145  return procPolyPatch_.neighbProcNo();
146  }
147 
148  //- Is this a master patch
149  bool isMaster() const
150  {
151  return myProcNo() < neighbProcNo();
152  }
153 
154  //- Is this a slave patch
155  bool isSlave() const
156  {
157  return !isMaster();
158  }
159 
160  //- Return the underlying processorPolyPatch
161  const processorPolyPatch& procPolyPatch() const
162  {
163  return procPolyPatch_;
164  }
165 
166  //- Return mesh points in the correct order for the receiving side
167  const labelList& reverseMeshPoints() const;
168 
169 };
170 
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 } // End namespace Foam
175 
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
178 #endif
179 
180 // ************************************************************************* //
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
bool isSlave() const
Is this a slave patch.
Foam::pointBoundaryMesh.
virtual label comm() const
Return communicator used for communication.
int myProcNo() const
Return processor number.
coupled patch for post-processing. Used as the base class for processor and cyclic pointPatches ...
const labelList & reverseMeshPoints() const
Return mesh points in the correct order for the receiving side.
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.
bool isMaster() const
Is this a master patch.
virtual int tag() const
Return message tag to use for communication.
Neighbour processor patch.
virtual label comm() const
Return communicator used for communication.
A class for handling words, derived from string.
Definition: word.H:59
virtual int tag() const
Return message tag to use for communication.
int neighbProcNo() const
Return neighbour processor number.
virtual const word & constraintType() const
Return the constraint type this pointPatch implements.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
fileName::Type type(const fileName &, const bool followLink=true)
Return the file type: DIRECTORY or FILE.
Definition: POSIX.C:481
const polyPatch & patch() const
Return the polyPatch.
int neighbProcNo() const
Return neighbour processor number.
TypeName(processorPolyPatch::typeName_())
Runtime type information.
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
const processorPolyPatch & procPolyPatch() const
Return the underlying processorPolyPatch.
virtual ~processorPointPatch()
Destructor.
Namespace for OpenFOAM.