cyclicACMIPointPatchField.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) 2013-2017 OpenFOAM Foundation
9  Copyright (C) 2020 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::cyclicACMIPointPatchField
29 
30 Description
31  Cyclic ACMI front and back plane patch field
32 
33 SourceFiles
34  cyclicACMIPointPatchField.txx
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef Foam_cyclicACMIPointPatchField_H
39 #define Foam_cyclicACMIPointPatchField_H
40 
41 #include "coupledPointPatchField.H"
42 #include "cyclicACMIPointPatch.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class cyclicACMIPointPatchField Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 template<class Type>
56 :
57  public coupledPointPatchField<Type>
58 {
62  //typedef cyclicACMIPointPatch patch_type;
63 
64  // Private Data
65 
66  //- Local reference cast into the cyclicACMI patch
67  const cyclicACMIPointPatch& cyclicACMIPatch_;
68 
69  //- Owner side patch interpolation pointer
70  mutable autoPtr<patchInterp_type> ppiPtr_;
71 
72  //- Neighbour side patch interpolation pointer
73  mutable autoPtr<patchInterp_type> nbrPpiPtr_;
74 
75 
76  // Private Member Functions
77 
78  //- Owner side patch interpolation
80  {
81  if (!ppiPtr_)
82  {
83  ppiPtr_.reset
84  (
86  (
87  cyclicACMIPatch_.cyclicACMIPatch()
88  )
89  );
90  }
91  return *ppiPtr_;
92  }
93 
94  //- Neighbour side patch interpolation
96  {
97  if (!nbrPpiPtr_)
98  {
99  nbrPpiPtr_.reset
100  (
101  new patchInterp_type
102  (
103  cyclicACMIPatch_.cyclicACMIPatch().neighbPatch()
104  )
105  );
106  }
107  return *nbrPpiPtr_;
108  }
109 
110 
111 public:
112 
113  //- Runtime type information
114  TypeName(cyclicACMIPointPatch::typeName_());
115 
116 
117  // Constructors
118 
119  //- Construct from patch and internal field
121  (
122  const pointPatch&,
124  );
125 
126  //- Construct from patch, internal field and dictionary
128  (
129  const pointPatch&,
131  const dictionary&
132  );
133 
134  //- Construct by mapping onto a new patch
136  (
137  const this_bctype&,
138  const pointPatch&,
140  const pointPatchFieldMapper&
141  );
142 
143  //- Construct as copy setting internal field reference
145  (
146  const this_bctype&,
148  );
149 
150  //- No copy without an internal field
151  cyclicACMIPointPatchField(const this_bctype&) = delete;
152 
153  //- Clone with an internal field reference
155  (
157  ) const
158  {
159  return pointPatchField<Type>::Clone(*this, iF);
160  }
161 
162 
163  // Member functions
164 
165  // Constraint handling
166 
167  //- Return the constraint type this pointPatchField implements
168  virtual const word& constraintType() const
169  {
170  return cyclicACMIPointPatch::typeName;
171  }
172 
173 
174  // Cyclic AMI coupled interface functions
175 
176  //- Does the patch field perform the transformation
177  virtual bool doTransform() const
178  {
179  return
180  (
181  is_rotational_vectorspace_v<Type>
182  && !cyclicACMIPatch_.parallel()
183  );
184  }
185 
186  //- Return face transformation tensor
187  virtual const tensorField& forwardT() const
188  {
189  return cyclicACMIPatch_.forwardT();
190  }
191 
192  //- Return neighbour-cell transformation tensor
193  virtual const tensorField& reverseT() const
194  {
195  return cyclicACMIPatch_.reverseT();
196  }
197 
198 
199  // Evaluation functions
201  //- Evaluate the patch field
202  virtual void evaluate
203  (
204  const Pstream::commsTypes commsType =
206  )
207  {}
208 
209  //- Complete swap of patch point values and add to local values
210  virtual void swapAddSeparated
211  (
212  const Pstream::commsTypes commsType,
213  Field<Type>&
214  ) const;
215 
216 
217  // Member Operators
218 
219  //- Inherit assignment
221 };
222 
223 
224 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
225 
226 } // End namespace Foam
227 
228 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229 
230 #ifdef NoRepository
231  #include "cyclicACMIPointPatchField.txx"
232 #endif
233 
234 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
235 
236 #endif
237 
238 // ************************************************************************* //
Interpolation class within a primitive patch. Allows interpolation from points to faces and vice vers...
Cyclic AMI point patch - place holder only.
virtual const cyclicACMIPolyPatch & neighbPatch() const
Return a reference to the neighbour patch.
commsTypes
Communications types.
Definition: UPstream.H:81
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:130
virtual bool doTransform() const
Does the patch field perform the transformation.
Foam::pointPatchFieldMapper.
const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
virtual autoPtr< pointPatchField< Type > > clone() const
No clone without an internal field reference.
const tensorField & forwardT() const
Return face transformation tensor.
cyclicACMIPointPatchField(const pointPatch &, const DimensionedField< Type, pointMesh > &)
Construct from patch and internal field.
friend Ostream & operator(Ostream &, const pointPatchField< Type > &)
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::buffered)
Evaluate the patch field.
void reset(T *p=nullptr) noexcept
Delete managed object and set to new given pointer.
Definition: autoPtrI.H:36
A class for handling words, derived from Foam::string.
Definition: word.H:63
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
static autoPtr< pointPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
bool parallel() const
Are the cyclic planes parallel.
virtual const word & constraintType() const
Return the constraint type this pointPatchField implements.
TypeName(cyclicACMIPointPatch::typeName_())
Runtime type information.
virtual const tensorField & forwardT() const
Return face transformation tensor.
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:64
A Coupled boundary condition for pointField.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Cyclic ACMI front and back plane patch field.
virtual void swapAddSeparated(const Pstream::commsTypes commsType, Field< Type > &) const
Complete swap of patch point values and add to local values.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
"buffered" : (MPI_Bsend, MPI_Recv)
Namespace for OpenFOAM.
const cyclicACMIPolyPatch & cyclicACMIPatch() const
Return the underlying cyclicAMIPolyPatch.