mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: use neighbourPatch information instead of size()/2 offset.
This commit is contained in:
@ -27,6 +27,7 @@ License
|
|||||||
#include "lduMatrix.H"
|
#include "lduMatrix.H"
|
||||||
#include "procLduMatrix.H"
|
#include "procLduMatrix.H"
|
||||||
#include "procLduInterface.H"
|
#include "procLduInterface.H"
|
||||||
|
#include "cyclicLduInterface.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -130,6 +131,8 @@ void Foam::LUscalarMatrix::convert
|
|||||||
const lduInterfaceFieldPtrsList& interfaces
|
const lduInterfaceFieldPtrsList& interfaces
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
//Pout<< "LUscalarMatrix::convert **" << endl;
|
||||||
|
//
|
||||||
const label* __restrict__ uPtr = ldum.lduAddr().upperAddr().begin();
|
const label* __restrict__ uPtr = ldum.lduAddr().upperAddr().begin();
|
||||||
const label* __restrict__ lPtr = ldum.lduAddr().lowerAddr().begin();
|
const label* __restrict__ lPtr = ldum.lduAddr().lowerAddr().begin();
|
||||||
|
|
||||||
@ -160,19 +163,27 @@ void Foam::LUscalarMatrix::convert
|
|||||||
{
|
{
|
||||||
const lduInterface& interface = interfaces[inti].interface();
|
const lduInterface& interface = interfaces[inti].interface();
|
||||||
|
|
||||||
const label* __restrict__ ulPtr = interface.faceCells().begin();
|
// Assume any interfaces are cyclic ones
|
||||||
const scalar* __restrict__ upperLowerPtr =
|
|
||||||
interfaceCoeffs[inti].begin();
|
|
||||||
|
|
||||||
register label inFaces = interface.faceCells().size()/2;
|
const label* __restrict__ lPtr = interface.faceCells().begin();
|
||||||
|
|
||||||
|
const cyclicLduInterface& cycInterface =
|
||||||
|
refCast<const cyclicLduInterface>(interface);
|
||||||
|
label nbrInt = cycInterface.neighbPatchID();
|
||||||
|
const label* __restrict__ uPtr =
|
||||||
|
interfaces[nbrInt].interface().faceCells().begin();
|
||||||
|
|
||||||
|
const scalar* __restrict__ nbrUpperLowerPtr =
|
||||||
|
interfaceCoeffs[nbrInt].begin();
|
||||||
|
|
||||||
|
register label inFaces = interface.faceCells().size();
|
||||||
|
|
||||||
for (register label face=0; face<inFaces; face++)
|
for (register label face=0; face<inFaces; face++)
|
||||||
{
|
{
|
||||||
label uCell = ulPtr[face];
|
label uCell = lPtr[face];
|
||||||
label lCell = ulPtr[face + inFaces];
|
label lCell = uPtr[face];
|
||||||
|
|
||||||
operator[](uCell)[lCell] -= upperLowerPtr[face + inFaces];
|
operator[](uCell)[lCell] -= nbrUpperLowerPtr[face];
|
||||||
operator[](lCell)[uCell] -= upperLowerPtr[face];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user