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