Loading...
Searching...
No Matches
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{
57/*---------------------------------------------------------------------------*\
58 Class processorPointPatch Declaration
59\*---------------------------------------------------------------------------*/
60
61class processorPointPatch
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
94 processorPointPatch(const processorPointPatch&) = delete;
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 //- Construct given the original patch and a map
116 (
117 const processorPointPatch& patch,
118 const pointBoundaryMesh& bm,
119 const label index,
120 const labelUList& mapAddressing,
121 const labelUList& reversePointMap
122 );
123
124 //- Construct and return a subset clone,
125 //- resetting the point list and boundary mesh
127 (
128 const pointBoundaryMesh& bm,
129 const label index,
130 const labelUList& mapAddressing,
131 const labelUList& reversePointMap
132 ) const
133 {
135 (
136 *this,
137 bm,
138 index,
139 mapAddressing,
140 reversePointMap
141 );
142 }
143
144
145 //- Destructor
146 virtual ~processorPointPatch() = default;
147
148
149 // Member Functions
150
151 //- Return message tag to use for communication
152 virtual int tag() const
153 {
154 return procPolyPatch_.tag();
155 }
156
157 //- Return communicator used for communication
158 virtual label comm() const
159 {
160 return procPolyPatch_.comm();
161 }
162
163 //- Return the constraint type this pointPatch implements.
164 virtual const word& constraintType() const
165 {
166 return type();
168
169 //- Return processor number
170 int myProcNo() const noexcept
171 {
172 return procPolyPatch_.myProcNo();
173 }
174
175 //- Return neighbour processor number
176 int neighbProcNo() const noexcept
177 {
178 return procPolyPatch_.neighbProcNo();
179 }
180
181 //- Does the processor own the patch ?
182 bool owner() const
184 return procPolyPatch_.owner();
185 }
186
187 //- Is the processor the patch neighbour ?
188 bool neighbour() const
189 {
190 return !owner();
192
193 //- Return the underlying processorPolyPatch
195 {
196 return procPolyPatch_;
197 }
198
199 //- Return mesh points in the correct order for the receiving side
201 {
202 return reverseMeshPoints_;
203 }
204};
205
206
207// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208
209} // End namespace Foam
210
211// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212
213#endif
214
215// ************************************************************************* //
Buffers for inter-processor communications streams (UOPstream, UIPstream).
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
static autoPtr< T > NewFrom(Args &&... args)
Construct autoPtr from derived type with forwarding arguments.
Definition autoPtr.H:193
coupledFacePointPatch(const coupledFacePointPatch &)=delete
No copy construct.
friend class processorPointPatch
virtual label index() const
Return the index of this patch in the pointBoundaryMesh.
virtual const polyPatch & patch() const
Return the polyPatch.
A pointBoundaryMesh is a pointPatch list with registered IO, a reference to the associated pointMesh,...
A patch is a list of labels that address the faces in the global face list.
Definition polyPatch.H:73
bool owner() const
Does the processor own the patch ?
const processorPolyPatch & procPolyPatch() const noexcept
Return the underlying processorPolyPatch.
virtual ~processorPointPatch()=default
Destructor.
virtual const word & constraintType() const
Return the constraint type this pointPatch implements.
int neighbProcNo() const noexcept
Return neighbour processor number.
virtual autoPtr< pointPatch > clone(const pointBoundaryMesh &bm, const label index, const labelUList &mapAddressing, const labelUList &reversePointMap) const
Construct and return a subset clone, resetting the point list and boundary mesh.
virtual label comm() const
Return communicator used for communication.
TypeName(processorPolyPatch::typeName_())
Runtime type information.
int myProcNo() const noexcept
Return processor number.
bool neighbour() const
Is the processor the patch neighbour ?
const labelList & reverseMeshPoints() const noexcept
Return mesh points in the correct order for the receiving side.
virtual int tag() const
Return message tag to use for communication.
Neighbour processor patch.
virtual label comm() const
Return communicator used for communication.
int myProcNo() const noexcept
Return processor number.
A class for handling words, derived from Foam::string.
Definition word.H:66
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition List.H:62
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition POSIX.C:801
const direction noexcept
Definition scalarImpl.H:265
vectorField pointField
pointField is a vectorField.
UList< label > labelUList
A UList of labels.
Definition UList.H:75
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68