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 
104  //- Destructor
105  virtual ~cyclicGAMGInterfaceField() = default;
106 
107 
108  // Member Functions
109 
110  // Access
111 
112  //- Return size
113  label size() const
114  {
115  return cyclicInterface_.size();
116  }
117 
118 
119  //- Cyclic interface functions
120 
121  //- Does the interface field perform the transformation
122  virtual bool doTransform() const
123  {
124  return doTransform_;
125  }
126 
127  //- Return face transformation tensor
128  virtual const tensorField& forwardT() const
129  {
130  return cyclicInterface_.forwardT();
131  }
132 
133  //- Return neighbour-cell transformation tensor
134  virtual const tensorField& reverseT() const
135  {
136  return cyclicInterface_.reverseT();
137  }
138 
139  //- Return rank of component for transform
140  virtual int rank() const
141  {
142  return rank_;
143  }
144 
145 
146  // Interface matrix update
147 
148  //- Update result field based on interface functionality
150  (
151  solveScalarField& result,
152  const bool add,
153  const lduAddressing& lduAddr,
154  const label patchId,
155  const solveScalarField& psiInternal,
156  const scalarField& coeffs,
157  const direction cmpt,
158  const Pstream::commsTypes commsType
159  ) const;
160 };
161 
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 } // End namespace Foam
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 #endif
170 
171 // ************************************************************************* //
virtual label size() const
Return size.
label patchId(-1)
uint8_t direction
Definition: direction.H:46
commsTypes
Types of communications.
Definition: UPstream.H:66
GAMG agglomerated cyclic interface field.
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
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.
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
virtual const tensorField & forwardT() const
Return face transformation tensor.
Abstract base class for GAMG agglomerated interface fields.
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.