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
149  virtual void updateInterfaceMatrix
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 // ************************************************************************* //
Foam::lduAddressing
The class contains the addressing required by the lduMatrix: upper, lower and losort.
Definition: lduAddressing.H:114
Foam::GAMGInterface::size
virtual label size() const
Return size.
Definition: GAMGInterface.H:205
Foam::cyclicGAMGInterface::reverseT
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
Definition: cyclicGAMGInterface.H:155
Foam::cyclicGAMGInterfaceField::reverseT
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
Definition: cyclicGAMGInterfaceField.H:133
Foam::cyclicGAMGInterfaceField::updateInterfaceMatrix
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.
Definition: cyclicGAMGInterfaceField.C:107
Foam::cyclicGAMGInterfaceField
GAMG agglomerated cyclic interface field.
Definition: cyclicGAMGInterfaceField.H:53
Foam::Field< tensor >
Foam::GAMGInterface
Abstract base class for GAMG agglomerated interfaces.
Definition: GAMGInterface.H:54
Foam::cyclicGAMGInterfaceField::~cyclicGAMGInterfaceField
virtual ~cyclicGAMGInterfaceField()=default
Destructor.
cyclicGAMGInterface.H
Foam::cyclicGAMGInterface::forwardT
virtual const tensorField & forwardT() const
Return face transformation tensor.
Definition: cyclicGAMGInterface.H:149
Foam::GAMGInterfaceField
Abstract base class for GAMG agglomerated interface fields.
Definition: GAMGInterfaceField.H:54
Foam::add
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
Definition: FieldFieldFunctions.C:939
GAMGInterfaceField.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::lduInterfaceField
An abstract base class for implicitly-coupled interface fields e.g. processor and cyclic patch fields...
Definition: lduInterfaceField.H:58
Foam::cyclicGAMGInterfaceField::doTransform
virtual bool doTransform() const
Cyclic interface functions.
Definition: cyclicGAMGInterfaceField.H:121
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:69
Foam::cyclicGAMGInterfaceField::rank
virtual int rank() const
Return rank of component for transform.
Definition: cyclicGAMGInterfaceField.H:139
Foam::cyclicLduInterfaceField
Abstract base class for cyclic coupled interfaces.
Definition: cyclicLduInterfaceField.H:52
cyclicLduInterfaceField.H
Foam::direction
uint8_t direction
Definition: direction.H:52
Foam::cyclicGAMGInterface
GAMG agglomerated cyclic interface.
Definition: cyclicGAMGInterface.H:52
patchId
label patchId(-1)
Foam::cyclicGAMGInterfaceField::size
label size() const
Return size.
Definition: cyclicGAMGInterfaceField.H:112
Foam::cyclicGAMGInterfaceField::forwardT
virtual const tensorField & forwardT() const
Return face transformation tensor.
Definition: cyclicGAMGInterfaceField.H:127
Foam::cyclicGAMGInterfaceField::TypeName
TypeName("cyclic")
Runtime type information.