Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::cyclicGAMGInterfaceField
29
30Description
31 GAMG agglomerated cyclic interface field.
32
33SourceFiles
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
47namespace Foam
48{
50/*---------------------------------------------------------------------------*\
51 Class cyclicGAMGInterfaceField Declaration
52\*---------------------------------------------------------------------------*/
53
54class cyclicGAMGInterfaceField
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
74 cyclicGAMGInterfaceField(const cyclicGAMGInterfaceField&) = delete;
75
76 //- No copy assignment
77 void operator=(const cyclicGAMGInterfaceField&) = delete;
78
79
80public:
81
82 //- Runtime type information
83 TypeName("cyclic");
84
85
86 // Constructors
87
88 //- Construct from GAMG interface and fine level interface field
89 cyclicGAMGInterfaceField
90 (
91 const GAMGInterface& GAMGCp,
92 const lduInterfaceField& fineInterfaceField
93 );
94
95 //- Construct from GAMG interface and fine level interface field
96 cyclicGAMGInterfaceField
97 (
98 const GAMGInterface& GAMGCp,
99 const bool doTransform,
100 const int rank
101 );
102
103 //- Construct from GAMG interface and Istream
104 cyclicGAMGInterfaceField
105 (
106 const GAMGInterface& GAMGCp,
107 Istream& is
108 );
109
110 //- Construct from GAMG interface and local and remote fields
111 cyclicGAMGInterfaceField
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 (
127 new cyclicGAMGInterfaceField
128 (
129 GAMGCp,
130 *this, // local field
131 other // other fields
132 )
133 );
134 }
135
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// ************************************************************************* //
Abstract base class for GAMG agglomerated interfaces.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition Istream.H:60
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
commsTypes
Communications types.
Definition UPstream.H:81
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Definition UPtrList.H:101
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
virtual ~cyclicGAMGInterfaceField()=default
Destructor.
virtual bool doTransform() const
Cyclic interface functions.
virtual int rank() const
Return rank of component for transform.
virtual autoPtr< GAMGInterfaceField > clone(const GAMGInterface &GAMGCp, const UPtrList< lduInterfaceField > &other) const
Construct by assembling and return a clone.
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 const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
TypeName("cyclic")
Runtime type information.
virtual const tensorField & forwardT() const
Return face transformation tensor.
GAMG agglomerated cyclic interface.
virtual const tensorField & forwardT() const
Return face transformation tensor.
cyclicLduInterfaceField()=default
Construct null.
The class contains the addressing required by the lduMatrix: upper, lower and losort.
An abstract base class for implicitly-coupled interface fields e.g. processor and cyclic patch fields...
bool local
Definition EEqn.H:20
label patchId(-1)
Namespace for OpenFOAM.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
void add(DimensionedField< scalar, GeoMesh > &result, const dimensioned< scalar > &dt1, const DimensionedField< scalar, GeoMesh > &f2)
Field< solveScalar > solveScalarField
uint8_t direction
Definition direction.H:49
Field< tensor > tensorField
Specialisation of Field<T> for tensor.
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68