gamg on cyclics working again

This commit is contained in:
mattijs
2010-03-23 13:53:40 +00:00
parent 49fb39e8f3
commit 50160baa9c
32 changed files with 471 additions and 509 deletions

View File

@ -252,19 +252,18 @@ $(lduInterfaceFields)/lduInterfaceField/lduInterfaceField.C
$(lduInterfaceFields)/processorLduInterfaceField/processorLduInterfaceField.C
$(lduInterfaceFields)/cyclicLduInterfaceField/cyclicLduInterfaceField.C
/*
GAMG = $(lduMatrix)/solvers/GAMG
/*
*/
$(GAMG)/GAMGSolver.C
$(GAMG)/GAMGSolverAgglomerateMatrix.C
$(GAMG)/GAMGSolverScalingFactor.C
$(GAMG)/GAMGSolverSolve.C
GAMGInterfaces = $(GAMG)/interfaces
$(GAMGInterfaces)/GAMGInterface/GAMGInterface.C
$(GAMGInterfaces)/GAMGInterface/newGAMGInterface.C
$(GAMGInterfaces)/processorGAMGInterface/processorGAMGInterface.C
$(GAMGInterfaces)/cyclicGAMGInterface/cyclicGAMGInterface.C
GAMGInterfaceFields = $(GAMG)/interfaceFields
$(GAMGInterfaceFields)/GAMGInterfaceField/GAMGInterfaceField.C
$(GAMGInterfaceFields)/GAMGInterfaceField/newGAMGInterfaceField.C
@ -284,7 +283,6 @@ $(pairGAMGAgglomeration)/pairGAMGAgglomerationCombineLevels.C
algebraicPairGAMGAgglomeration = $(GAMGAgglomerations)/algebraicPairGAMGAgglomeration
$(algebraicPairGAMGAgglomeration)/algebraicPairGAMGAgglomeration.C
*/
meshes/lduMesh/lduMesh.C

View File

@ -155,7 +155,7 @@ void cyclicPointPatchField<Type>::swapAddSeparated
}
}
addToInternalField(pField, pf, cyclicPatch_.separatedPoints());
addToInternalField(pField, pf);
}

View File

@ -103,27 +103,27 @@ void processorPointPatchField<Type>::initSwapAddSeparated
)
const
{
if (Pstream::parRun())
{
// Get internal field into correct order for opposite side
Field<Type> pf
(
this->patchInternalField
(
pField,
procPatch_.reverseMeshPoints()
)
);
OPstream::write
(
commsType,
procPatch_.neighbProcNo(),
reinterpret_cast<const char*>(pf.begin()),
pf.byteSize(),
procPatch_.tag()
);
}
// if (Pstream::parRun())
// {
// // Get internal field into correct order for opposite side
// Field<Type> pf
// (
// this->patchInternalField
// (
// pField,
// procPatch_.reverseMeshPoints()
// )
// );
//
// OPstream::write
// (
// commsType,
// procPatch_.neighbProcNo(),
// reinterpret_cast<const char*>(pf.begin()),
// pf.byteSize(),
// procPatch_.tag()
// );
// }
}
@ -134,29 +134,29 @@ void processorPointPatchField<Type>::swapAddSeparated
Field<Type>& pField
) const
{
if (Pstream::parRun())
{
Field<Type> pnf(this->size());
IPstream::read
(
commsType,
procPatch_.neighbProcNo(),
reinterpret_cast<char*>(pnf.begin()),
pnf.byteSize(),
procPatch_.tag()
);
if (doTransform())
{
const processorPolyPatch& ppp = procPatch_.procPolyPatch();
const tensor& forwardT = ppp.forwardT();
transform(pnf, forwardT, pnf);
}
addToInternalField(pField, pnf, procPatch_.separatedPoints());
}
// if (Pstream::parRun())
// {
// Field<Type> pnf(this->size());
//
// IPstream::read
// (
// commsType,
// procPatch_.neighbProcNo(),
// reinterpret_cast<char*>(pnf.begin()),
// pnf.byteSize(),
// procPatch_.tag()
// );
//
// if (doTransform())
// {
// const processorPolyPatch& ppp = procPatch_.procPolyPatch();
// const tensor& forwardT = ppp.forwardT();
//
// transform(pnf, forwardT, pnf);
// }
//
// addToInternalField(pField, pnf, procPatch_.separatedPoints());
// }
}

View File

@ -96,17 +96,27 @@ processorCyclicPointPatchField<Type>::~processorCyclicPointPatchField()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void processorCyclicPointPatchField<Type>::initSwapAdd(Field<Type>& pField)
const
void processorCyclicPointPatchField<Type>::initSwapAddSeparated
(
const Pstream::commsTypes commsType,
Field<Type>& pField
) const
{
if (Pstream::parRun())
{
// Get internal field into my point order
Field<Type> pf(this->patchInternalField(pField));
// Get internal field into correct order for opposite side
Field<Type> pf
(
this->patchInternalField
(
pField,
procPatch_.reverseMeshPoints()
)
);
OPstream::write
(
Pstream::blocking,
commsType,
procPatch_.neighbProcNo(),
reinterpret_cast<const char*>(pf.begin()),
pf.byteSize(),
@ -117,7 +127,11 @@ const
template<class Type>
void processorCyclicPointPatchField<Type>::swapAdd(Field<Type>& pField) const
void processorCyclicPointPatchField<Type>::swapAddSeparated
(
const Pstream::commsTypes commsType,
Field<Type>& pField
) const
{
if (Pstream::parRun())
{
@ -125,7 +139,7 @@ void processorCyclicPointPatchField<Type>::swapAdd(Field<Type>& pField) const
IPstream::read
(
Pstream::blocking,
commsType,
procPatch_.neighbProcNo(),
reinterpret_cast<char*>(pnf.begin()),
pnf.byteSize(),
@ -134,129 +148,14 @@ void processorCyclicPointPatchField<Type>::swapAdd(Field<Type>& pField) const
if (doTransform())
{
procPatch_.procPolyPatch().transform(pnf);
const processorCyclicPolyPatch& ppp =
procPatch_.procCyclicPolyPatch();
const tensor& forwardT = ppp.forwardT();
//const processorPolyPatch& ppp = procPatch_.procPolyPatch();
//const labelList& nonGlobalPatchPoints =
// procPatch_.nonGlobalPatchPoints();
//
//// Mark patch that transformed point:
//// -3 : global patch point so handled in different patch
//// -2 : nonGlobalPatchPoints, initial value
//// -1 : originating from internal face, no transform necessary
//// >=0 : originating from coupled patch
//labelList hasTransformed(ppp.nPoints(), -3);
//forAll(nonGlobalPatchPoints, i)
//{
// hasTransformed[nonGlobalPatchPoints[i]] = -2;
//}
//
//forAll(ppp.patchIDs(), subI)
//{
// label patchI = ppp.patchIDs()[subI];
//
// if (patchI == -1)
// {
// for
// (
// label faceI = ppp.starts()[subI];
// faceI < ppp.starts()[subI+1];
// faceI++
// )
// {
// const face& f = ppp.localFaces()[faceI];
//
// forAll(f, fp)
// {
// label pointI = f[fp];
//
// if (hasTransformed[pointI] == -3)
// {
// // special point, handled elsewhere
// }
// else if (hasTransformed[pointI] == -2)
// {
// // first visit. Just mark.
// hasTransformed[pointI] = patchI;
// }
// else if (hasTransformed[pointI] == patchI)
// {
// // already done
// }
// else
// {
// FatalErrorIn
// (
// "processorCyclicPointPatchField<Type>::"
// "swapAdd(Field<Type>& pField) const"
// ) << "Point " << pointI
// << " on patch " << ppp.name()
// << " already transformed by patch "
// << hasTransformed[pointI]
// << abort(FatalError);
// }
// }
// }
// }
// else if
// (
// !refCast<const coupledPolyPatch>
// (
// ppp.boundaryMesh()[patchI]
// ).parallel()
// )
// {
// const tensor& T = refCast<const coupledPolyPatch>
// (
// ppp.boundaryMesh()[patchI]
// ).forwardT();
//
// for
// (
// label faceI = ppp.starts()[subI];
// faceI < ppp.starts()[subI+1];
// faceI++
// )
// {
// const face& f = ppp.localFaces()[faceI];
//
// forAll(f, fp)
// {
// label pointI = f[fp];
//
// if (hasTransformed[pointI] == -3)
// {
// // special point, handled elsewhere
// }
// else if (hasTransformed[pointI] == -2)
// {
// pnf[pointI] = transform(T, pnf[pointI]);
//
// hasTransformed[pointI] = patchI;
// }
// else if (hasTransformed[pointI] == patchI)
// {
// // already done
// }
// else
// {
// FatalErrorIn
// (
// "processorCyclicPointPatchField<Type>::"
// "swapAdd(Field<Type>& pField) const"
// ) << "Point " << pointI
// << " on patch " << ppp.name()
// << " subPatch " << patchI
// << " already transformed by patch "
// << hasTransformed[pointI]
// << abort(FatalError);
// }
// }
// }
// }
//}
transform(pnf, forwardT, pnf);
}
// All points are separated
addToInternalField(pField, pnf);
}
}

View File

@ -169,11 +169,19 @@ public:
)
{}
//- Initialise swap of patch point values
virtual void initSwapAdd(Field<Type>&) const;
//- Initialise swap of non-collocated patch point values
virtual void initSwapAddSeparated
(
const Pstream::commsTypes commsType,
Field<Type>&
) const;
//- Complete swap of patch point values and add to local values
virtual void swapAdd(Field<Type>&) const;
virtual void swapAddSeparated
(
const Pstream::commsTypes commsType,
Field<Type>&
) const;
};

View File

@ -37,9 +37,11 @@ namespace Foam
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::cyclicLduInterface::cyclicLduInterface(const label neighbPatchID)
:
neighbPatchID_(neighbPatchID)
//Foam::cyclicLduInterface::cyclicLduInterface(const label neighbPatchID)
//:
// neighbPatchID_(neighbPatchID)
//{}
Foam::cyclicLduInterface::cyclicLduInterface()
{}

View File

@ -52,8 +52,8 @@ class cyclicLduInterface
{
// Private data
//- Coupled patch
const label neighbPatchID_;
// //- Coupled patch
// const label neighbPatchID_;
// const cyclicLduInterface* neighbPatch_;
@ -64,8 +64,11 @@ public:
// Constructors
//- Construct from components
cyclicLduInterface(const label neighbPatchID);
// //- Construct from components
// cyclicLduInterface(const label neighbPatchID);
//- Construct null
cyclicLduInterface();
// Destructor
@ -76,22 +79,13 @@ public:
// Access
//- Return processor number
label neighbPatchID() const
{
return neighbPatchID_;
}
//- Return neighbour
virtual label neighbPatchID() const = 0;
// //- Return processor number
// const cyclicLduInterface& neighbPatch() const
// {
// if (!neighbPatch_)
// {
// FatalErrorIn("cyclicLduInterface::neighbPatch() const")
// << "Not owner." << abort(FatalError);
// }
// return neighbPatchID_;
// }
virtual bool owner() const = 0;
//- Return processor number
virtual const cyclicLduInterface& neighbPatch() const = 0;
//- Return face transformation tensor
virtual const tensor& forwardT() const = 0;

View File

@ -246,6 +246,8 @@ void Foam::GAMGAgglomeration::agglomerateLduAddressing
inti,
GAMGInterface::New
(
inti,
coarseInterfaces,
fineInterfaces[inti],
fineInterfaces[inti].interfaceInternalField(restrictMap),
fineInterfaces[inti].internalFieldTransfer

View File

@ -130,13 +130,13 @@ public:
}
//- Return face transformation tensor
virtual const tensorField& forwardT() const
virtual const tensor& forwardT() const
{
return cyclicInterface_.forwardT();
}
//- Return neighbour-cell transformation tensor
virtual const tensorField& reverseT() const
virtual const tensor& reverseT() const
{
return cyclicInterface_.reverseT();
}

View File

@ -153,7 +153,7 @@ public:
}
//- Return face transformation tensor
virtual const tensorField& forwardT() const
virtual const tensor& forwardT() const
{
return procInterface_.forwardT();
}

View File

@ -37,8 +37,9 @@ SourceFiles
#ifndef GAMGInterface_H
#define GAMGInterface_H
#include "lduInterface.H"
//#include "lduInterface.H"
#include "autoPtr.H"
#include "lduInterfacePtrsList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -58,6 +59,12 @@ protected:
// Protected data
//- My index in coarseInterfaces
const label index_;
//- All interfaces
const lduInterfacePtrsList& coarseInterfaces_;
//- Face-cell addressing
labelField faceCells_;
@ -90,11 +97,15 @@ public:
GAMGInterface,
lduInterface,
(
const label index,
const lduInterfacePtrsList& coarseInterfaces,
const lduInterface& fineInterface,
const labelField& localRestrictAddressing,
const labelField& neighbourRestrictAddressing
),
(
index,
coarseInterfaces,
fineInterface,
localRestrictAddressing,
neighbourRestrictAddressing
@ -108,6 +119,8 @@ public:
// the fine interface
static autoPtr<GAMGInterface> New
(
const label index,
const lduInterfacePtrsList& coarseInterfaces,
const lduInterface& fineInterface,
const labelField& localRestrictAddressing,
const labelField& neighbourRestrictAddressing
@ -120,10 +133,15 @@ public:
// local and neighbour restrict addressing
GAMGInterface
(
const label index,
const lduInterfacePtrsList& coarseInterfaces,
const lduInterface&,
const labelField&,
const labelField&
)
:
index_(index),
coarseInterfaces_(coarseInterfaces)
{}
@ -137,6 +155,16 @@ public:
return faceCells_.size();
}
virtual label index() const
{
return index_;
}
virtual const lduInterfacePtrsList& coarseInterfaces() const
{
return coarseInterfaces_;
}
//- Return faceCell addressing
virtual const unallocLabelList& faceCells() const
{

View File

@ -32,6 +32,8 @@ License
Foam::autoPtr<Foam::GAMGInterface> Foam::GAMGInterface::New
(
const label index,
const lduInterfacePtrsList& coarseInterfaces,
const lduInterface& fineInterface,
const labelField& localRestrictAddressing,
const labelField& neighbourRestrictAddressing
@ -60,6 +62,8 @@ Foam::autoPtr<Foam::GAMGInterface> Foam::GAMGInterface::New
(
cstrIter()
(
index,
coarseInterfaces,
fineInterface,
localRestrictAddressing,
neighbourRestrictAddressing

View File

@ -46,23 +46,37 @@ namespace Foam
Foam::cyclicGAMGInterface::cyclicGAMGInterface
(
const label index,
const lduInterfacePtrsList& coarseInterfaces,
const lduInterface& fineInterface,
const labelField& localRestrictAddressing,
const labelField& neighbourRestrictAddressing
)
:
cyclicLduInterface
(
refCast<const cyclicLduInterface>(fineInterface).neighbPatchID()
),
GAMGInterface
(
index,
coarseInterfaces,
fineInterface,
localRestrictAddressing,
neighbourRestrictAddressing
),
fineCyclicInterface_(refCast<const cyclicLduInterface>(fineInterface))
{
// //if (debug)
// {
// Pout<< "On fineInterface " << index << " with faceCells:"
// << fineInterface.faceCells() << endl;
// forAll(localRestrictAddressing, ffi)
// {
// Pout<< " local face " << ffi
// << " is on agglom cell " << localRestrictAddressing[ffi]
// << " nbr face on agglom cell "
// << neighbourRestrictAddressing[ffi]
// << endl;
// }
// }
// Make a lookup table of entries for owner/neighbour
Map<SLList<label> > neighboursTable
(
@ -77,20 +91,32 @@ Foam::cyclicGAMGInterface::cyclicGAMGInterface
label nCoarseFaces = 0;
label sizeBy2 = localRestrictAddressing.size()/2;
for (label ffi=0; ffi<sizeBy2; ffi++)
forAll (localRestrictAddressing, ffi)
{
label curMaster = localRestrictAddressing[ffi];
label curSlave = localRestrictAddressing[ffi + sizeBy2];
label curMaster = -1;
label curSlave = -1;
// Do switching on master/slave indexes based on the owner/neighbour of
// the processor index such that both sides get the same answer.
if (owner())
{
// Master side
curMaster = localRestrictAddressing[ffi];
curSlave = neighbourRestrictAddressing[ffi];
}
else
{
// Slave side
curMaster = neighbourRestrictAddressing[ffi];
curSlave = localRestrictAddressing[ffi];
}
// Look for the master cell. If it has already got a face,
// add the coefficient to the face. If not, create a new
// face.
// add the coefficient to the face. If not, create a new face.
if (neighboursTable.found(curMaster))
{
// Check all current neighbours to see if the current
// slave already exists. If so, add the coefficient.
// Check all current neighbours to see if the current slave already
// exists and if so, add the fine face to the agglomeration.
SLList<label>& curNbrs = neighboursTable.find(curMaster)();
@ -141,81 +167,110 @@ Foam::cyclicGAMGInterface::cyclicGAMGInterface
} // end for all fine faces
faceCells_.setSize(2*nCoarseFaces, -1);
faceRestrictAddressing_.setSize(localRestrictAddressing.size(), -1);
//faceCells_.setSize(nCoarseFaces, -1);
faceCells_.setSize(2*nCoarseFaces);
faceRestrictAddressing_.setSize(localRestrictAddressing.size());
labelList contents = neighboursTable.toc();
// Reset face counter for re-use
nCoarseFaces = 0;
// On master side, the owner addressing is stored in table of contents
forAll (contents, masterI)
// if (owner())
{
SLList<label>& curNbrs = neighboursTable.find(contents[masterI])();
SLList<SLList<label> >& curFaceFaces =
faceFaceTable.find(contents[masterI])();
SLList<label>::iterator nbrsIter = curNbrs.begin();
SLList<SLList<label> >::iterator faceFacesIter = curFaceFaces.begin();
for
(
;
nbrsIter != curNbrs.end(), faceFacesIter != curFaceFaces.end();
++nbrsIter, ++faceFacesIter
)
// On master side, the owner addressing is stored in table of contents
forAll (contents, masterI)
{
faceCells_[nCoarseFaces] = contents[masterI];
SLList<label>& curNbrs = neighboursTable.find(contents[masterI])();
SLList<SLList<label> >& curFaceFaces =
faceFaceTable.find(contents[masterI])();
SLList<label>::iterator nbrsIter = curNbrs.begin();
SLList<SLList<label> >::iterator faceFacesIter =
curFaceFaces.begin();
for
(
SLList<label>::iterator facesIter = faceFacesIter().begin();
facesIter != faceFacesIter().end();
++facesIter
;
nbrsIter != curNbrs.end(), faceFacesIter != curFaceFaces.end();
++nbrsIter, ++faceFacesIter
)
{
faceRestrictAddressing_[facesIter()] = nCoarseFaces;
}
faceCells_[nCoarseFaces] = contents[masterI];
nCoarseFaces++;
for
(
SLList<label>::iterator facesIter = faceFacesIter().begin();
facesIter != faceFacesIter().end();
++facesIter
)
{
faceRestrictAddressing_[facesIter()] = nCoarseFaces;
}
nCoarseFaces++;
}
}
}
// On slave side, the owner addressing is stored in linked lists
forAll (contents, masterI)
// else
{
SLList<label>& curNbrs = neighboursTable.find(contents[masterI])();
SLList<SLList<label> >& curFaceFaces =
faceFaceTable.find(contents[masterI])();
SLList<label>::iterator nbrsIter = curNbrs.begin();
SLList<SLList<label> >::iterator faceFacesIter = curFaceFaces.begin();
for
(
;
nbrsIter != curNbrs.end(), faceFacesIter != curFaceFaces.end();
++nbrsIter, ++faceFacesIter
)
// On slave side, the owner addressing is stored in linked lists
forAll (contents, masterI)
{
faceCells_[nCoarseFaces] = nbrsIter();
SLList<label>& curNbrs = neighboursTable.find(contents[masterI])();
SLList<SLList<label> >& curFaceFaces =
faceFaceTable.find(contents[masterI])();
SLList<label>::iterator nbrsIter = curNbrs.begin();
SLList<SLList<label> >::iterator faceFacesIter =
curFaceFaces.begin();
for
(
SLList<label>::iterator facesIter = faceFacesIter().begin();
facesIter != faceFacesIter().end();
++facesIter
;
nbrsIter != curNbrs.end(), faceFacesIter != curFaceFaces.end();
++nbrsIter, ++faceFacesIter
)
{
faceRestrictAddressing_[facesIter() + sizeBy2] = nCoarseFaces;
}
faceCells_[nCoarseFaces] = nbrsIter();
nCoarseFaces++;
for
(
SLList<label>::iterator facesIter = faceFacesIter().begin();
facesIter != faceFacesIter().end();
++facesIter
)
{
faceRestrictAddressing_[facesIter()] = nCoarseFaces;
}
nCoarseFaces++;
}
}
}
// //if (debug)
// {
// Pout<< "On fineInterface " << index << " with faceCells:"
// << fineInterface.faceCells() << endl;
// forAll(faceRestrictAddressing_, ffi)
// {
// Pout<< " local face " << ffi
// << " gets agglomerated into coarse local face "
// << faceRestrictAddressing_[ffi]
// << " with coarse cells:" << endl;
// forAll(faceCells_, i)
// {
// Pout<< " " << faceCells_[i] << endl;
// }
// }
// }
}
@ -227,28 +282,28 @@ Foam::cyclicGAMGInterface::~cyclicGAMGInterface()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::labelField> Foam::cyclicGAMGInterface::transfer
(
const Pstream::commsTypes,
const unallocLabelList& interfaceData
) const
{
notImplemented("cyclicGAMGInterface::transfer(..)");
//XXXXX to be done
tmp<labelField> tpnf(new labelField(size()));
labelField& pnf = tpnf();
label sizeby2 = size()/2;
for (label facei=0; facei<sizeby2; facei++)
{
pnf[facei] = interfaceData[facei + sizeby2];
pnf[facei + sizeby2] = interfaceData[facei];
}
return tpnf;
}
//Foam::tmp<Foam::labelField> Foam::cyclicGAMGInterface::transfer
//(
// const Pstream::commsTypes,
// const unallocLabelList& interfaceData
//) const
//{
// notImplemented("cyclicGAMGInterface::transfer(..)");
//
////XXXXX to be done
// tmp<labelField> tpnf(new labelField(size()));
// labelField& pnf = tpnf();
//
// label sizeby2 = size()/2;
//
// for (label facei=0; facei<sizeby2; facei++)
// {
// pnf[facei] = interfaceData[facei + sizeby2];
// pnf[facei + sizeby2] = interfaceData[facei];
// }
//
// return tpnf;
//}
Foam::tmp<Foam::labelField> Foam::cyclicGAMGInterface::internalFieldTransfer
@ -257,16 +312,18 @@ Foam::tmp<Foam::labelField> Foam::cyclicGAMGInterface::internalFieldTransfer
const unallocLabelList& iF
) const
{
notImplemented("cyclicGAMGInterface::internalFieldTransfer(..)");
const cyclicGAMGInterface& nbr = dynamic_cast<const cyclicGAMGInterface&>
(
neighbPatch()
);
const unallocLabelList& nbrFaceCells = nbr.faceCells();
//XXXXX to be done
tmp<labelField> tpnf(new labelField(size()));
labelField& pnf = tpnf();
forAll(pnf, facei)
{
pnf[facei] = iF[faceCells_[facei + sizeby2]];
pnf[facei + sizeby2] = iF[faceCells_[facei]];
pnf[facei] = iF[nbrFaceCells[facei]];
}
return tpnf;

View File

@ -81,6 +81,8 @@ public:
// local and neighbour restrict addressing
cyclicGAMGInterface
(
const label index,
const lduInterfacePtrsList& coarseInterfaces,
const lduInterface& fineInterface,
const labelField& restrictAddressing,
const labelField& neighbourRestrictAddressing
@ -96,12 +98,12 @@ public:
// Interface transfer functions
//- Transfer and return neighbour field
virtual tmp<labelField> transfer
(
const Pstream::commsTypes commsType,
const unallocLabelList& interfaceData
) const;
// //- Transfer and return neighbour field
// virtual tmp<labelField> transfer
// (
// const Pstream::commsTypes commsType,
// const unallocLabelList& interfaceData
// ) const;
//- Transfer and return internal field adjacent to the interface
virtual tmp<labelField> internalFieldTransfer
@ -113,6 +115,31 @@ public:
//- Cyclic interface functions
// //- Return my index
// virtual label patchID() const
// {
// return fineCyclicInterface_.patchID();
// }
//- Return neigbour processor number
virtual label neighbPatchID() const
{
return fineCyclicInterface_.neighbPatchID();
}
virtual bool owner() const
{
return fineCyclicInterface_.owner();
}
virtual const cyclicLduInterface& neighbPatch() const
{
return dynamic_cast<const cyclicLduInterface&>
(
coarseInterfaces_[neighbPatchID()]
);
}
//- Return face transformation tensor
virtual const tensor& forwardT() const
{

View File

@ -26,6 +26,7 @@ License
#include "processorGAMGInterface.H"
#include "addToRunTimeSelectionTable.H"
#include "Map.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -45,6 +46,8 @@ namespace Foam
Foam::processorGAMGInterface::processorGAMGInterface
(
const label index,
const lduInterfacePtrsList& coarseInterfaces,
const lduInterface& fineInterface,
const labelField& localRestrictAddressing,
const labelField& neighbourRestrictAddressing
@ -52,6 +55,8 @@ Foam::processorGAMGInterface::processorGAMGInterface
:
GAMGInterface
(
index,
coarseInterfaces,
fineInterface,
localRestrictAddressing,
neighbourRestrictAddressing
@ -59,13 +64,13 @@ Foam::processorGAMGInterface::processorGAMGInterface
fineProcInterface_(refCast<const processorLduInterface>(fineInterface))
{
// Make a lookup table of entries for owner/neighbour
HashTable<SLList<label>, label, Hash<label> > neighboursTable
Map<SLList<label> > neighboursTable
(
localRestrictAddressing.size()
);
// Table of face-sets to be agglomerated
HashTable<SLList<SLList<label> >, label, Hash<label> > faceFaceTable
Map<SLList<SLList<label> > > faceFaceTable
(
localRestrictAddressing.size()
);

View File

@ -81,6 +81,8 @@ public:
// local and neighbour restrict addressing
processorGAMGInterface
(
const label index,
const lduInterfacePtrsList& coarseInterfaces,
const lduInterface& fineInterface,
const labelField& restrictAddressing,
const labelField& neighbourRestrictAddressing
@ -140,10 +142,16 @@ public:
}
//- Return face transformation tensor
virtual const tensorField& forwardT() const
virtual const tensor& forwardT() const
{
return fineProcInterface_.forwardT();
}
//- Return message tag used for sending
virtual int tag() const
{
return fineProcInterface_.tag();
}
};

View File

@ -54,28 +54,7 @@ void Foam::cyclicPointPatch::initGeometry(PstreamBuffers&)
void Foam::cyclicPointPatch::calcGeometry(PstreamBuffers&)
{
const edgeList& cp = cyclicPolyPatch_.coupledPoints();
const labelList& mp = cyclicPolyPatch_.meshPoints();
DynamicList<label> separated;
forAll(cp, i)
{
const edge& coupledSet = cp[i];
// Assume all points are separated.
separated.append(coupledSet[0]);
separated.append(coupledSet[1]);
}
separatedPoints_.transfer(separated);
if (debug)
{
Pout<< "cyclic:" << cyclicPolyPatch_.name()
<< " separated:" << separatedPoints_.size()
<< " out of points:" << mp.size() << endl;
}
}
{}
void cyclicPointPatch::initMovePoints(PstreamBuffers&, const pointField&)
@ -127,10 +106,10 @@ const edgeList& cyclicPointPatch::transformPairs() const
}
const labelList& cyclicPointPatch::separatedPoints() const
{
return separatedPoints_;
}
//const labelList& cyclicPointPatch::separatedPoints() const
//{
// return separatedPoints_;
//}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -58,8 +58,8 @@ class cyclicPointPatch
//- Local reference cast into the cyclic patch
const cyclicPolyPatch& cyclicPolyPatch_;
//- List of local points that are not collocated
mutable labelList separatedPoints_;
// //- List of local points that are not collocated
// mutable labelList separatedPoints_;
// Private Member Functions
@ -156,8 +156,8 @@ public:
// neighbour patch.
virtual const edgeList& transformPairs() const;
//- List of separated coupled points
virtual const labelList& separatedPoints() const;
// //- List of separated coupled points
// virtual const labelList& separatedPoints() const;
};

View File

@ -77,51 +77,7 @@ void Foam::processorPointPatch::initGeometry(PstreamBuffers& pBufs)
void Foam::processorPointPatch::calcGeometry(PstreamBuffers& pBufs)
{
if (Pstream::parRun())
{
const boolList& collocated = procPolyPatch_.collocated();
if (collocated.size() == 0)
{
separatedPoints_.setSize(0);
}
else if (collocated.size() == 1)
{
// Uniformly
if (collocated[0])
{
separatedPoints_.setSize(0);
}
else
{
separatedPoints_ = identity(size());
}
}
else
{
// Per face collocated or not.
const labelListList& pointFaces = procPolyPatch_.pointFaces();
DynamicList<label> separated;
forAll(pointFaces, pfi)
{
if (!collocated[pointFaces[pfi][0]])
{
separated.append(pfi);
}
}
separatedPoints_.transfer(separated);
}
}
if (debug)
{
Pout<< "processor:" << name()
<< " separated:" << separatedPoints_.size()
<< " out of points:" << size() << endl;
}
}
{}
void processorPointPatch::initMovePoints(PstreamBuffers&, const pointField&)
@ -173,12 +129,6 @@ const labelList& processorPointPatch::reverseMeshPoints() const
}
const labelList& processorPointPatch::separatedPoints() const
{
return separatedPoints_;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

View File

@ -66,7 +66,7 @@ class processorPointPatch
mutable labelList reverseMeshPoints_;
mutable labelList separatedPoints_;
// mutable labelList separatedPoints_;
// Private Member Functions
@ -170,8 +170,8 @@ public:
//- Return mesh points in the correct order for the receiving side
const labelList& reverseMeshPoints() const;
//- List of separated coupled points
virtual const labelList& separatedPoints() const;
// //- List of separated coupled points
// virtual const labelList& separatedPoints() const;
};

View File

@ -137,11 +137,11 @@ public:
// return !isMaster();
// }
//
// //- Return the underlying processorPolyPatch
// const processorPolyPatch& procPolyPatch() const
// {
// return procPolyPatch_;
// }
//- Return the underlying processorCyclicPolyPatch
const processorCyclicPolyPatch& procCyclicPolyPatch() const
{
return procCycPolyPatch_;
}
};

View File

@ -110,8 +110,8 @@ public:
return true;
}
//- List of separated coupled points
virtual const labelList& separatedPoints() const = 0;
////- List of separated coupled points
//virtual const labelList& separatedPoints() const = 0;
};

View File

@ -26,6 +26,7 @@ License
#include "globalPoints.H"
#include "processorPolyPatch.H"
#include "processorCyclicPolyPatch.H"
#include "cyclicPolyPatch.H"
#include "polyMesh.H"

View File

@ -159,10 +159,6 @@ class globalPoints
// Private Member Functions
//- Return per point collocated status
static PackedBoolList collocatedPoints(const coupledPolyPatch&);
// Wrappers around global point numbering to add collocated bit
//- Convert into globalIndices and add collocated bit

View File

@ -325,7 +325,7 @@ public:
}
//- Neighbour patchID.
label neighbPatchID() const
virtual label neighbPatchID() const
{
if (neighbPatchID_ == -1)
{
@ -345,12 +345,12 @@ public:
return neighbPatchID_;
}
bool owner() const
virtual bool owner() const
{
return index() < neighbPatchID();
}
bool neighbour() const
virtual bool neighbour() const
{
return !owner();
}

View File

@ -178,10 +178,8 @@ fields/surfaceFields/surfaceFields.C
fvMatrices/fvMatrices.C
fvMatrices/fvScalarMatrix/fvScalarMatrix.C
/*
fvMatrices/solvers/MULES/MULES.C
fvMatrices/solvers/GAMGSymSolver/GAMGAgglomerations/faceAreaPairGAMGAgglomeration/faceAreaPairGAMGAgglomeration.C
*/
interpolation = interpolation/interpolation
$(interpolation)/interpolation/interpolations.C
@ -218,7 +216,6 @@ $(schemes)/localBlended/localBlended.C
$(schemes)/localMax/localMax.C
$(schemes)/localMin/localMin.C
/*
$(schemes)/linearFit/linearFit.C
$(schemes)/biLinearFit/biLinearFit.C
$(schemes)/quadraticLinearFit/quadraticLinearFit.C
@ -227,9 +224,10 @@ $(schemes)/quadraticFit/quadraticFit.C
$(schemes)/quadraticLinearUpwindFit/quadraticLinearUpwindFit.C
$(schemes)/quadraticUpwindFit/quadraticUpwindFit.C
$(schemes)/cubicUpwindFit/cubicUpwindFit.C
/*
$(schemes)/quadraticLinearPureUpwindFit/quadraticLinearPureUpwindFit.C
$(schemes)/linearPureUpwindFit/linearPureUpwindFit.C
*/
$(schemes)/linearPureUpwindFit/linearPureUpwindFit.C
limitedSchemes = $(surfaceInterpolation)/limitedSchemes
$(limitedSchemes)/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationSchemes.C
@ -260,7 +258,6 @@ multivariateSchemes = $(surfaceInterpolation)/multivariateSchemes
$(multivariateSchemes)/multivariateSurfaceInterpolationScheme/multivariateSurfaceInterpolationSchemes.C
$(multivariateSchemes)/multivariateSelectionScheme/multivariateSelectionSchemes.C
$(multivariateSchemes)/upwind/multivariateUpwind.C
/*
$(multivariateSchemes)/Gamma/multivariateGamma.C
$(multivariateSchemes)/vanLeer/multivariateVanLeer.C
$(multivariateSchemes)/Minmod/multivariateMinmod.C
@ -268,7 +265,6 @@ $(multivariateSchemes)/SuperBee/multivariateSuperBee.C
$(multivariateSchemes)/MUSCL/multivariateMUSCL.C
$(multivariateSchemes)/limitedLinear/multivariateLimitedLinear.C
$(multivariateSchemes)/limitedCubic/multivariateLimitedCubic.C
*/
finiteVolume/fv/fv.C
finiteVolume/fvSchemes/fvSchemes.C
@ -297,21 +293,17 @@ gradSchemes = finiteVolume/gradSchemes
$(gradSchemes)/gradScheme/gradSchemes.C
$(gradSchemes)/gaussGrad/gaussGrads.C
/*
$(gradSchemes)/leastSquaresGrad/leastSquaresVectors.C
$(gradSchemes)/leastSquaresGrad/leastSquaresGrads.C
$(gradSchemes)/extendedLeastSquaresGrad/extendedLeastSquaresVectors.C
$(gradSchemes)/extendedLeastSquaresGrad/extendedLeastSquaresGrads.C
$(gradSchemes)/fourthGrad/fourthGrads.C
*/
limitedGradSchemes = $(gradSchemes)/limitedGradSchemes
/*
$(limitedGradSchemes)/faceLimitedGrad/faceLimitedGrads.C
$(limitedGradSchemes)/cellLimitedGrad/cellLimitedGrads.C
$(limitedGradSchemes)/faceMDLimitedGrad/faceMDLimitedGrads.C
$(limitedGradSchemes)/cellMDLimitedGrad/cellMDLimitedGrads.C
*/
snGradSchemes = finiteVolume/snGradSchemes
$(snGradSchemes)/snGradScheme/snGradSchemes.C

View File

@ -83,10 +83,6 @@ public:
cyclicFvPatch(const polyPatch& patch, const fvBoundaryMesh& bm)
:
coupledFvPatch(patch, bm),
cyclicLduInterface
(
refCast<const cyclicPolyPatch>(patch).neighbPatchID()
),
cyclicPolyPatch_(refCast<const cyclicPolyPatch>(patch))
{}
@ -101,6 +97,26 @@ public:
return cyclicPolyPatch_;
}
//- Return neighbour
virtual label neighbPatchID() const
{
return cyclicPolyPatch_.neighbPatchID();
}
virtual bool owner() const
{
return cyclicPolyPatch_.owner();
}
//- Return processor number
virtual const cyclicLduInterface& neighbPatch() const
{
return refCast<const cyclicFvPatch>
(
this->boundaryMesh()[cyclicPolyPatch_.neighbPatchID()]
);
}
//- Are the cyclic planes parallel
virtual bool parallel() const
{