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  }
132 
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  if (Pstream::parRun())
146  {
147  return true;
148  }
149  else
150  {
151  return false;
152  }
153  }
154 
155  //- Does the patch field perform the transformation
156  virtual bool doTransform() const
157  {
158  return
159  !(
161  || procPatch_.procPolyPatch().parallel()
162  );
163  }
164 
165 
166  // Evaluation functions
167 
168  //- Evaluate the patch field
169  virtual void evaluate
170  (
171  const Pstream::commsTypes commsType =
173  )
174  {}
175 
176  //- Initialise swap of non-collocated patch point values
177  virtual void initSwapAddSeparated
178  (
179  const Pstream::commsTypes commsType,
180  Field<Type>&
181  ) const;
182 
183  //- Complete swap of patch point values and add to local values
184  virtual void swapAddSeparated
185  (
186  const Pstream::commsTypes commsType,
187  Field<Type>&
188  ) const;
189 };
190 
191 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 
194 } // End namespace Foam
195 
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 
198 #ifdef NoRepository
200 #endif
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 #endif
205 
206 // ************************************************************************* //
Foam::processorCyclicPointPatchField::clone
virtual autoPtr< pointPatchField< Type > > clone() const
Construct and return a clone.
Definition: processorCyclicPointPatchField.H:98
Foam::processorCyclicPointPatchField::swapAddSeparated
virtual void swapAddSeparated(const Pstream::commsTypes commsType, Field< Type > &) const
Complete swap of patch point values and add to local values.
Definition: processorCyclicPointPatchField.C:147
Foam::processorCyclicPointPatchField::evaluate
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Evaluate the patch field.
Definition: processorCyclicPointPatchField.H:169
coupledPointPatchField.H
processorCyclicPointPatch.H
Foam::coupledPointPatchField
A Coupled boundary condition for pointField.
Definition: coupledPointPatchField.H:52
Foam::processorCyclicPointPatchField::initSwapAddSeparated
virtual void initSwapAddSeparated(const Pstream::commsTypes commsType, Field< Type > &) const
Initialise swap of non-collocated patch point values.
Definition: processorCyclicPointPatchField.C:102
Foam::processorPointPatch::procPolyPatch
const processorPolyPatch & procPolyPatch() const
Return the underlying processorPolyPatch.
Definition: processorPointPatch.H:162
Foam::processorCyclicPointPatchField
Foam::processorCyclicPointPatchField.
Definition: processorCyclicPointPatchField.H:52
Foam::processorCyclicPointPatch
Processor patch boundary needs to be such that the ordering of points in the patch is the same on bot...
Definition: processorCyclicPointPatch.H:59
Foam::pointPatch
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:58
Foam::pointPatchFieldMapper
Foam::pointPatchFieldMapper.
Definition: pointPatchFieldMapper.H:48
Foam::coupledPolyPatch::parallel
virtual bool parallel() const
Are the cyclic planes parallel.
Definition: coupledPolyPatch.H:295
Foam::Field
Generic templated field type.
Definition: Field.H:63
processorCyclicPointPatchField.C
Foam::processorCyclicPointPatchField::~processorCyclicPointPatchField
virtual ~processorCyclicPointPatchField()
Destructor.
Definition: processorCyclicPointPatchField.C:94
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::processorCyclicPointPatchField::doTransform
virtual bool doTransform() const
Does the patch field perform the transformation.
Definition: processorCyclicPointPatchField.H:155
Foam::processorCyclicPointPatchField::coupled
virtual bool coupled() const
Return true if running parallel.
Definition: processorCyclicPointPatchField.H:142
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:69
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::processorCyclicPointPatchField::processorCyclicPointPatchField
processorCyclicPointPatchField(const pointPatch &, const DimensionedField< Type, pointMesh > &)
Construct from patch and internal field.
Definition: processorCyclicPointPatchField.C:38
Foam::UPstream::parRun
static bool & parRun() noexcept
Test if this a parallel run.
Definition: UPstream.H:433
Foam::pTraits
A traits class, which is primarily used for primitives.
Definition: pTraits.H:56
Foam::processorCyclicPointPatchField::TypeName
TypeName(processorCyclicPointPatch::typeName_())
Runtime type information.
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54
Foam::UPstream::commsTypes::blocking