cyclicGAMGInterfaceField.C
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
27\*---------------------------------------------------------------------------*/
28
31#include "lduMatrix.H"
32
33// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34
35namespace Foam
36{
39 (
43 );
45 (
49 );
50
51 // Add under name cyclicSlip
53 (
57 cyclicSlip
58 );
60 (
64 cyclicSlip
65 );
66}
67
68
69// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
70
72(
73 const GAMGInterface& GAMGCp,
74 const lduInterfaceField& fineInterface
75)
76:
77 GAMGInterfaceField(GAMGCp, fineInterface),
78 cyclicInterface_(refCast<const cyclicGAMGInterface>(GAMGCp)),
79 doTransform_(false),
80 rank_(0)
81{
83 refCast<const cyclicLduInterfaceField>(fineInterface);
84
85 doTransform_ = p.doTransform();
86 rank_ = p.rank();
87}
88
89
91(
92 const GAMGInterface& GAMGCp,
93 const bool doTransform,
94 const int rank
95)
96:
97 GAMGInterfaceField(GAMGCp, doTransform, rank),
98 cyclicInterface_(refCast<const cyclicGAMGInterface>(GAMGCp)),
99 doTransform_(doTransform),
100 rank_(rank)
101{}
102
103
104// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
105
107(
108 solveScalarField& result,
109 const bool add,
110 const lduAddressing& lduAddr,
111 const label patchId,
112 const solveScalarField& psiInternal,
113 const scalarField& coeffs,
114 const direction cmpt,
116) const
117{
118 // Get neighbouring field
119
120 const labelList& nbrFaceCells =
121 lduAddr.patchAddr
122 (
123 cyclicInterface_.neighbPatchID()
124 );
125
126 solveScalarField pnf(psiInternal, nbrFaceCells);
127
128 transformCoupleField(pnf, cmpt);
129
130 const labelList& faceCells = lduAddr.patchAddr(patchId);
131
132 this->addToInternalField(result, !add, faceCells, coeffs, pnf);
133}
134
135
136// ************************************************************************* //
Macros for easy insertion into run-time selection tables.
#define addNamedToRunTimeSelectionTable(baseType, thisType, argNames, lookupName)
Add to construction table with 'lookupName' as the key.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Abstract base class for GAMG agglomerated interface fields.
Abstract base class for GAMG agglomerated interfaces.
Definition: GAMGInterface.H:57
commsTypes
Types of communications.
Definition: UPstream.H:67
GAMG agglomerated cyclic interface field.
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.
GAMG agglomerated cyclic interface.
Abstract base class for cyclic coupled interfaces.
Smooth ATC in cells next to a set of patches supplied by type.
Definition: faceCells.H:59
The class contains the addressing required by the lduMatrix: upper, lower and losort.
virtual const labelUList & patchAddr(const label patchNo) const =0
Return patch to internal addressing given patch number.
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:58
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition: className.H:121
volScalarField & p
label patchId(-1)
Namespace for OpenFOAM.
To & refCast(From &r)
Reference type cast template function.
Definition: typeInfo.H:131
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
uint8_t direction
Definition: direction.H:56