Skip to content
Snippets Groups Projects
Commit 830309a3 authored by Mark OLESEN's avatar Mark OLESEN
Browse files

ENH: initial handling of cyclic interfaces

parent fda0975b
Branches
Tags
No related merge requests found
......@@ -29,6 +29,8 @@ License
#include "fvMesh.H"
#include "fvMatrices.H"
#include "globalIndex.H"
#include "cyclicLduInterface.H"
#include "cyclicAMILduInterface.H"
#include "addToRunTimeSelectionTable.H"
#include "petscControls.H"
......@@ -337,16 +339,36 @@ void Foam::petscSolver::computeMatAllocation
integerList nonZeroNeigh_(nrows_, 0);
// Number of off-processor non-zeros
// Number of non-zeros from interfaces (on-processor or off-processor)
forAll(interfaces, patchi)
{
// Is coupled interface with neighbour?
if (interfaces.set(patchi))
const lduInterface* intf = interfaces.set(patchi);
if (intf)
{
const labelUList& faceCells = lduAddr.patchAddr(patchi);
for (const label celli : faceCells)
if (isA<cyclicAMILduInterface>(*intf))
{
FatalErrorInFunction
<< "cyclicAMI is not supported" << nl
<< exit(FatalError);
}
else if (isA<cyclicLduInterface>(*intf))
{
++nonZeroNeigh_[celli];
// Cyclic is on-processor
for (const label celli : faceCells)
{
++nonZero_[celli];
}
}
else
{
// Off-processor
for (const label celli : faceCells)
{
++nonZeroNeigh_[celli];
}
}
}
}
......@@ -523,13 +545,23 @@ void Foam::petscSolver::buildMat
labelField nbrCells
(
interfaces[patchi].internalFieldTransfer
(
Pstream::commsTypes::nonBlocking,
globalCells
)
interfaces[patchi].internalFieldTransfer
(
Pstream::commsTypes::nonBlocking,
globalCells
)
);
if (faceCells.size() != nbrCells.size())
{
FatalErrorInFunction
<< "Mismatch in interface sizes (AMI?)" << nl
<< "Have " << faceCells.size() << " != "
<< nbrCells.size() << nl
<< exit(FatalError);
}
const label off = globalNumbering_.localStart();
// NB:opposite sign since we using this sides'
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment