Parallel block selective AMG interfaces

This commit is contained in:
Hrvoje Jasak 2017-05-10 21:12:51 +01:00
parent 89ab032da4
commit 52c9cbf138
3 changed files with 9 additions and 14 deletions

View file

@ -58,7 +58,6 @@ Foam::processorSAMGInterfaceField::processorSAMGInterfaceField
scalarSendBuf_(0), scalarSendBuf_(0),
scalarReceiveBuf_(0) scalarReceiveBuf_(0)
{ {
Pout<< "Creating processor SAMG interface field" << endl;
const processorLduInterfaceField& p = const processorLduInterfaceField& p =
refCast<const processorLduInterfaceField>(fineInterfaceField); refCast<const processorLduInterfaceField>(fineInterfaceField);

View file

@ -54,9 +54,9 @@ Foam::tmp<Foam::scalarField> Foam::SAMGInterface::selectCoeffs
scalarField& coarseCoeffs = tcoarseCoeffs(); scalarField& coarseCoeffs = tcoarseCoeffs();
// Added weights to account for non-integral matching // Added weights to account for non-integral matching
forAll (fineAddressing_, ffi) forAll (fineAddressing_, ffI)
{ {
coarseCoeffs[ffi] = fineCoeffs[fineAddressing_[ffi]]; coarseCoeffs[ffI] = fineWeights_[ffI]*fineCoeffs[fineAddressing_[ffI]];
} }
return tcoarseCoeffs; return tcoarseCoeffs;

View file

@ -57,8 +57,6 @@ Foam::processorSAMGInterface::processorSAMGInterface
comm_(fineProcInterface_.comm()), comm_(fineProcInterface_.comm()),
tag_(fineProcInterface_.tag()) tag_(fineProcInterface_.tag())
{ {
Pout<< "Creating processor SAMG interface" << endl;
// Analyse the local and neighbour row label: // Analyse the local and neighbour row label:
// local coarse, remote coarse = regular coarse face // local coarse, remote coarse = regular coarse face
// local coarse, remote fine = local expanded face: receive prolonged data // local coarse, remote fine = local expanded face: receive prolonged data
@ -98,7 +96,7 @@ Foam::processorSAMGInterface::processorSAMGInterface
// Get fine faceCells // Get fine faceCells
const labelList& fineFaceCells = fineInterface.faceCells(); const labelList& fineFaceCells = fineInterface.faceCells();
Pout<< "fineFaceCells: " << fineFaceCells << endl;
// Collect local fine to neighbour coarse connections for communication // Collect local fine to neighbour coarse connections for communication
forAll (localRowLabel, faceI) forAll (localRowLabel, faceI)
{ {
@ -115,7 +113,7 @@ Foam::processorSAMGInterface::processorSAMGInterface
const label curStart = pRowStart[fineFaceCells[faceI]]; const label curStart = pRowStart[fineFaceCells[faceI]];
const label curEnd = pRowStart[fineFaceCells[faceI] + 1]; const label curEnd = pRowStart[fineFaceCells[faceI] + 1];
const label nCoarse = curEnd - curStart; const label nCoarse = curEnd - curStart;
Pout<< "Eqn: " << fineFaceCells[faceI] << " Span: " << curStart << " " << curEnd << " = " << nCoarse << endl;
labelList nbrs(nCoarse); labelList nbrs(nCoarse);
scalarField weights(nCoarse); scalarField weights(nCoarse);
@ -124,7 +122,7 @@ Foam::processorSAMGInterface::processorSAMGInterface
nbrs[i] = pColumn[curStart + i]; nbrs[i] = pColumn[curStart + i];
weights[i] = pCoeffs[curStart + i]; weights[i] = pCoeffs[curStart + i];
} }
Pout<< "weights: " << weights << endl;
// Insert neighbours under remote coarse index // Insert neighbours under remote coarse index
neighboursFromLocalFine.insert(neighbourRowLabel[faceI], nbrs); neighboursFromLocalFine.insert(neighbourRowLabel[faceI], nbrs);
weightsFromLocalFine.insert(neighbourRowLabel[faceI], weights); weightsFromLocalFine.insert(neighbourRowLabel[faceI], weights);
@ -173,7 +171,7 @@ Foam::processorSAMGInterface::processorSAMGInterface
) )
{ {
// Found local coarse to neighbour coarse face // Found local coarse to neighbour coarse face
Pout<< "face " << faceI << " CC" << endl;
// Create new coarse face // Create new coarse face
faceCells_[nCoarseFaces] = localRowLabel[faceI]; faceCells_[nCoarseFaces] = localRowLabel[faceI];
fineAddressing_[nCoarseFaces] = faceI; fineAddressing_[nCoarseFaces] = faceI;
@ -196,8 +194,7 @@ Foam::processorSAMGInterface::processorSAMGInterface
const scalarField& curLocalCoarseWeights = const scalarField& curLocalCoarseWeights =
weightsFromLocalFine[neighbourRowLabel[faceI]]; weightsFromLocalFine[neighbourRowLabel[faceI]];
Pout<< "face " << faceI << " FC, size: " << curLocalCoarseNbrs.size()
<< " W: " << curLocalCoarseWeights << endl;
forAll (curLocalCoarseNbrs, curNbrI) forAll (curLocalCoarseNbrs, curNbrI)
{ {
// Create new coarse face // Create new coarse face
@ -223,8 +220,7 @@ Foam::processorSAMGInterface::processorSAMGInterface
const scalarField& curNbrCoarseWeights = const scalarField& curNbrCoarseWeights =
weightsFromRemoteFine[localRowLabel[faceI]]; weightsFromRemoteFine[localRowLabel[faceI]];
Pout<< "face " << faceI << " CF, size: " << curNbrCoarseNbrs.size()
<< " W: " << curNbrCoarseWeights << endl;
forAll (curNbrCoarseNbrs, curNbrI) forAll (curNbrCoarseNbrs, curNbrI)
{ {
// Create new coarse face // Create new coarse face
@ -249,7 +245,7 @@ Foam::processorSAMGInterface::processorSAMGInterface
<< " nFineFaces = " << fineProcInterface_.interfaceSize() << " nFineFaces = " << fineProcInterface_.interfaceSize()
<< abort(FatalError); << abort(FatalError);
} }
Pout<< "nCoarseFaces: " << nCoarseFaces << endl;
// Resize arrays to final size // Resize arrays to final size
faceCells_.setSize(nCoarseFaces); faceCells_.setSize(nCoarseFaces);
fineAddressing_.setSize(nCoarseFaces); fineAddressing_.setSize(nCoarseFaces);