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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2013 OpenFOAM Foundation
9 Copyright (C) 2022 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::processorPointPatch
29
30Description
31 Processor patch boundary needs to be such that the ordering of
32 points in the patch is the same on both sides.
33
34 Looking at the creation of the faces on both sides of the processor
35 patch they need to be identical on both sides with the normals pointing
36 in opposite directions. This is achieved by calling the reverseFace
37 function in the decomposition. It is therefore possible to re-create
38 the ordering of patch points on the neighbour side by reversing all the
39 patch faces of the owner.
40
41SourceFiles
42 processorPointPatch.C
43
44\*---------------------------------------------------------------------------*/
45
46#ifndef Foam_processorPointPatch_H
47#define Foam_processorPointPatch_H
48
50#include "processorPolyPatch.H"
51
52// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53
54namespace Foam
55{
56
57/*---------------------------------------------------------------------------*\
58 Class processorPointPatch Declaration
59\*---------------------------------------------------------------------------*/
62:
64{
65 // Private Data
66
67 const processorPolyPatch& procPolyPatch_;
68
69 mutable labelList reverseMeshPoints_;
70
71
72 // Private Member Functions
73
74 //- Initialise the calculation of the patch geometry
75 virtual void initGeometry(PstreamBuffers&);
76
77 //- Calculate the patch geometry
78 virtual void calcGeometry(PstreamBuffers&);
79
80 //- Initialise the patches for moving points
81 virtual void initMovePoints(PstreamBuffers&, const pointField&);
82
83 //- Correct patches after moving points
84 virtual void movePoints(PstreamBuffers&, const pointField&);
85
86 //- Initialise the update of the patch topology
87 virtual void initUpdateMesh(PstreamBuffers&);
88
89 //- Update of the patch topology
90 virtual void updateMesh(PstreamBuffers&);
91
92
93 //- No copy construct
95
96 //- No copy assignment
97 void operator=(const processorPointPatch&) = delete;
98
99public:
100
101 //- Runtime type information
102 TypeName(processorPolyPatch::typeName_());
103
104
105 // Constructors
106
107 //- Construct from components
109 (
110 const polyPatch& patch,
111 const pointBoundaryMesh& bm
112 );
113
114
115 //- Destructor
116 virtual ~processorPointPatch() = default;
117
118
119 // Member Functions
120
121 //- Return message tag to use for communication
122 virtual int tag() const
123 {
124 return procPolyPatch_.tag();
125 }
126
127 //- Return communicator used for communication
128 virtual label comm() const
129 {
130 return procPolyPatch_.comm();
131 }
132
133 //- Return the constraint type this pointPatch implements.
134 virtual const word& constraintType() const
135 {
136 return type();
137 }
138
139 //- Return processor number
140 int myProcNo() const
141 {
142 return procPolyPatch_.myProcNo();
143 }
144
145 //- Return neighbour processor number
146 int neighbProcNo() const
147 {
148 return procPolyPatch_.neighbProcNo();
149 }
150
151 //- Does the processor own the patch ?
152 bool owner() const
153 {
154 return procPolyPatch_.owner();
155 }
156
157 //- Is the processor the patch neighbour ?
158 bool neighbour() const
159 {
160 return !owner();
161 }
162
163 //- Return the underlying processorPolyPatch
164 const processorPolyPatch& procPolyPatch() const
165 {
166 return procPolyPatch_;
167 }
168
169 //- Return mesh points in the correct order for the receiving side
170 const labelList& reverseMeshPoints() const
171 {
172 return reverseMeshPoints_;
173 }
174};
175
176
177// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178
179} // End namespace Foam
180
181// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182
183#endif
184
185// ************************************************************************* //
Buffers for inter-processor communications streams (UOPstream, UIPstream).
coupled patch for post-processing. Used as the base class for processor and cyclic pointPatches
virtual 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:75
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.
const labelList & reverseMeshPoints() const
Return mesh points in the correct order for the receiving side.
bool owner() const
Does the processor own the patch ?
int neighbProcNo() const
Return neighbour processor number.
virtual ~processorPointPatch()=default
Destructor.
virtual const word & constraintType() const
Return the constraint type this pointPatch implements.
virtual label comm() const
Return communicator used for communication.
TypeName(processorPolyPatch::typeName_())
Runtime type information.
bool neighbour() const
Is the processor the patch neighbour ?
virtual int tag() const
Return message tag to use for communication.
const processorPolyPatch & procPolyPatch() const
Return the underlying processorPolyPatch.
Neighbour processor patch.
int myProcNo() const
Return processor number.
virtual bool owner() const
Does the processor own the patch ?
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.
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:598
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73