processorCyclicPointPatchField.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-2017 OpenFOAM Foundation
9  Copyright (C) 2023 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::processorCyclicPointPatchField
29 
30 Description
31  Foam::processorCyclicPointPatchField
32 
33 SourceFiles
34  processorCyclicPointPatchField.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef Foam_processorCyclicPointPatchField_H
39 #define Foam_processorCyclicPointPatchField_H
40 
41 #include "coupledPointPatchField.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class processorCyclicPointPatchField Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 template<class Type>
55 :
56  public coupledPointPatchField<Type>
57 {
58  // Private Data
59 
60  //- Local reference to processor patch
61  const processorCyclicPointPatch& procPatch_;
62 
63  //- Send buffer for non-blocking communication
64  mutable Field<Type> sendBuf_;
65 
66  //- Receive buffer for non-blocking communication
67  mutable Field<Type> recvBuf_;
68 
69 
70 public:
71 
72  //- Runtime type information
73  TypeName(processorCyclicPointPatch::typeName_());
74 
75 
76  // Constructors
77 
78  //- Construct from patch and internal field
80  (
81  const pointPatch&,
83  );
84 
85  //- Construct from patch, internal field and dictionary
87  (
88  const pointPatch&,
90  const dictionary&
91  );
92 
93  //- Construct by mapping given patch field onto a new patch
95  (
97  const pointPatch&,
100  );
101 
102  //- Construct and return a clone
103  virtual autoPtr<pointPatchField<Type>> clone() const
104  {
106  (
108  (
109  *this
110  )
111  );
112  }
113 
114  //- Construct as copy setting internal field reference
116  (
119  );
120 
121  //- Construct and return a clone setting internal field reference
123  (
125  ) const
126  {
128  (
130  (
131  *this,
132  iF
133  )
134  );
135  }
136 
137 
138  //- Destructor
139  virtual ~processorCyclicPointPatchField() = default;
140 
141 
142  // Member functions
143 
144  // Access
145 
146  //- Return true if running parallel
147  virtual bool coupled() const
148  {
149  return Pstream::parRun();
150  }
151 
152  //- Does the patch field perform the transformation
153  virtual bool doTransform() const
154  {
155  return
156  (
158  && !procPatch_.procPolyPatch().parallel()
159  );
160  }
161 
162 
163  // Evaluation functions
164 
165  //- Evaluate the patch field
166  virtual void evaluate
167  (
168  const Pstream::commsTypes commsType =
170  )
171  {}
172 
173  //- Initialise swap of non-collocated patch point values
174  virtual void initSwapAddSeparated
175  (
176  const Pstream::commsTypes commsType,
177  Field<Type>&
178  ) const;
179 
180  //- Complete swap of patch point values and add to local values
181  virtual void swapAddSeparated
182  (
183  const Pstream::commsTypes commsType,
184  Field<Type>&
185  ) const;
186 };
187 
188 
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 } // End namespace Foam
192 
193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 
195 #ifdef NoRepository
197 #endif
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 #endif
202 
203 // ************************************************************************* //
Foam::processorCyclicPointPatchField.
virtual ~processorCyclicPointPatchField()=default
Destructor.
virtual bool doTransform() const
Does the patch field perform the transformation.
"blocking" : (MPI_Bsend, MPI_Recv)
processorCyclicPointPatchField(const pointPatch &, const DimensionedField< Type, pointMesh > &)
Construct from patch and internal field.
commsTypes
Communications types.
Definition: UPstream.H:72
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
Processor patch boundary needs to be such that the ordering of points in the patch is the same on bot...
Foam::pointPatchFieldMapper.
A traits class, which is primarily used for primitives and vector-space.
Definition: pTraits.H:75
static bool & parRun() noexcept
Test if this a parallel run.
Definition: UPstream.H:1049
virtual void initSwapAddSeparated(const Pstream::commsTypes commsType, Field< Type > &) const
Initialise swap of non-collocated patch point values.
virtual bool parallel() const
Are the cyclic planes parallel.
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Evaluate the patch field.
Generic templated field type.
Definition: Field.H:62
virtual bool coupled() const
Return true if running parallel.
TypeName(processorCyclicPointPatch::typeName_())
Runtime type information.
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:61
A Coupled boundary condition for pointField.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: areaFieldsFwd.H:42
virtual autoPtr< pointPatchField< Type > > clone() const
Construct and return a clone.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
virtual void swapAddSeparated(const Pstream::commsTypes commsType, Field< Type > &) const
Complete swap of patch point values and add to local values.
const processorPolyPatch & procPolyPatch() const
Return the underlying processorPolyPatch.
Namespace for OpenFOAM.