cyclicGAMGInterfaceField.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
28 #include "lduMatrix.H"
29 
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
31 
32 namespace Foam
33 {
36  (
40  );
42  (
46  );
47 
48  // Add under name cyclicSlip
50  (
54  cyclicSlip
55  );
57  (
61  cyclicSlip
62  );
63 
64  // Add under name nonConformalCyclic
66  (
70  nonConformalCyclic
71  );
73  (
77  nonConformalCyclic
78  );
79 }
80 
81 
82 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
83 
85 (
86  const GAMGInterface& GAMGCp,
87  const lduInterfaceField& fineInterface
88 )
89 :
90  GAMGInterfaceField(GAMGCp, fineInterface),
91  cyclicInterface_(refCast<const cyclicGAMGInterface>(GAMGCp)),
92  rank_(0)
93 {
94  const cyclicLduInterfaceField& p =
95  refCast<const cyclicLduInterfaceField>(fineInterface);
96 
97  rank_ = p.rank();
98 }
99 
100 
102 (
103  const GAMGInterface& GAMGCp,
104  const int rank
105 )
106 :
107  GAMGInterfaceField(GAMGCp, rank),
108  cyclicInterface_(refCast<const cyclicGAMGInterface>(GAMGCp)),
109  rank_(rank)
110 {}
111 
112 
113 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
114 
116 {}
117 
118 
119 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
120 
122 (
123  scalarField& result,
124  const scalarField& psiInternal,
125  const scalarField& coeffs,
126  const direction cmpt,
127  const Pstream::commsTypes
128 ) const
129 {
130  // Get neighbouring field
131  scalarField pnf
132  (
133  cyclicInterface_.nbrPatch().interfaceInternalField(psiInternal)
134  );
135 
136  transformCoupleField(pnf, cmpt);
137 
138  const labelUList& faceCells = cyclicInterface_.faceCells();
139 
140  forAll(faceCells, elemI)
141  {
142  result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI];
143  }
144 }
145 
146 
147 // ************************************************************************* //
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:434
Macros for easy insertion into run-time selection tables.
Abstract base class for GAMG agglomerated interface fields.
Abstract base class for GAMG agglomerated interfaces.
Definition: GAMGInterface.H:54
commsTypes
Types of communications.
Definition: UPstream.H:65
GAMG agglomerated cyclic interface field.
virtual ~cyclicGAMGInterfaceField()
Destructor.
virtual void updateInterfaceMatrix(scalarField &result, const scalarField &psiInternal, const scalarField &coeffs, const direction cmpt, const Pstream::commsTypes commsType) const
Update result field based on interface functionality.
cyclicGAMGInterfaceField(const GAMGInterface &GAMGCp, const lduInterfaceField &fineInterfaceField)
Construct from GAMG interface and fine level interface field.
GAMG agglomerated cyclic interface.
Abstract base class for cyclic coupled interfaces.
An abstract base class for implicitly-coupled interface fields e.g. processor and cyclic patch fields...
An abstract base class for implicitly-coupled interfaces e.g. processor and cyclic patches.
Definition: lduInterface.H:54
Namespace for OpenFOAM.
addToRunTimeSelectionTable(polyPatch, mergedCyclicPolyPatch, word)
To & refCast(From &r)
Reference type cast template function.
Definition: typeInfo.H:129
addNamedToRunTimeSelectionTable(parcelCloud, collidingCloud, viscosity, collidingCloud)
defineTypeNameAndDebug(combustionModel, 0)
uint8_t direction
Definition: direction.H:45
volScalarField & p