diff --git a/applications/test/LduMatrix/LduMatrixTest3.C b/applications/test/LduMatrix/LduMatrixTest3.C index 22d44bd2d0..596559e6a7 100644 --- a/applications/test/LduMatrix/LduMatrixTest3.C +++ b/applications/test/LduMatrix/LduMatrixTest3.C @@ -88,7 +88,7 @@ int main(int argc, char *argv[]) "{" " solver PBiCG;" " preconditioner DILU;" - " tolerance (1e-13 1e-13 1e-13);" + " tolerance (1e-5 1e-5 1);" " relTol (0 0 0);" "}" )() diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files index d32d9c82e0..3c054e2bfd 100644 --- a/src/OpenFOAM/Make/files +++ b/src/OpenFOAM/Make/files @@ -316,6 +316,7 @@ meshes/lduMesh/lduMesh.C LduMatrix = matrices/LduMatrix $(LduMatrix)/LduMatrix/lduMatrices.C +$(LduMatrix)/LduMatrix/LduInterfaceField/LduInterfaceFields.C $(LduMatrix)/Smoothers/lduSmoothers.C $(LduMatrix)/Preconditioners/lduPreconditioners.C $(LduMatrix)/Solvers/lduSolvers.C diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C index 448a009cab..5117f8cb23 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C @@ -485,9 +485,35 @@ boundaryInternalField() const template class PatchField, class GeoMesh> -Foam::lduInterfaceFieldPtrsList +Foam::LduInterfaceFieldPtrsList Foam::GeometricField::GeometricBoundaryField:: interfaces() const +{ + LduInterfaceFieldPtrsList interfaces(this->size()); + + forAll(interfaces, patchi) + { + if (isA >(this->operator[](patchi))) + { + interfaces.set + ( + patchi, + &refCast > + ( + this->operator[](patchi) + ) + ); + } + } + + return interfaces; +} + + +template class PatchField, class GeoMesh> +Foam::lduInterfaceFieldPtrsList +Foam::GeometricField::GeometricBoundaryField:: +scalarInterfaces() const { lduInterfaceFieldPtrsList interfaces(this->size()); @@ -498,7 +524,10 @@ interfaces() const interfaces.set ( patchi, - &refCast(this->operator[](patchi)) + &refCast + ( + this->operator[](patchi) + ) ); } } diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.H b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.H index 56b9beee49..ad14ad8c34 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.H +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.H @@ -44,6 +44,7 @@ SourceFiles #include "DimensionedField.H" #include "FieldField.H" #include "lduInterfaceFieldPtrsList.H" +#include "LduInterfaceFieldPtrsList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -191,7 +192,11 @@ public: //- Return a list of pointers for each patch field with only those // pointing to interfaces being set - lduInterfaceFieldPtrsList interfaces() const; + LduInterfaceFieldPtrsList interfaces() const; + + //- Return a list of pointers for each patch field with only those + // pointing to interfaces being set + lduInterfaceFieldPtrsList scalarInterfaces() const; //- Write boundary field as dictionary entry void writeEntry(const word& keyword, Ostream& os) const; diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduInterfaceField/CyclicLduInterfaceField.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduInterfaceField/CyclicLduInterfaceField.C deleted file mode 100644 index 445a654a1c..0000000000 --- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduInterfaceField/CyclicLduInterfaceField.C +++ /dev/null @@ -1,65 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "CyclicLduInterfaceField.H" -#include "diagTensorField.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - //defineTypeNameAndDebug(CyclicLduInterfaceField, 0); -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -template -Foam::CyclicLduInterfaceField::~CyclicLduInterfaceField() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -template -void Foam::CyclicLduInterfaceField::transformCoupleField -( - Field& f -) const -{ - if (doTransform()) - { - label sizeby2 = f.size()/2; - - for (label facei=0; facei. - -Class - Foam::CyclicLduInterfaceField - -Description - Abstract base class for cyclic coupled interfaces. - -SourceFiles - CyclicLduInterfaceField.C - -\*---------------------------------------------------------------------------*/ - -#ifndef CyclicLduInterfaceField_H -#define CyclicLduInterfaceField_H - -#include "primitiveFieldsFwd.H" -#include "typeInfo.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class CyclicLduInterfaceField Declaration -\*---------------------------------------------------------------------------*/ - -template -class CyclicLduInterfaceField -{ - -public: - - //- Runtime type information - TypeName("CyclicLduInterfaceField"); - - - // Constructors - - //- Construct given coupled patch - CyclicLduInterfaceField() - {} - - - // Destructor - - virtual ~CyclicLduInterfaceField(); - - - // Member Functions - - // Access - - //- Is the transform required - virtual bool doTransform() const = 0; - - //- Return face transformation tensor - virtual const tensorField& forwardT() const = 0; - - //- Return neighbour-cell transformation tensor - virtual const tensorField& reverseT() const = 0; - - //- Return rank of component for transform - virtual int rank() const = 0; - - - //- Transform given patch internal field - void transformCoupleField(Field& f) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduInterfaceField/LduInterfaceField.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduInterfaceField/LduInterfaceField.C index 5f50f7eb53..85f42a949a 100644 --- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduInterfaceField/LduInterfaceField.C +++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduInterfaceField/LduInterfaceField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,25 +23,11 @@ License \*---------------------------------------------------------------------------*/ -#include "lduInterfaceField.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -defineTypeNameAndDebug(lduInterfaceField, 0); - // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -lduInterfaceField::~lduInterfaceField() +template +Foam::LduInterfaceField::~LduInterfaceField() {} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduInterfaceField/LduInterfaceField.H b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduInterfaceField/LduInterfaceField.H index 0cae1a925d..adacc45ed2 100644 --- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduInterfaceField/LduInterfaceField.H +++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduInterfaceField/LduInterfaceField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -36,27 +36,28 @@ SourceFiles #ifndef LduInterfaceField_H #define LduInterfaceField_H -#include "lduInterface.H" -#include "Field.H" +#include "lduInterfaceField.H" +#include "primitiveFieldsFwd.H" +#include "Pstream.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +class lduMatrix; + /*---------------------------------------------------------------------------*\ Class LduInterfaceField Declaration \*---------------------------------------------------------------------------*/ template class LduInterfaceField +: + public lduInterfaceField { - // Private data - - //- Reference to the coupled patch this field is defined for - const lduInterface& interface_; - - // Private Member Functions //- Disallow default bitwise copy construct @@ -68,73 +69,52 @@ class LduInterfaceField public: - class Amultiplier - { - public: - - Amultiplier() - {} - - virtual ~Amultiplier() - {} - - virtual void addAmul - ( - Field& Apsi, - const Field& psi - ) const = 0; - }; - - //- Runtime type information TypeName("LduInterfaceField"); // Constructors - //- Construct given interface - LduInterfaceField(const lduInterface& interface) + //- Construct given coupled patch + LduInterfaceField(const lduInterface& patch) : - interface_(interface) + lduInterfaceField(patch) {} - // Destructor - - virtual ~LduInterfaceField(); + //- Destructor + virtual ~LduInterfaceField(); // Member Functions - // Access + //- Initialise neighbour matrix update + virtual void initInterfaceMatrixUpdate + ( + Field&, + const Field&, + const scalarField&, + const Pstream::commsTypes commsType + ) const + {} - //- Return the interface - const lduInterface& interface() const - { - return interface_; - } - - - // Coupled interface matrix update - - //- Initialise neighbour matrix update - virtual void initInterfaceMatrixUpdate + //- Update result field based on interface functionality + virtual void updateInterfaceMatrix + ( + Field&, + const Field&, + const scalarField&, + const Pstream::commsTypes commsType + ) const // = 0; + { + notImplemented ( - Field& Apsi, - const Field& psi, - const Amultiplier&, - const Pstream::commsTypes commsType - ) const - {} - - //- Update result field based on interface functionality - virtual void updateInterfaceMatrix - ( - Field& Apsi, - const Field& psi, - const Amultiplier&, - const Pstream::commsTypes commsType - ) const = 0; + "updateInterfaceMatrix" + "(Field&, const Field&," + "const scalarField&," + "const Pstream::commsTypes commsType) const" + ); + } }; @@ -144,6 +124,12 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#ifdef NoRepository +# include "LduInterfaceField.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduInterfaceField/ProcessorLduInterfaceField.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduInterfaceField/ProcessorLduInterfaceField.C deleted file mode 100644 index 0bbe441612..0000000000 --- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduInterfaceField/ProcessorLduInterfaceField.C +++ /dev/null @@ -1,66 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "processorLduInterfaceField.H" -#include "diagTensorField.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - //defineTypeNameAndDebug(processorLduInterfaceField, 0); -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -template -Foam::processorLduInterfaceField::~processorLduInterfaceField() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -template -void Foam::processorLduInterfaceField::transformCoupleField -( - Field& f -) const -{ - if (doTransform()) - { - if (forwardT().size() == 1) - { - transform(f, forwardT()[0], f); - } - else - { - transform(f, forwardT(), f); - } - } -} - - -// ************************************************************************* // diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduInterfaceField/ProcessorLduInterfaceField.H b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduInterfaceField/ProcessorLduInterfaceField.H deleted file mode 100644 index f794de01d4..0000000000 --- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduInterfaceField/ProcessorLduInterfaceField.H +++ /dev/null @@ -1,105 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Class - Foam::ProcessorLduInterfaceField - -Description - Abstract base class for processor coupled interfaces. - -SourceFiles - ProcessorLduInterfaceField.C - -\*---------------------------------------------------------------------------*/ - -#ifndef ProcessorLduInterfaceField_H -#define ProcessorLduInterfaceField_H - -#include "primitiveFieldsFwd.H" -#include "typeInfo.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class ProcessorLduInterfaceField Declaration -\*---------------------------------------------------------------------------*/ - -template -class ProcessorLduInterfaceField -{ - -public: - - //- Runtime type information - TypeName("ProcessorLduInterfaceField"); - - - // Constructors - - //- Construct given coupled patch - ProcessorLduInterfaceField() - {} - - - // Destructor - - virtual ~ProcessorLduInterfaceField(); - - - // Member Functions - - // Access - - //- Return processor number - virtual int myProcNo() const = 0; - - //- Return neigbour processor number - virtual int neighbProcNo() const = 0; - - //- Is the transform required - virtual bool doTransform() const = 0; - - //- Return face transformation tensor - virtual const tensorField& forwardT() const = 0; - - //- Return rank of component for transform - virtual int rank() const = 0; - - - //- Transform given patch component field - void transformCoupleField(Field& f) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrix.H b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrix.H index 892e1a0ae5..e0ce6d28ba 100644 --- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrix.H +++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrix.H @@ -75,6 +75,27 @@ Ostream& operator<< const LduMatrix& ); +template +typename LduMatrix::solverPerformance max +( + const typename LduMatrix::solverPerformance&, + const typename LduMatrix::solverPerformance& +); + +template +Istream& operator>> +( + Istream&, + typename LduMatrix::solverPerformance& +); + +template +Ostream& operator<< +( + Ostream&, + const typename LduMatrix::solverPerformance& +); + /*---------------------------------------------------------------------------*\ Class LduMatrix Declaration @@ -162,6 +183,20 @@ public: return solverName_; } + //- Return solver name + word& solverName() + { + return solverName_; + } + + + //- Return field name + const word& fieldName() const + { + return fieldName_; + } + + //- Return initial residual const Type& initialResidual() const { @@ -200,8 +235,12 @@ public: return noIterations_; } - //- Check, store and return singularity - bool singular(const Type& wApA); + + //- Has the solver converged? + bool converged() const + { + return converged_; + } //- Is the matrix singular? bool singular() const; @@ -213,14 +252,41 @@ public: const Type& relTolerance ); - //- Has the solver converged? - bool converged() const - { - return converged_; - } + //- Singularity test + bool checkSingularity(const Type& residual); //- Print summary of solver performance to the given stream void print(Ostream& os) const; + + + // Member Operators + + bool operator!=(const solverPerformance&) const; + + + // Friend functions + + //- Return the element-wise maximum of two solverPerformances + friend solverPerformance max + ( + const solverPerformance&, + const solverPerformance& + ); + + + // Ostream Operator + + friend Istream& operator>> + ( + Istream&, + solverPerformance& + ); + + friend Ostream& operator<< + ( + Ostream&, + const solverPerformance& + ); }; @@ -635,6 +701,12 @@ public: return interfaces_; } + //- Return interfaces + LduInterfaceFieldPtrsList& interfaces() + { + return interfaces_; + } + // Access to coefficients diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixATmul.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixATmul.C index dc5b22e428..98d24f4e9b 100644 --- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixATmul.C +++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixATmul.C @@ -24,6 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "LduMatrix.H" +#include "LduInterfaceFieldPtrsList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixTests.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixTests.C index c4dd85fd0e..f5a675f044 100644 --- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixTests.C +++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixTests.C @@ -28,7 +28,7 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // template -bool Foam::LduMatrix::solverPerformance::singular +bool Foam::LduMatrix::solverPerformance::checkSingularity ( const Type& wApA ) @@ -115,4 +115,85 @@ void Foam::LduMatrix::solverPerformance::print } +template +bool Foam::LduMatrix::solverPerformance::operator!= +( + const LduMatrix::solverPerformance& sp +) const +{ + return + ( + solverName() != sp.solverName() + || fieldName() != sp.fieldName() + || initialResidual() != sp.initialResidual() + || finalResidual() != sp.finalResidual() + || nIterations() != sp.nIterations() + || converged() != sp.converged() + || singular() != sp.singular() + ); +} + + +template +typename Foam::LduMatrix::solverPerformance Foam::max +( + const typename Foam::LduMatrix::solverPerformance& sp1, + const typename Foam::LduMatrix::solverPerformance& sp2 +) +{ + return lduMatrix::solverPerformance + ( + sp1.solverName(), + sp1.fieldName_, + max(sp1.initialResidual(), sp2.initialResidual()), + max(sp1.finalResidual(), sp2.finalResidual()), + max(sp1.nIterations(), sp2.nIterations()), + sp1.converged() && sp2.converged(), + sp1.singular() || sp2.singular() + ); +} + + +template +Foam::Istream& Foam::operator>> +( + Istream& is, + typename Foam::LduMatrix::solverPerformance& sp +) +{ + is.readBeginList("LduMatrix::solverPerformance"); + is >> sp.solverName_ + >> sp.fieldName_ + >> sp.initialResidual_ + >> sp.finalResidual_ + >> sp.noIterations_ + >> sp.converged_ + >> sp.singular_; + is.readEndList("LduMatrix::solverPerformance"); + + return is; +} + + +template +Foam::Ostream& Foam::operator<< +( + Ostream& os, + const typename Foam::LduMatrix::solverPerformance& sp +) +{ + os << token::BEGIN_LIST + << sp.solverName_ << token::SPACE + << sp.fieldName_ << token::SPACE + << sp.initialResidual_ << token::SPACE + << sp.finalResidual_ << token::SPACE + << sp.noIterations_ << token::SPACE + << sp.converged_ << token::SPACE + << sp.singular_ << token::SPACE + << token::END_LIST; + + return os; +} + + // ************************************************************************* // diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixUpdateMatrixInterfaces.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixUpdateMatrixInterfaces.C index fc8a9c8097..d3d8de20a0 100644 --- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixUpdateMatrixInterfaces.C +++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixUpdateMatrixInterfaces.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "LduMatrix.H" -#include "LduInterfaceField.H" +#include "lduInterfaceField.H" // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // @@ -50,7 +50,8 @@ void Foam::LduMatrix::initMatrixInterfaces ( result, psiif, - Amultiplier(interfaceCoeffs[interfaceI]), + interfaceCoeffs[interfaceI], + //Amultiplier(interfaceCoeffs[interfaceI]), Pstream::defaultCommsType ); } @@ -75,7 +76,8 @@ void Foam::LduMatrix::initMatrixInterfaces ( result, psiif, - Amultiplier(interfaceCoeffs[interfaceI]), + interfaceCoeffs[interfaceI], + //Amultiplier(interfaceCoeffs[interfaceI]), Pstream::blocking ); } @@ -120,7 +122,8 @@ void Foam::LduMatrix::updateMatrixInterfaces ( result, psiif, - Amultiplier(interfaceCoeffs[interfaceI]), + interfaceCoeffs[interfaceI], + //Amultiplier(interfaceCoeffs[interfaceI]), Pstream::defaultCommsType ); } @@ -143,7 +146,8 @@ void Foam::LduMatrix::updateMatrixInterfaces ( result, psiif, - Amultiplier(interfaceCoeffs[interfaceI]), + interfaceCoeffs[interfaceI], + //Amultiplier(interfaceCoeffs[interfaceI]), Pstream::scheduled ); } @@ -153,7 +157,8 @@ void Foam::LduMatrix::updateMatrixInterfaces ( result, psiif, - Amultiplier(interfaceCoeffs[interfaceI]), + interfaceCoeffs[interfaceI], + //Amultiplier(interfaceCoeffs[interfaceI]), Pstream::scheduled ); } @@ -175,7 +180,8 @@ void Foam::LduMatrix::updateMatrixInterfaces ( result, psiif, - Amultiplier(interfaceCoeffs[interfaceI]), + interfaceCoeffs[interfaceI], + //Amultiplier(interfaceCoeffs[interfaceI]), Pstream::blocking ); } diff --git a/src/OpenFOAM/matrices/LduMatrix/Solvers/PBiCG/TPBiCG.C b/src/OpenFOAM/matrices/LduMatrix/Solvers/PBiCG/TPBiCG.C index 6221fe3b9c..e36d1d6a37 100644 --- a/src/OpenFOAM/matrices/LduMatrix/Solvers/PBiCG/TPBiCG.C +++ b/src/OpenFOAM/matrices/LduMatrix/Solvers/PBiCG/TPBiCG.C @@ -150,13 +150,18 @@ Foam::TPBiCG::solve(Field& psi) const // --- Update preconditioned residuals this->matrix_.Amul(wA, pA); - this->matrix_.Tmul(wT, pT); Type wApT = gSumCmptProd(wA, pT); // --- Test for singularity - if (solverPerf.singular(cmptDivide(cmptMag(wApT), normFactor))) + if + ( + solverPerf.checkSingularity + ( + cmptDivide(cmptMag(wApT), normFactor) + ) + ) { break; } diff --git a/src/OpenFOAM/matrices/LduMatrix/Solvers/PBiCGScalarAlpha/PBiCGScalarAlpha.C b/src/OpenFOAM/matrices/LduMatrix/Solvers/PBiCGScalarAlpha/PBiCGScalarAlpha.C index c540a2c746..955e6be440 100644 --- a/src/OpenFOAM/matrices/LduMatrix/Solvers/PBiCGScalarAlpha/PBiCGScalarAlpha.C +++ b/src/OpenFOAM/matrices/LduMatrix/Solvers/PBiCGScalarAlpha/PBiCGScalarAlpha.C @@ -126,7 +126,7 @@ Foam::TPBiCG::solve // --- Update search directions: //wArT = gSumProd(wA, rT); - wArT = sum(wA & rT); + wArT = gSum(wA && rT); if (solverPerf.nIterations() == 0) { @@ -138,7 +138,7 @@ Foam::TPBiCG::solve } else { - scalar beta = cmptDivide(wArT, wArTold); + scalar beta = wArT/wArTold; for (register label cell=0; cell::solve this->matrix_.Amul(wA, pA); this->matrix_.Tmul(wT, pT); - scalar wApT = sum(wA & pT); - + scalar wApT = gSum(wA && pT); // --- Test for singularity - //if - //( - // solverPerf.checkSingularity(ratio(mag(wApT)normFactor)) - //) break; + if + ( + solverPerf.checkSingularity + ( + cmptDivide(Type::one*mag(wApT), normFactor) + ) + ) + { + break; + } // --- Update solution and residual: - scalar alpha = cmptDivide(wArT, wApT); + scalar alpha = wArT/wApT; for (register label cell=0; cell::solve(Field& psi) const // --- Test for singularity - if (solverPerf.singular(cmptDivide(cmptMag(wApA), normFactor))) + if + ( + solverPerf.checkSingularity + ( + cmptDivide(cmptMag(wApA), normFactor) + ) + ) { break; } diff --git a/src/OpenFOAM/matrices/LduMatrix/Solvers/lduSolvers.C b/src/OpenFOAM/matrices/LduMatrix/Solvers/lduSolvers.C index 0029abc632..30159b4a48 100644 --- a/src/OpenFOAM/matrices/LduMatrix/Solvers/lduSolvers.C +++ b/src/OpenFOAM/matrices/LduMatrix/Solvers/lduSolvers.C @@ -24,7 +24,8 @@ License \*---------------------------------------------------------------------------*/ #include "TPCG.H" -#include "TPBiCG.H" +//#include "TPBiCG.H" +#include "PBiCGScalarAlpha.H" #include "SmoothSolver.H" #include "fieldTypes.H" @@ -46,7 +47,7 @@ License namespace Foam { - makeLduSolvers(scalar, scalar, scalar); + //makeLduSolvers(scalar, scalar, scalar); makeLduSolvers(vector, scalar, scalar); makeLduSolvers(sphericalTensor, scalar, scalar); makeLduSolvers(symmTensor, scalar, scalar); diff --git a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterfaceFields/cyclicLduInterfaceField/cyclicLduInterfaceField.H b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterfaceFields/cyclicLduInterfaceField/cyclicLduInterfaceField.H index 86bdcd045e..7c54f36aed 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterfaceFields/cyclicLduInterfaceField/cyclicLduInterfaceField.H +++ b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterfaceFields/cyclicLduInterfaceField/cyclicLduInterfaceField.H @@ -84,10 +84,14 @@ public: virtual int rank() const = 0; - //- Transform given patch internal field + //- Transform given patch field + template + void transformCoupleField(Field& f) const; + + //- Transform given patch component field void transformCoupleField ( - scalarField& psiInternal, + scalarField& f, const direction cmpt ) const; }; @@ -97,6 +101,30 @@ public: } // End namespace Foam +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "tensorField.H" + +template +void Foam::cyclicLduInterfaceField::transformCoupleField +( + Field& f +) const +{ + if (doTransform()) + { + if (forwardT().size() == 1) + { + transform(f, forwardT()[0], f); + } + else + { + transform(f, forwardT(), f); + } + } +} + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif diff --git a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterfaceFields/lduInterfaceField/lduInterfaceField.H b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterfaceFields/lduInterfaceField/lduInterfaceField.H index e4aa7b1032..45ad3f0dca 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterfaceFields/lduInterfaceField/lduInterfaceField.H +++ b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterfaceFields/lduInterfaceField/lduInterfaceField.H @@ -73,6 +73,7 @@ class lduInterfaceField //- Disallow default bitwise assignment void operator=(const lduInterfaceField&); + public: //- Runtime type information @@ -112,17 +113,6 @@ public: // Coupled interface matrix update - //- Initialise neighbour matrix update - virtual void initInterfaceMatrixUpdate - ( - scalarField&, - const scalarField&, - const scalarField&, - const direction, - const Pstream::commsTypes commsType - ) const - {} - //- Whether matrix has been updated bool updatedMatrix() const { @@ -141,6 +131,17 @@ public: return true; } + //- Initialise neighbour matrix update + virtual void initInterfaceMatrixUpdate + ( + scalarField&, + const scalarField&, + const scalarField&, + const direction, + const Pstream::commsTypes commsType + ) const + {} + //- Update result field based on interface functionality virtual void updateInterfaceMatrix ( diff --git a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterfaceFields/processorLduInterfaceField/processorLduInterfaceField.H b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterfaceFields/processorLduInterfaceField/processorLduInterfaceField.H index b511193355..aed86320f7 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterfaceFields/processorLduInterfaceField/processorLduInterfaceField.H +++ b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterfaceFields/processorLduInterfaceField/processorLduInterfaceField.H @@ -87,6 +87,10 @@ public: virtual int rank() const = 0; + //- Transform given patch field + template + void transformCoupleField(Field& f) const; + //- Transform given patch component field void transformCoupleField ( @@ -100,6 +104,30 @@ public: } // End namespace Foam +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "tensorField.H" + +template +void Foam::processorLduInterfaceField::transformCoupleField +( + Field& f +) const +{ + if (doTransform()) + { + if (forwardT().size() == 1) + { + transform(f, forwardT()[0], f); + } + else + { + transform(f, forwardT(), f); + } + } +} + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.H b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.H index dc9583fc0b..b96c01bc96 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.H +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.H @@ -210,7 +210,7 @@ public: return singular_; } - //- Convergence test + //- Check, store and return convergence bool checkConvergence ( const scalar tolerance, @@ -223,6 +223,7 @@ public: //- Print summary of solver performance void print() const; + // Member Operators bool operator!=(const solverPerformance&) const; diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/PBiCG/PBiCG.C b/src/OpenFOAM/matrices/lduMatrix/solvers/PBiCG/PBiCG.C index b553bab048..fa5026a51b 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/PBiCG/PBiCG.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/PBiCG/PBiCG.C @@ -167,9 +167,11 @@ Foam::lduMatrix::solverPerformance Foam::PBiCG::solve scalar wApT = gSumProd(wA, pT); - // --- Test for singularity - if (solverPerf.checkSingularity(mag(wApT)/normFactor)) break; + if (solverPerf.checkSingularity(mag(wApT)/normFactor)) + { + break; + } // --- Update solution and residual: diff --git a/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.C index a5fa44e1d7..906edfb9ec 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.C @@ -39,7 +39,7 @@ coupledFvPatchField::coupledFvPatchField const DimensionedField& iF ) : - lduInterfaceField(refCast(p)), + LduInterfaceField(refCast(p)), fvPatchField(p, iF) {} @@ -52,7 +52,7 @@ coupledFvPatchField::coupledFvPatchField const Field& f ) : - lduInterfaceField(refCast(p)), + LduInterfaceField(refCast(p)), fvPatchField(p, iF, f) {} @@ -66,7 +66,7 @@ coupledFvPatchField::coupledFvPatchField const fvPatchFieldMapper& mapper ) : - lduInterfaceField(refCast(p)), + LduInterfaceField(refCast(p)), fvPatchField(ptf, p, iF, mapper) {} @@ -79,7 +79,7 @@ coupledFvPatchField::coupledFvPatchField const dictionary& dict ) : - lduInterfaceField(refCast(p)), + LduInterfaceField(refCast(p)), fvPatchField(p, iF, dict) {} @@ -90,7 +90,7 @@ coupledFvPatchField::coupledFvPatchField const coupledFvPatchField& ptf ) : - lduInterfaceField(refCast(ptf.patch())), + LduInterfaceField(refCast(ptf.patch())), fvPatchField(ptf) {} @@ -102,7 +102,7 @@ coupledFvPatchField::coupledFvPatchField const DimensionedField& iF ) : - lduInterfaceField(refCast(ptf.patch())), + LduInterfaceField(refCast(ptf.patch())), fvPatchField(ptf, iF) {} diff --git a/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.H index 5a271a763e..88f473829f 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.H @@ -35,7 +35,7 @@ SourceFiles #ifndef coupledFvPatchField_H #define coupledFvPatchField_H -#include "lduInterfaceField.H" +#include "LduInterfaceField.H" #include "fvPatchField.H" #include "coupledFvPatch.H" @@ -51,7 +51,7 @@ namespace Foam template class coupledFvPatchField : - public lduInterfaceField, + public LduInterfaceField, public fvPatchField { diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.C index 520d4b23db..90638bf40c 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.C @@ -221,6 +221,38 @@ void cyclicFvPatchField::updateInterfaceMatrix } +template +void cyclicFvPatchField::updateInterfaceMatrix +( + Field& result, + const Field& psiInternal, + const scalarField& coeffs, + const Pstream::commsTypes +) const +{ + Field pnf(this->size()); + + const labelUList& nbrFaceCells = + cyclicPatch().cyclicPatch().neighbPatch().faceCells(); + + forAll(pnf, facei) + { + pnf[facei] = psiInternal[nbrFaceCells[facei]]; + } + + // Transform according to the transformation tensors + transformCoupleField(pnf); + + // Multiply the field by coefficients and add into the result + const labelUList& faceCells = cyclicPatch_.faceCells(); + + forAll(faceCells, elemI) + { + result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI]; + } +} + + template void cyclicFvPatchField::write(Ostream& os) const { diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.H index b08b0aa91a..c3ba07477d 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.H @@ -166,6 +166,15 @@ public: const Pstream::commsTypes commsType ) const; + //- Update result field based on interface functionality + virtual void updateInterfaceMatrix + ( + Field& result, + const Field& psiInternal, + const scalarField& coeffs, + const Pstream::commsTypes commsType + ) const; + // Cyclic coupled interface functions diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchField.C index d86c49e5c4..c9fb2563c1 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchField.C @@ -45,6 +45,7 @@ processorFvPatchField::processorFvPatchField coupledFvPatchField(p, iF), procPatch_(refCast(p)), sendBuf_(0), + receiveBuf_(0), outstandingSendRequest_(-1), outstandingRecvRequest_(-1), scalarSendBuf_(0), @@ -63,6 +64,7 @@ processorFvPatchField::processorFvPatchField coupledFvPatchField(p, iF, f), procPatch_(refCast(p)), sendBuf_(0), + receiveBuf_(0), outstandingSendRequest_(-1), outstandingRecvRequest_(-1), scalarSendBuf_(0), @@ -83,6 +85,7 @@ processorFvPatchField::processorFvPatchField coupledFvPatchField(ptf, p, iF, mapper), procPatch_(refCast(p)), sendBuf_(0), + receiveBuf_(0), outstandingSendRequest_(-1), outstandingRecvRequest_(-1), scalarSendBuf_(0), @@ -126,6 +129,7 @@ processorFvPatchField::processorFvPatchField coupledFvPatchField(p, iF, dict), procPatch_(refCast(p)), sendBuf_(0), + receiveBuf_(0), outstandingSendRequest_(-1), outstandingRecvRequest_(-1), scalarSendBuf_(0), @@ -162,6 +166,7 @@ processorFvPatchField::processorFvPatchField coupledFvPatchField(ptf), procPatch_(refCast(ptf.patch())), sendBuf_(ptf.sendBuf_.xfer()), + receiveBuf_(ptf.receiveBuf_.xfer()), outstandingSendRequest_(-1), outstandingRecvRequest_(-1), scalarSendBuf_(ptf.scalarSendBuf_.xfer()), @@ -186,6 +191,7 @@ processorFvPatchField::processorFvPatchField coupledFvPatchField(ptf, iF), procPatch_(refCast(ptf.patch())), sendBuf_(0), + receiveBuf_(0), outstandingSendRequest_(-1), outstandingRecvRequest_(-1), scalarSendBuf_(0), @@ -428,6 +434,124 @@ void processorFvPatchField::updateInterfaceMatrix } +template +void processorFvPatchField::initInterfaceMatrixUpdate +( + Field&, + const Field& psiInternal, + const scalarField&, + const Pstream::commsTypes commsType +) const +{ + this->patch().patchInternalField(psiInternal, sendBuf_); + + if (commsType == Pstream::nonBlocking && !Pstream::floatTransfer) + { + // Fast path. + if (debug && !this->ready()) + { + FatalErrorIn + ( + "processorFvPatchField::initInterfaceMatrixUpdate(..)" + ) << "On patch " << procPatch_.name() + << " outstanding request." + << abort(FatalError); + } + + + receiveBuf_.setSize(sendBuf_.size()); + outstandingRecvRequest_ = UPstream::nRequests(); + IPstream::read + ( + Pstream::nonBlocking, + procPatch_.neighbProcNo(), + reinterpret_cast(receiveBuf_.begin()), + receiveBuf_.byteSize(), + procPatch_.tag() + ); + + outstandingSendRequest_ = UPstream::nRequests(); + OPstream::write + ( + Pstream::nonBlocking, + procPatch_.neighbProcNo(), + reinterpret_cast(sendBuf_.begin()), + sendBuf_.byteSize(), + procPatch_.tag() + ); + } + else + { + procPatch_.compressedSend(commsType, sendBuf_); + } + + const_cast&>(*this).updatedMatrix() = false; +} + + +template +void processorFvPatchField::updateInterfaceMatrix +( + Field& result, + const Field&, + const scalarField& coeffs, + const Pstream::commsTypes commsType +) const +{ + if (this->updatedMatrix()) + { + return; + } + + const labelUList& faceCells = this->patch().faceCells(); + + if (commsType == Pstream::nonBlocking && !Pstream::floatTransfer) + { + // Fast path. + if + ( + outstandingRecvRequest_ >= 0 + && outstandingRecvRequest_ < Pstream::nRequests() + ) + { + UPstream::waitRequest(outstandingRecvRequest_); + } + // Recv finished so assume sending finished as well. + outstandingSendRequest_ = -1; + outstandingRecvRequest_ = -1; + + // Consume straight from receiveBuf_ + + // Transform according to the transformation tensor + transformCoupleField(receiveBuf_); + + // Multiply the field by coefficients and add into the result + forAll(faceCells, elemI) + { + result[faceCells[elemI]] -= coeffs[elemI]*receiveBuf_[elemI]; + } + } + else + { + Field pnf + ( + procPatch_.compressedReceive(commsType, this->size())() + ); + + // Transform according to the transformation tensor + transformCoupleField(pnf); + + // Multiply the field by coefficients and add into the result + forAll(faceCells, elemI) + { + result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI]; + } + } + + const_cast&>(*this).updatedMatrix() = true; +} + + template bool processorFvPatchField::ready() const { diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchField.H index a085ae88e5..690a9dbe4f 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchField.H @@ -64,6 +64,9 @@ class processorFvPatchField //- Send buffer. mutable Field sendBuf_; + //- Receive buffer. + mutable Field receiveBuf_; + //- Outstanding request mutable label outstandingSendRequest_; @@ -184,6 +187,9 @@ public: //- Return patch-normal gradient virtual tmp > snGrad() const; + //- Is all data available + virtual bool ready() const; + //- Initialise neighbour matrix update virtual void initInterfaceMatrixUpdate ( @@ -194,9 +200,6 @@ public: const Pstream::commsTypes commsType ) const; - //- Is all data available - virtual bool ready() const; - //- Update result field based on interface functionality virtual void updateInterfaceMatrix ( @@ -207,6 +210,25 @@ public: const Pstream::commsTypes commsType ) const; + //- Initialise neighbour matrix update + virtual void initInterfaceMatrixUpdate + ( + Field& result, + const Field& psiInternal, + const scalarField& coeffs, + const Pstream::commsTypes commsType + ) const; + + //- Update result field based on interface functionality + virtual void updateInterfaceMatrix + ( + Field& result, + const Field& psiInternal, + const scalarField& coeffs, + const Pstream::commsTypes commsType + ) const; + + //- Processor coupled interface functions //- Return processor number diff --git a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C index 675c794070..a1eb9bc369 100644 --- a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C +++ b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C @@ -111,7 +111,7 @@ Foam::lduMatrix::solverPerformance Foam::fvMatrix::solve ); lduInterfaceFieldPtrsList interfaces = - psi.boundaryField().interfaces(); + psi.boundaryField().scalarInterfaces(); // Use the initMatrixInterfaces and updateMatrixInterfaces to correct // bouCoeffsCmpt for the explicit part of the coupled boundary @@ -245,7 +245,7 @@ Foam::tmp > Foam::fvMatrix::residual() const psiCmpt, res.component(cmpt) - boundaryDiagCmpt*psiCmpt, bouCoeffsCmpt, - psi_.boundaryField().interfaces(), + psi_.boundaryField().scalarInterfaces(), cmpt ) ); diff --git a/src/finiteVolume/fvMatrices/fvScalarMatrix/fvScalarMatrix.C b/src/finiteVolume/fvMatrices/fvScalarMatrix/fvScalarMatrix.C index 9b4b92af51..7782eac28a 100644 --- a/src/finiteVolume/fvMatrices/fvScalarMatrix/fvScalarMatrix.C +++ b/src/finiteVolume/fvMatrices/fvScalarMatrix/fvScalarMatrix.C @@ -80,7 +80,7 @@ Foam::fvMatrix::solver *this, boundaryCoeffs_, internalCoeffs_, - psi_.boundaryField().interfaces(), + psi_.boundaryField().scalarInterfaces(), solverControls ) ) @@ -158,7 +158,7 @@ Foam::lduMatrix::solverPerformance Foam::fvMatrix::solve *this, boundaryCoeffs_, internalCoeffs_, - psi.boundaryField().interfaces(), + psi.boundaryField().scalarInterfaces(), solverControls )->solve(psi.internalField(), totalSource); @@ -187,7 +187,7 @@ Foam::tmp Foam::fvMatrix::residual() const psi_.internalField(), source_ - boundaryDiag*psi_.internalField(), boundaryCoeffs_, - psi_.boundaryField().interfaces(), + psi_.boundaryField().scalarInterfaces(), 0 ) );