cyclicAMIPointPatchField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2021 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::cyclicAMIPointPatchField
26 
27 Description
28  Cyclic AMI front and back plane patch field
29 
30 SourceFiles
31  cyclicAMIPointPatchField.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef cyclicAMIPointPatchField_H
36 #define cyclicAMIPointPatchField_H
37 
38 #include "coupledPointPatchField.H"
39 #include "cyclicAMIPointPatch.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class cyclicAMIPointPatchField Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 template<class Type>
53 :
54  public coupledPointPatchField<Type>
55 {
56  // Private Data
57 
58  //- Local reference cast into the cyclicAMI patch
59  const cyclicAMIPointPatch& cyclicAMIPatch_;
60 
61  //- Owner side patch interpolation pointer
63 
64  //- Neighbour side patch interpolation pointer
66  nbrPpiPtr_;
67 
68 
69  // Private Member Functions
70 
71  //- Owner side patch interpolation
73  {
74  if (!ppiPtr_.valid())
75  {
76  ppiPtr_.reset
77  (
79  (
80  cyclicAMIPatch_.cyclicAMIPatch()
81  )
82  );
83  }
84 
85  return ppiPtr_();
86  }
87 
88  //- Neighbour side patch interpolation
90  {
91  if (!nbrPpiPtr_.valid())
92  {
93  nbrPpiPtr_.reset
94  (
96  (
97  cyclicAMIPatch_.cyclicAMIPatch().nbrPatch()
98  )
99  );
100  }
101 
102  return nbrPpiPtr_();
103  }
104 
105 
106 public:
107 
108  //- Runtime type information
109  TypeName(cyclicAMIPointPatch::typeName_());
110 
111 
112  // Constructors
113 
114  //- Construct from patch and internal field
116  (
117  const pointPatch&,
119  );
120 
121  //- Construct from patch, internal field and dictionary
123  (
124  const pointPatch&,
126  const dictionary&
127  );
128 
129  //- Construct by mapping given patchField<Type> onto a new patch
131  (
133  const pointPatch&,
135  const pointPatchFieldMapper&
136  );
137 
138  //- Construct as copy setting internal field reference
140  (
143  );
144 
145  //- Construct and return a clone setting internal field reference
147  (
149  ) const
150  {
152  (
154  (
155  *this, iF
156  )
157  );
158  }
159 
160 
161  // Member Functions
162 
163  // Cyclic AMI coupled interface functions
164 
165  //- Return transformation between the coupled patches
166  virtual const transformer& transform() const
167  {
168  return cyclicAMIPatch_.transform();
169  }
170 
171 
172  // Evaluation functions
173 
174  //- Return true if coupled. Note that the underlying patch
175  // is not coupled() - the points don't align.
176  virtual bool coupled() const;
177 
178  //- Evaluate the patch field
179  virtual void evaluate
180  (
181  const Pstream::commsTypes commsType =
183  )
184  {}
185 
186  //- Complete swap of patch point values and add to local values
187  virtual void swapAddSeparated
188  (
189  const Pstream::commsTypes commsType,
190  Field<Type>&
191  ) const;
192 };
193 
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 } // End namespace Foam
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 #ifdef NoRepository
202  #include "cyclicAMIPointPatchField.C"
203 #endif
204 
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 
207 #endif
208 
209 // ************************************************************************* //
Interpolation class within a primitive patch. Allows interpolation from points to faces and vice vers...
Vector-tensor class used to perform translations, rotations and scaling operations in 3D space...
Definition: transformer.H:83
void reset(T *=nullptr)
If object pointer already set, delete object and set to given.
Definition: autoPtrI.H:114
const cyclicAMIPolyPatch & cyclicAMIPatch() const
Return the underlying cyclicAMIPolyPatch.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
cyclicAMIPointPatchField(const pointPatch &, const DimensionedField< Type, pointMesh > &)
Construct from patch and internal field.
commsTypes
Types of communications.
Definition: UPstream.H:64
virtual const transformer & transform() const
Return transformation between the coupled patches.
Foam::pointPatchFieldMapper.
virtual bool coupled() const
Return true if coupled. Note that the underlying patch.
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Evaluate the patch field.
virtual void swapAddSeparated(const Pstream::commsTypes commsType, Field< Type > &) const
Complete swap of patch point values and add to local values.
virtual const cyclicAMIPolyPatch & nbrPatch() const
Return a reference to the neighbour patch.
Cyclic AMI front and back plane patch field.
Pre-declare SubField and related Field type.
Definition: Field.H:56
TypeName(cyclicAMIPointPatch::typeName_())
Runtime type information.
bool valid() const
Return true if the autoPtr valid (ie, the pointer is set)
Definition: autoPtrI.H:83
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:56
virtual const transformer & transform() const
Return transformation between the coupled patches.
A Coupled boundary condition for pointField.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Cyclic AMI point patch - place holder only.
autoPtr< pointPatchField< Type > > clone() const
Disallow clone without setting internal field reference.
Namespace for OpenFOAM.