cyclicAMIGAMGInterfaceField.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::cyclicAMIGAMGInterfaceField
29 
30 Description
31  GAMG agglomerated cyclic interface field.
32 
33 SourceFiles
34  cyclicAMIGAMGInterfaceField.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef cyclicAMIGAMGInterfaceField_H
39 #define cyclicAMIGAMGInterfaceField_H
40 
41 #include "GAMGInterfaceField.H"
42 #include "cyclicAMIGAMGInterface.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class cyclicAMIGAMGInterfaceField Declaration
52 \*---------------------------------------------------------------------------*/
53 
55 :
56  public GAMGInterfaceField,
57  virtual public cyclicAMILduInterfaceField
58 {
59  // Private data
60 
61  //- Local reference cast into the cyclic interface
62  const cyclicAMIGAMGInterface& cyclicAMIInterface_;
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  (
77  ) = delete;
78 
79  //- No copy assignment
80  void operator=(const cyclicAMIGAMGInterfaceField&) = delete;
81 
82 
83 public:
84 
85  //- Runtime type information
86  TypeName("cyclicAMI");
87 
88 
89  // Constructors
90 
91  //- Construct from GAMG interface and fine level interface field
93  (
94  const GAMGInterface& GAMGCp,
95  const lduInterfaceField& fineInterfaceField
96  );
97 
98  //- Construct from GAMG interface and fine level interface field
100  (
101  const GAMGInterface& GAMGCp,
102  const bool doTransform,
103  const int rank
104  );
105 
106 
107  //- Destructor
109 
110 
111  // Member Functions
112 
113  // Access
114 
115  //- Return size
116  label size() const
117  {
118  return cyclicAMIInterface_.size();
119  }
120 
121 
122  // Interface matrix update
123 
124  //- Update result field based on interface functionality
125  virtual void updateInterfaceMatrix
126  (
127  solveScalarField& result,
128  const bool add,
129  const lduAddressing& lduAddr,
130  const label patchId,
131  const solveScalarField& psiInternal,
132  const scalarField& coeffs,
133  const direction cmpt,
134  const Pstream::commsTypes commsType
135  ) const;
136 
137 
138  //- Cyclic interface functions
139 
140  //- Does the interface field perform the transformation
141  virtual bool doTransform() const
142  {
143  return doTransform_;
144  }
145 
146  //- Return face transformation tensor
147  virtual const tensorField& forwardT() const
148  {
149  return cyclicAMIInterface_.forwardT();
150  }
151 
152  //- Return neighbour-cell transformation tensor
153  virtual const tensorField& reverseT() const
154  {
155  return cyclicAMIInterface_.reverseT();
156  }
157 
158  //- Return rank of component for transform
159  virtual int rank() const
160  {
161  return rank_;
162  }
163 };
164 
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 } // End namespace Foam
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 #endif
173 
174 // ************************************************************************* //
virtual label size() const
Return size.
label patchId(-1)
GAMG agglomerated cyclic interface field.
uint8_t direction
Definition: direction.H:46
GAMG agglomerated cyclic AMI interface.
commsTypes
Types of communications.
Definition: UPstream.H:66
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...
TypeName("cyclicAMI")
Runtime type information.
virtual int rank() const
Return rank of component for transform.
Abstract base class for cyclic AMI coupled interfaces.
virtual const tensorField & forwardT() const
Return face transformation tensor.
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
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.
Abstract base class for GAMG agglomerated interfaces.
Definition: GAMGInterface.H:50
Field< tensor > tensorField
Specialisation of Field<T> for tensor.
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
Abstract base class for GAMG agglomerated interface fields.
The class contains the addressing required by the lduMatrix: upper, lower and losort.
virtual const tensorField & forwardT() const
Return face transformation tensor.
virtual bool doTransform() const
Cyclic interface functions.
Namespace for OpenFOAM.