All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cyclicAMIFvPatchField.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-2020 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::cyclicAMIFvPatchField
26 
27 Description
28  This boundary condition enforces a cyclic condition between a pair of
29  boundaries, whereby communication between the patches is performed using
30  an arbitrary mesh interface (AMI) interpolation.
31 
32 Usage
33  Example of the boundary condition specification:
34  \verbatim
35  <patchName>
36  {
37  type cyclicAMI;
38  }
39  \endverbatim
40 
41 Note
42  The outer boundary of the patch pairs must be similar, i.e. if the owner
43  patch is transformed to the neighbour patch, the outer perimeter of each
44  patch should be identical (or very similar).
45 
46 See also
47  Foam::AMIInterpolation
48 
49 SourceFiles
50  cyclicAMIFvPatchField.C
51 
52 \*---------------------------------------------------------------------------*/
53 
54 #ifndef cyclicAMIFvPatchField_H
55 #define cyclicAMIFvPatchField_H
56 
57 #include "coupledFvPatchField.H"
59 #include "cyclicAMIFvPatch.H"
60 
61 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
62 
63 namespace Foam
64 {
65 
66 /*---------------------------------------------------------------------------*\
67  Class cyclicAMIFvPatchField Declaration
68 \*---------------------------------------------------------------------------*/
69 
70 template<class Type>
72 :
73  public coupledFvPatchField<Type>,
75 {
76  // Private Data
77 
78  //- Local reference cast into the cyclic patch
79  const cyclicAMIFvPatch& cyclicAMIPatch_;
80 
81 
82 public:
83 
84  //- Runtime type information
85  TypeName(cyclicAMIFvPatch::typeName_());
86 
87 
88  // Constructors
89 
90  //- Construct from patch and internal field
92  (
93  const fvPatch&,
95  );
96 
97  //- Construct from patch, internal field and dictionary
99  (
100  const fvPatch&,
102  const dictionary&
103  );
104 
105  //- Construct by mapping given cyclicAMIFvPatchField onto a new patch
107  (
109  const fvPatch&,
111  const fvPatchFieldMapper&
112  );
113 
114  //- Disallow copy without setting internal field reference
116 
117  //- Copy constructor setting internal field reference
119  (
122  );
123 
124  //- Construct and return a clone setting internal field reference
126  (
128  ) const
129  {
130  return tmp<fvPatchField<Type>>
131  (
132  new cyclicAMIFvPatchField<Type>(*this, iF)
133  );
134  }
135 
136 
137  // Member Functions
138 
139  // Access
140 
141  //- Return local reference cast into the cyclic AMI patch
142  const cyclicAMIFvPatch& cyclicAMIPatch() const
143  {
144  return cyclicAMIPatch_;
145  }
146 
147 
148  // Evaluation functions
149 
150  //- Return true if coupled. Note that the underlying patch
151  // is not coupled() - the points don't align.
152  virtual bool coupled() const;
153 
154  //- Return neighbour coupled internal cell data
155  virtual tmp<Field<Type>> patchNeighbourField() const;
156 
157  //- Return reference to neighbour patchField
159 
160  //- Update result field based on interface functionality
161  virtual void updateInterfaceMatrix
162  (
163  scalarField& result,
164  const scalarField& psiInternal,
165  const scalarField& coeffs,
166  const direction cmpt,
167  const Pstream::commsTypes commsType
168  ) const;
169 
170  //- Update result field based on interface functionality
171  virtual void updateInterfaceMatrix
172  (
173  Field<Type>&,
174  const Field<Type>&,
175  const scalarField&,
176  const Pstream::commsTypes commsType
177  ) const;
178 
179 
180  // Cyclic AMI coupled interface functions
181 
182  //- Return transformation between the coupled patches
183  virtual const transformer& transform() const
184  {
185  return cyclicAMIPatch_.transform();
186  }
187 
188  //- Return rank of component for transform
189  virtual int rank() const
190  {
191  return pTraits<Type>::rank;
192  }
193 
194 
195  // I-O
196 
197  //- Write
198  virtual void write(Ostream& os) const;
199 };
200 
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 } // End namespace Foam
205 
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 
208 #ifdef NoRepository
209  #include "cyclicAMIFvPatchField.C"
210 #endif
211 
212 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
213 
214 #endif
215 
216 // ************************************************************************* //
virtual bool coupled() const
Return true if coupled. Note that the underlying patch.
virtual void updateInterfaceMatrix(scalarField &result, const scalarField &psiInternal, const scalarField &coeffs, const direction cmpt, const Pstream::commsTypes commsType) const
Update result field based on interface functionality.
TypeName(cyclicAMIFvPatch::typeName_())
Runtime type information.
Vector-tensor class used to perform translations, rotations and scaling operations in 3D space...
Definition: transformer.H:83
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
commsTypes
Types of communications.
Definition: UPstream.H:64
Cyclic patch for Arbitrary Mesh Interface (AMI)
uint8_t direction
Definition: direction.H:45
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:62
Traits class for primitives.
Definition: pTraits.H:50
virtual const transformer & transform() const
Return transformation between the coupled patches.
Abstract base class for cyclic AMI coupled interfaces.
const cyclicAMIFvPatch & cyclicAMIPatch() const
Return local reference cast into the cyclic AMI patch.
const cyclicAMIFvPatchField< Type > & nbrPatchField() const
Return reference to neighbour patchField.
virtual void write(Ostream &os) const
Write.
Foam::fvPatchFieldMapper.
Abstract base class for coupled patches.
virtual tmp< Field< Type > > patchNeighbourField() const
Return neighbour coupled internal cell data.
virtual int rank() const
Return rank of component for transform.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
virtual const transformer & transform() const
Return transformation between the coupled patches.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
cyclicAMIFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
A class for managing temporary objects.
Definition: PtrList.H:53
tmp< fvPatchField< Type > > clone() const
Disallow clone without setting internal field reference.
Definition: fvPatchField.H:199
This boundary condition enforces a cyclic condition between a pair of boundaries, whereby communicati...
Namespace for OpenFOAM.