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 | Copyright (C) 2011-2013 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 
65 
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 neigbour 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 // ************************************************************************* //
Foam::processorPointPatch::updateMesh
virtual void updateMesh(PstreamBuffers &)
Update of the patch topology.
Definition: processorPointPatch.C:98
Foam::processorPointPatch::neighbProcNo
int neighbProcNo() const
Return neigbour processor number.
Definition: processorPointPatch.H:142
Foam::processorPointPatch::operator=
void operator=(const processorPointPatch &)
Disallow default assignment.
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::processorPointPatch::procPolyPatch
const processorPolyPatch & procPolyPatch() const
Return the underlying processorPolyPatch.
Definition: processorPointPatch.H:160
Foam::PstreamBuffers
Buffers for inter-processor communications streams (UOPstream, UIPstream).
Definition: PstreamBuffers.H:85
Foam::processorPolyPatch::neighbProcNo
int neighbProcNo() const
Return neigbour processor number.
Definition: processorPolyPatch.H:255
Foam::processorPointPatch::constraintType
virtual const word & constraintType() const
Return the constraint type this pointPatch implements.
Definition: processorPointPatch.H:130
Foam::processorPointPatch::procPolyPatch_
const processorPolyPatch & procPolyPatch_
Definition: processorPointPatch.H:63
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:57
Foam::processorPointPatch::reverseMeshPoints
const labelList & reverseMeshPoints() const
Return mesh points in the correct order for the receiving side.
Definition: processorPointPatch.C:126
Foam::processorPointPatch::initMovePoints
virtual void initMovePoints(PstreamBuffers &, const pointField &)
Initialise the patches for moving points.
Definition: processorPointPatch.C:80
Foam::processorPointPatch::isSlave
bool isSlave() const
Is this a slave patch.
Definition: processorPointPatch.H:154
Foam::processorPointPatch::initGeometry
virtual void initGeometry(PstreamBuffers &)
Initialise the calculation of the patch geometry.
Definition: processorPointPatch.C:50
Foam::processorPointPatch::movePoints
virtual void movePoints(PstreamBuffers &, const pointField &)
Correct patches after moving points.
Definition: processorPointPatch.C:87
Foam::facePointPatch::processorPointPatch
friend class processorPointPatch
Definition: facePointPatch.H:102
Foam::processorPointPatch::reverseMeshPoints_
labelList reverseMeshPoints_
Definition: processorPointPatch.H:65
Foam::label
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
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
Foam::processorPointPatch::comm
virtual label comm() const
Return communicator used for communication.
Definition: processorPointPatch.H:124
Foam::processorPolyPatch
Neighbour processor patch.
Definition: processorPolyPatch.H:55
Foam::processorPointPatch::myProcNo
int myProcNo() const
Return processor number.
Definition: processorPointPatch.H:136
Foam::facePointPatch::patch
const polyPatch & patch() const
Return the polyPatch.
Definition: facePointPatch.H:150
Foam::coupledFacePointPatch
coupled patch for post-processing. Used as the base class for processor and cyclic pointPatches
Definition: coupledFacePointPatch.H:53
Foam::processorPointPatch::isMaster
bool isMaster() const
Is this a master patch.
Definition: processorPointPatch.H:148
processorPolyPatch.H
Foam::processorPointPatch::initUpdateMesh
virtual void initUpdateMesh(PstreamBuffers &)
Initialise the update of the patch topology.
Definition: processorPointPatch.C:91
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::pointBoundaryMesh
Foam::pointBoundaryMesh.
Definition: pointBoundaryMesh.H:52
Foam::processorPolyPatch::tag
virtual int tag() const
Return message tag to use for communication.
Definition: processorPolyPatch.H:297
Foam::processorPointPatch::~processorPointPatch
virtual ~processorPointPatch()
Destructor.
Definition: processorPointPatch.C:120
Foam::processorPointPatch::tag
virtual int tag() const
Return message tag to use for communication.
Definition: processorPointPatch.H:118
coupledFacePointPatch.H
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::processorPolyPatch::comm
virtual label comm() const
Return communicator used for communication.
Definition: processorPolyPatch.H:303
Foam::processorPointPatch::TypeName
TypeName(processorPolyPatch::typeName_())
Runtime type information.
Foam::processorPolyPatch::myProcNo
int myProcNo() const
Return processor number.
Definition: processorPolyPatch.H:249
Foam::processorPointPatch::calcGeometry
virtual void calcGeometry(PstreamBuffers &)
Calculate the patch geometry.
Definition: processorPointPatch.C:75
Foam::type
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
Definition: POSIX.C:588