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 | Copyright (C) 2013 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::cyclicACMIPointPatchField
26 
27 Description
28  Cyclic ACMI front and back plane patch field
29 
30 SourceFiles
31  cyclicACMIPointPatchField.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef cyclicACMIPointPatchField_H
36 #define cyclicACMIPointPatchField_H
37 
38 #include "coupledPointPatchField.H"
39 #include "cyclicACMIPointPatch.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class cyclicACMIPointPatchField Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 template<class Type>
53 :
54  public coupledPointPatchField<Type>
55 {
56  // Private data
57 
58  //- Local reference cast into the cyclicACMI patch
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  (
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  (
98  )
99  );
100  }
101 
102  return nbrPpiPtr_();
103  }
104 
105 
106 public:
107 
108  //- Runtime type information
109  TypeName(cyclicACMIPointPatch::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 and return a clone
139  virtual autoPtr<pointPatchField<Type> > clone() const
140  {
142  (
144  (
145  *this
146  )
147  );
148  }
149 
150  //- Construct as copy setting internal field reference
152  (
155  );
156 
157  //- Construct and return a clone setting internal field reference
159  (
161  ) const
162  {
164  (
166  (
167  *this, iF
168  )
169  );
170  }
171 
172 
173  // Member functions
174 
175  // Constraint handling
176 
177  //- Return the constraint type this pointPatchField implements
178  virtual const word& constraintType() const
179  {
180  return cyclicACMIPointPatch::typeName;
181  }
182 
183 
184  // Cyclic AMI coupled interface functions
185 
186  //- Does the patch field perform the transfromation
187  virtual bool doTransform() const
188  {
189  return
190  !(
192  || pTraits<Type>::rank == 0
193  );
194  }
195 
196  //- Return face transformation tensor
197  virtual const tensorField& forwardT() const
198  {
199  return cyclicACMIPatch_.forwardT();
200  }
201 
202  //- Return neighbour-cell transformation tensor
203  virtual const tensorField& reverseT() const
204  {
205  return cyclicACMIPatch_.reverseT();
206  }
207 
208 
209  // Evaluation functions
210 
211  //- Evaluate the patch field
212  virtual void evaluate
213  (
214  const Pstream::commsTypes commsType=Pstream::blocking
215  )
216  {}
217 
218  //- Complete swap of patch point values and add to local values
219  virtual void swapAddSeparated
220  (
221  const Pstream::commsTypes commsType,
222  Field<Type>&
223  ) const;
224 };
225 
226 
227 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
228 
229 } // End namespace Foam
230 
231 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
232 
233 #ifdef NoRepository
234 # include "cyclicACMIPointPatchField.C"
235 #endif
236 
237 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
238 
239 #endif
240 
241 // ************************************************************************* //
coupledPointPatchField.H
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::coupledPointPatchField
A Coupled boundary condition for pointField.
Definition: coupledPointPatchField.H:50
PrimitivePatchInterpolation.H
Foam::cyclicACMIPointPatch::forwardT
const tensorField & forwardT() const
Return face transformation tensor.
Definition: cyclicACMIPointPatch.H:148
Foam::cyclicACMIPointPatchField::ppi
const PrimitivePatchInterpolation< primitivePatch > & ppi() const
Owner side patch interpolation.
Definition: cyclicACMIPointPatchField.H:71
cyclicACMIPointPatch.H
Foam::cyclicACMIPointPatchField::nbrPpiPtr_
autoPtr< PrimitivePatchInterpolation< primitivePatch > > nbrPpiPtr_
Neighbour side patch interpolation pointer.
Definition: cyclicACMIPointPatchField.H:65
Foam::cyclicACMIPointPatchField::nbrPpi
const PrimitivePatchInterpolation< primitivePatch > & nbrPpi() const
Neighbour side patch interpolation.
Definition: cyclicACMIPointPatchField.H:88
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::cyclicACMIPointPatchField::ppiPtr_
autoPtr< PrimitivePatchInterpolation< primitivePatch > > ppiPtr_
Owner side patch interpolation pointer.
Definition: cyclicACMIPointPatchField.H:61
Foam::cyclicACMIPointPatch::cyclicACMIPatch
const cyclicACMIPolyPatch & cyclicACMIPatch() const
Return the underlying cyclicAMIPolyPatch.
Definition: cyclicACMIPointPatch.H:128
Foam::cyclicACMIPointPatchField::reverseT
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
Definition: cyclicACMIPointPatchField.H:202
Foam::pointPatch
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:56
Foam::cyclicACMIPointPatchField::TypeName
TypeName(cyclicACMIPointPatch::typeName_())
Runtime type information.
Foam::pointPatchFieldMapper
Foam::pointPatchFieldMapper.
Definition: pointPatchFieldMapper.H:46
Foam::cyclicACMIPointPatchField::clone
virtual autoPtr< pointPatchField< Type > > clone() const
Construct and return a clone.
Definition: cyclicACMIPointPatchField.H:138
Foam::cyclicACMIPointPatchField::forwardT
virtual const tensorField & forwardT() const
Return face transformation tensor.
Definition: cyclicACMIPointPatchField.H:196
Foam::cyclicACMIPointPatchField::constraintType
virtual const word & constraintType() const
Return the constraint type this pointPatchField implements.
Definition: cyclicACMIPointPatchField.H:177
Foam::UPstream::blocking
@ blocking
Definition: UPstream.H:66
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::cyclicACMIPointPatch::reverseT
const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
Definition: cyclicACMIPointPatch.H:154
Foam::cyclicACMIPointPatch::parallel
bool parallel() const
Are the cyclic planes parallel.
Definition: cyclicACMIPointPatch.H:142
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::cyclicACMIPointPatchField
Cyclic ACMI front and back plane patch field.
Definition: cyclicACMIPointPatchField.H:51
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:64
Foam::cyclicACMIPointPatch
Cyclic AMI point patch - place holder only.
Definition: cyclicACMIPointPatch.H:50
Foam::PrimitivePatchInterpolation
Interpolation class within a primitive patch. Allows interpolation from points to faces and vice vers...
Definition: PrimitivePatchInterpolation.H:51
Foam::cyclicACMIPolyPatch::neighbPatch
virtual const cyclicACMIPolyPatch & neighbPatch() const
Return a reference to the neighbour patch.
Definition: cyclicACMIPolyPatch.C:365
Foam::pTraits
Traits class for primitives.
Definition: pTraits.H:50
Foam::cyclicACMIPointPatchField::doTransform
virtual bool doTransform() const
Does the patch field perform the transfromation.
Definition: cyclicACMIPointPatchField.H:186
Foam::cyclicACMIPointPatchField::cyclicACMIPatch_
const cyclicACMIPointPatch & cyclicACMIPatch_
Local reference cast into the cyclicACMI patch.
Definition: cyclicACMIPointPatchField.H:58
Foam::cyclicACMIPointPatchField::cyclicACMIPointPatchField
cyclicACMIPointPatchField(const pointPatch &, const DimensionedField< Type, pointMesh > &)
Construct from patch and internal field.
Definition: cyclicACMIPointPatchField.C:35
Foam::cyclicACMIPointPatchField::evaluate
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::blocking)
Evaluate the patch field.
Definition: cyclicACMIPointPatchField.H:212
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:51