cyclicGAMGInterfaceField.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) 2011-2013 OpenFOAM Foundation
9  Copyright (C) 2019 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::cyclicGAMGInterfaceField
29 
30 Description
31  GAMG agglomerated cyclic interface field.
32 
33 SourceFiles
34  cyclicGAMGInterfaceField.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef cyclicGAMGInterfaceField_H
39 #define cyclicGAMGInterfaceField_H
40 
41 #include "GAMGInterfaceField.H"
42 #include "cyclicGAMGInterface.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class cyclicGAMGInterfaceField Declaration
52 \*---------------------------------------------------------------------------*/
53 
55 :
56  public GAMGInterfaceField,
57  virtual public cyclicLduInterfaceField
58 {
59  // Private data
60 
61  //- Local reference cast into the cyclic interface
62  const cyclicGAMGInterface& cyclicInterface_;
63 
64  //- Is the transform required
65  bool doTransform_;
66 
67  //- Rank of component for transformation
68  int rank_;
69 
70 
71  // Private Member Functions
72 
73  //- No copy construct
75 
76  //- No copy assignment
77  void operator=(const cyclicGAMGInterfaceField&) = delete;
78 
79 
80 public:
81 
82  //- Runtime type information
83  TypeName("cyclic");
84 
85 
86  // Constructors
87 
88  //- Construct from GAMG interface and fine level interface field
90  (
91  const GAMGInterface& GAMGCp,
92  const lduInterfaceField& fineInterfaceField
93  );
94 
95  //- Construct from GAMG interface and fine level interface field
97  (
98  const GAMGInterface& GAMGCp,
99  const bool doTransform,
100  const int rank
101  );
102 
103  //- Construct from GAMG interface and Istream
105  (
106  const GAMGInterface& GAMGCp,
107  Istream& is
108  );
109 
110  //- Construct from GAMG interface and local and remote fields
112  (
113  const GAMGInterface& GAMGCp,
114  const lduInterfaceField& local, // local
115  const UPtrList<lduInterfaceField>& other // other
116  );
117 
118  //- Construct by assembling and return a clone.
120  (
121  const GAMGInterface& GAMGCp,
122  const UPtrList<lduInterfaceField>& other // other
123  ) const
124  {
126  (
128  (
129  GAMGCp,
130  *this, // local field
131  other // other fields
132  )
133  );
134  }
135 
136 
137  //- Destructor
138  virtual ~cyclicGAMGInterfaceField() = default;
139 
140 
141  // Member Functions
142 
143  // Access
144 
145  //- Return size
146  label size() const
147  {
148  return cyclicInterface_.size();
149  }
150 
151 
152  //- Cyclic interface functions
153 
154  //- Does the interface field perform the transformation
155  virtual bool doTransform() const
156  {
157  return doTransform_;
158  }
159 
160  //- Return face transformation tensor
161  virtual const tensorField& forwardT() const
162  {
163  return cyclicInterface_.forwardT();
164  }
165 
166  //- Return neighbour-cell transformation tensor
167  virtual const tensorField& reverseT() const
168  {
169  return cyclicInterface_.reverseT();
170  }
171 
172  //- Return rank of component for transform
173  virtual int rank() const
174  {
175  return rank_;
176  }
177 
178 
179  // Interface matrix update
181  //- Update result field based on interface functionality
182  virtual void updateInterfaceMatrix
183  (
184  solveScalarField& result,
185  const bool add,
186  const lduAddressing& lduAddr,
187  const label patchId,
188  const solveScalarField& psiInternal,
189  const scalarField& coeffs,
190  const direction cmpt,
191  const Pstream::commsTypes commsType
192  ) const;
193 
194 
195  // I/O
197  //- Write to stream
198  virtual void write(Ostream&) const;
199 };
200 
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 } // End namespace Foam
205 
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 
208 #endif
209 
210 // ************************************************************************* //
virtual label size() const
Return size.
label patchId(-1)
uint8_t direction
Definition: direction.H:46
virtual autoPtr< GAMGInterfaceField > clone(const GAMGInterface &GAMGCp, const UPtrList< lduInterfaceField > &other) const
Construct by assembling and return a clone.
commsTypes
Communications types.
Definition: UPstream.H:72
GAMG agglomerated cyclic interface field.
virtual void write(Ostream &) const
Write to stream.
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
An abstract base class for implicitly-coupled interface fields e.g. processor and cyclic patch fields...
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
virtual void updateInterfaceMatrix(solveScalarField &result, const bool add, const lduAddressing &lduAddr, const label patchId, const solveScalarField &psiInternal, const scalarField &coeffs, const direction cmpt, const Pstream::commsTypes commsType) const
Update result field based on interface functionality.
virtual int rank() const
Return rank of component for transform.
bool local
Definition: EEqn.H:20
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Definition: HashTable.H:106
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
virtual ~cyclicGAMGInterfaceField()=default
Destructor.
TypeName("cyclic")
Runtime type information.
Abstract base class for GAMG agglomerated interfaces.
Definition: GAMGInterface.H:50
Field< tensor > tensorField
Specialisation of Field<T> for tensor.
virtual const tensorField & forwardT() const
Return face transformation tensor.
Abstract base class for GAMG agglomerated interface fields.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
The class contains the addressing required by the lduMatrix: upper, lower and losort.
Abstract base class for cyclic coupled interfaces.
virtual bool doTransform() const
Cyclic interface functions.
virtual const tensorField & forwardT() const
Return face transformation tensor.
Namespace for OpenFOAM.
GAMG agglomerated cyclic interface.