1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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.
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
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/>.
24 \*---------------------------------------------------------------------------*/
26 #include "processorGAMGInterfaceField.H"
27 #include "addToRunTimeSelectionTable.H"
28 #include "lduMatrix.H"
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34 defineTypeNameAndDebug(processorGAMGInterfaceField, 0);
35 addToRunTimeSelectionTable
38 processorGAMGInterfaceField,
44 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
46 Foam::processorGAMGInterfaceField::processorGAMGInterfaceField
48 const GAMGInterface& GAMGCp,
49 const lduInterfaceField& fineInterface
52 GAMGInterfaceField(GAMGCp, fineInterface),
53 procInterface_(refCast<const processorGAMGInterface>(GAMGCp)),
57 const processorLduInterfaceField& p =
58 refCast<const processorLduInterfaceField>(fineInterface);
60 doTransform_ = p.doTransform();
65 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
67 Foam::processorGAMGInterfaceField::~processorGAMGInterfaceField()
71 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
73 void Foam::processorGAMGInterfaceField::initInterfaceMatrixUpdate
75 const scalarField& psiInternal,
80 const Pstream::commsTypes commsType
83 procInterface_.compressedSend
86 procInterface_.interfaceInternalField(psiInternal)()
91 void Foam::processorGAMGInterfaceField::updateInterfaceMatrix
96 const scalarField& coeffs,
98 const Pstream::commsTypes commsType
103 procInterface_.compressedReceive<scalar>(commsType, coeffs.size())
105 transformCoupleField(pnf, cmpt);
107 const labelUList& faceCells = procInterface_.faceCells();
109 forAll(faceCells, elemI)
111 result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI];
116 // ************************************************************************* //