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 -------------------------------------------------------------------------------
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::processorCyclicPointPatchField
28 
29 Description
30  Foam::processorCyclicPointPatchField
31 
32 SourceFiles
33  processorCyclicPointPatchField.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef processorCyclicPointPatchField_H
38 #define processorCyclicPointPatchField_H
39 
40 #include "coupledPointPatchField.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class processorCyclicPointPatchField Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 template<class Type>
54 :
55  public coupledPointPatchField<Type>
56 {
57  // Private data
58 
59  //- Local reference to processor patch
60  const processorCyclicPointPatch& procPatch_;
61 
62  //- Receive buffer for non-blocking communication
63  mutable Field<Type> receiveBuf_;
64 
65 
66 public:
67 
68  //- Runtime type information
69  TypeName(processorCyclicPointPatch::typeName_());
70 
71 
72  // Constructors
73 
74  //- Construct from patch and internal field
76  (
77  const pointPatch&,
79  );
80 
81  //- Construct from patch, internal field and dictionary
83  (
84  const pointPatch&,
86  const dictionary&
87  );
88 
89  //- Construct by mapping given patchField<Type> onto a new patch
91  (
93  const pointPatch&,
96  );
97 
98  //- Construct and return a clone
99  virtual autoPtr<pointPatchField<Type>> clone() const
100  {
102  (
104  (
105  *this
106  )
107  );
108  }
109 
110  //- Construct as copy setting internal field reference
112  (
115  );
116 
117  //- Construct and return a clone setting internal field reference
119  (
121  ) const
122  {
124  (
126  (
127  *this,
128  iF
129  )
130  );
131  }
133 
134  //- Destructor
136 
137 
138  // Member functions
139 
140  // Access
141 
142  //- Return true if running parallel
143  virtual bool coupled() const
144  {
145  return Pstream::parRun();
146  }
147 
148  //- Does the patch field perform the transformation
149  virtual bool doTransform() const
150  {
151  return
152  !(
154  || procPatch_.procPolyPatch().parallel()
155  );
156  }
157 
158 
159  // Evaluation functions
161  //- Evaluate the patch field
162  virtual void evaluate
163  (
164  const Pstream::commsTypes commsType =
166  )
167  {}
169  //- Initialise swap of non-collocated patch point values
170  virtual void initSwapAddSeparated
171  (
172  const Pstream::commsTypes commsType,
173  Field<Type>&
174  ) const;
175 
176  //- Complete swap of patch point values and add to local values
177  virtual void swapAddSeparated
178  (
179  const Pstream::commsTypes commsType,
180  Field<Type>&
181  ) const;
182 };
183 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 } // End namespace Foam
188 
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 
191 #ifdef NoRepository
193 #endif
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 #endif
198 
199 // ************************************************************************* //
Foam::processorCyclicPointPatchField.
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
Types of communications.
Definition: UPstream.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:120
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.
Definition: pTraits.H:50
static bool & parRun() noexcept
Test if this a parallel run.
Definition: UPstream.H:639
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:61
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.