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 -------------------------------------------------------------------------------
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::cyclicACMIPointPatchField
28 
29 Description
30  Cyclic ACMI front and back plane patch field
31 
32 SourceFiles
33  cyclicACMIPointPatchField.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef cyclicACMIPointPatchField_H
38 #define cyclicACMIPointPatchField_H
39 
40 #include "coupledPointPatchField.H"
41 #include "cyclicACMIPointPatch.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class cyclicACMIPointPatchField Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 template<class Type>
55 :
56  public coupledPointPatchField<Type>
57 {
58  // Private data
59 
60  //- Local reference cast into the cyclicACMI patch
61  const cyclicACMIPointPatch& cyclicACMIPatch_;
62 
63  //- Owner side patch interpolation pointer
65 
66  //- Neighbour side patch interpolation pointer
68  nbrPpiPtr_;
69 
70 
71  // Private Member Functions
72 
73  //- Owner side patch interpolation
75  {
76  if (!ppiPtr_.valid())
77  {
78  ppiPtr_.reset
79  (
81  (
82  cyclicACMIPatch_.cyclicACMIPatch()
83  )
84  );
85  }
86 
87  return *ppiPtr_;
88  }
89 
90  //- Neighbour side patch interpolation
92  {
93  if (!nbrPpiPtr_.valid())
94  {
95  nbrPpiPtr_.reset
96  (
98  (
99  cyclicACMIPatch_.cyclicACMIPatch().neighbPatch()
100  )
101  );
102  }
103 
104  return *nbrPpiPtr_;
105  }
106 
107 
108 public:
109 
110  //- Runtime type information
111  TypeName(cyclicACMIPointPatch::typeName_());
112 
113 
114  // Constructors
115 
116  //- Construct from patch and internal field
118  (
119  const pointPatch&,
121  );
122 
123  //- Construct from patch, internal field and dictionary
125  (
126  const pointPatch&,
128  const dictionary&
129  );
130 
131  //- Construct by mapping given patchField<Type> onto a new patch
133  (
135  const pointPatch&,
137  const pointPatchFieldMapper&
138  );
139 
140  //- Construct and return a clone
141  virtual autoPtr<pointPatchField<Type>> clone() const
142  {
144  (
146  (
147  *this
148  )
149  );
150  }
151 
152  //- Construct as copy setting internal field reference
154  (
157  );
158 
159  //- Construct and return a clone setting internal field reference
161  (
163  ) const
164  {
166  (
168  (
169  *this, iF
170  )
171  );
172  }
173 
174 
175  // Member functions
176 
177  // Constraint handling
178 
179  //- Return the constraint type this pointPatchField implements
180  virtual const word& constraintType() const
181  {
182  return cyclicACMIPointPatch::typeName;
183  }
184 
185 
186  // Cyclic AMI coupled interface functions
187 
188  //- Does the patch field perform the transformation
189  virtual bool doTransform() const
190  {
191  return
192  !(
193  cyclicACMIPatch_.parallel()
194  || pTraits<Type>::rank == 0
195  );
196  }
197 
198  //- Return face transformation tensor
199  virtual const tensorField& forwardT() const
200  {
201  return cyclicACMIPatch_.forwardT();
202  }
203 
204  //- Return neighbour-cell transformation tensor
205  virtual const tensorField& reverseT() const
206  {
207  return cyclicACMIPatch_.reverseT();
208  }
209 
210 
211  // Evaluation functions
212 
213  //- Evaluate the patch field
214  virtual void evaluate
215  (
216  const Pstream::commsTypes commsType =
218  )
219  {}
220 
221  //- Complete swap of patch point values and add to local values
222  virtual void swapAddSeparated
223  (
224  const Pstream::commsTypes commsType,
225  Field<Type>&
226  ) const;
227 };
228 
229 
230 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
231 
232 } // End namespace Foam
233 
234 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
235 
236 #ifdef NoRepository
237  #include "cyclicACMIPointPatchField.C"
238 #endif
239 
240 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
241 
242 #endif
243 
244 // ************************************************************************* //
Foam::autoPtr::reset
void reset(T *p=nullptr) noexcept
Delete managed object and set to new given pointer.
Definition: autoPtrI.H:109
Foam::UPstream::commsTypes::blocking
coupledPointPatchField.H
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::coupledPointPatchField
A Coupled boundary condition for pointField.
Definition: coupledPointPatchField.H:52
PrimitivePatchInterpolation.H
Foam::cyclicACMIPointPatch::forwardT
const tensorField & forwardT() const
Return face transformation tensor.
Definition: cyclicACMIPointPatch.H:150
cyclicACMIPointPatch.H
Foam::cyclicACMIPointPatchField::evaluate
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Evaluate the patch field.
Definition: cyclicACMIPointPatchField.H:214
Foam::cyclicACMIPointPatchField::swapAddSeparated
virtual void swapAddSeparated(const Pstream::commsTypes commsType, Field< Type > &) const
Complete swap of patch point values and add to local values.
Definition: cyclicACMIPointPatchField.C:116
Foam::cyclicACMIPointPatch::cyclicACMIPatch
const cyclicACMIPolyPatch & cyclicACMIPatch() const
Return the underlying cyclicAMIPolyPatch.
Definition: cyclicACMIPointPatch.H:130
Foam::autoPtr::valid
bool valid() const noexcept
True if the managed pointer is non-null.
Definition: autoPtr.H:148
Foam::cyclicACMIPointPatchField::reverseT
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
Definition: cyclicACMIPointPatchField.H:204
Foam::pointPatch
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:58
Foam::cyclicACMIPointPatchField::TypeName
TypeName(cyclicACMIPointPatch::typeName_())
Runtime type information.
Foam::pointPatchFieldMapper
Foam::pointPatchFieldMapper.
Definition: pointPatchFieldMapper.H:48
Foam::cyclicACMIPointPatchField::clone
virtual autoPtr< pointPatchField< Type > > clone() const
Construct and return a clone.
Definition: cyclicACMIPointPatchField.H:140
Foam::cyclicACMIPointPatchField::forwardT
virtual const tensorField & forwardT() const
Return face transformation tensor.
Definition: cyclicACMIPointPatchField.H:198
Foam::cyclicACMIPointPatchField::constraintType
virtual const word & constraintType() const
Return the constraint type this pointPatchField implements.
Definition: cyclicACMIPointPatchField.H:179
Foam::Field< tensor >
Foam::cyclicACMIPointPatch::reverseT
const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
Definition: cyclicACMIPointPatch.H:156
Foam::cyclicACMIPointPatch::parallel
bool parallel() const
Are the cyclic planes parallel.
Definition: cyclicACMIPointPatch.H:144
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::cyclicACMIPointPatchField
Cyclic ACMI front and back plane patch field.
Definition: cyclicACMIPointPatchField.H:53
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:66
Foam::cyclicACMIPointPatch
Cyclic AMI point patch - place holder only.
Definition: cyclicACMIPointPatch.H:52
Foam::PrimitivePatchInterpolation
Interpolation class within a primitive patch. Allows interpolation from points to faces and vice vers...
Definition: PrimitivePatchInterpolation.H:53
Foam::cyclicACMIPolyPatch::neighbPatch
virtual const cyclicACMIPolyPatch & neighbPatch() const
Return a reference to the neighbour patch.
Definition: cyclicACMIPolyPatch.C:481
Foam::pTraits
Traits class for primitives.
Definition: pTraits.H:54
Foam::cyclicACMIPointPatchField::doTransform
virtual bool doTransform() const
Does the patch field perform the transformation.
Definition: cyclicACMIPointPatchField.H:188
Foam::cyclicACMIPointPatchField::cyclicACMIPointPatchField
cyclicACMIPointPatchField(const pointPatch &, const DimensionedField< Type, pointMesh > &)
Construct from patch and internal field.
Definition: cyclicACMIPointPatchField.C:37
cyclicACMIPointPatchField.C
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54