Parallel selective AMG - work in progress

This commit is contained in:
Hrvoje Jasak 2017-05-10 13:20:05 +01:00
parent bae31764dc
commit 89ab032da4
3 changed files with 59 additions and 23 deletions

View file

@ -100,7 +100,7 @@ public:
//- Construct from AMG interface and fine level interface field
processorSAMGInterfaceField
(
const SAMGInterface& AMGCp,
const SAMGInterface& SAMGCp,
const lduInterfaceField& fineInterfaceField
);
@ -116,7 +116,7 @@ public:
//- Return size
label size() const
{
return procInterface_.size();
return procInterface_.interfaceSize();
}

View file

@ -32,7 +32,7 @@ Author
SourceFiles
SAMGInterface.C
newAmgInterface.C
newSAMGInterface.C
\*---------------------------------------------------------------------------*/
@ -42,7 +42,7 @@ SourceFiles
#include "lduInterface.H"
#include "autoPtr.H"
#include "lduPrimitiveMesh.H"
#include "coeffFields.H"
#include "crMatrix.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -62,17 +62,24 @@ class SAMGInterface
//- Reference to ldu addressing
const lduPrimitiveMesh& lduMesh_;
//- Reference to prolongation matrix
const crMatrix& prolongation_;
protected:
// Protected data
//- Face-cell addressing. Contains coarse level addressing
//- Local face-cell addressing. Contains local coarse level addressing
// Detected as coarse cells on local side
labelField faceCells_;
//- Fine addressing. Contains fine index for each coarse face
labelField fineAddressing_;
//- Fine weights
scalarField fineWeights_;
private:
@ -100,17 +107,19 @@ public:
lduInterface,
(
const lduPrimitiveMesh& lduMesh,
const crMatrix& prolongation,
const lduInterfacePtrsList& coarseInterfaces,
const lduInterface& fineInterface,
const labelField& localSelectAddressing,
const labelField& neighbourSelectAddressing
const labelField& localRowLabel,
const labelField& neighbourRowLabel
),
(
lduMesh,
prolongation,
coarseInterfaces,
fineInterface,
localSelectAddressing,
neighbourSelectAddressing
localRowLabel,
neighbourRowLabel
)
);
@ -122,10 +131,11 @@ public:
static autoPtr<SAMGInterface> New
(
const lduPrimitiveMesh& lduMesh,
const crMatrix& prolongation,
const lduInterfacePtrsList& coarseInterfaces,
const lduInterface& fineInterface,
const labelField& localSelectAddressing,
const labelField& neighbourSelectAddressing
const labelField& localRowLabel,
const labelField& neighbourRowLabel
);
@ -133,9 +143,14 @@ public:
//- Construct from fine-level interface,
// local and neighbour select addressing
SAMGInterface(const lduPrimitiveMesh& lduMesh)
SAMGInterface
(
const lduPrimitiveMesh& lduMesh,
const crMatrix& prolongation
)
:
lduMesh_(lduMesh)
lduMesh_(lduMesh),
prolongation_(prolongation)
{}
@ -154,24 +169,42 @@ public:
return lduMesh_;
}
//- Return size
//- Return reference to prolongation matrix
const crMatrix& prolongation() const
{
return prolongation_;
}
//- Return local size
virtual label size() const
{
return faceCells_.size();
}
//- Return faceCell addressing
//- Return interface size
virtual label interfaceSize() const
{
return faceCells_.size();
}
//- Return local faceCell addressing
virtual const unallocLabelList& faceCells() const
{
return faceCells_;
}
//- Return fine addressing
//- Return fine addressing: fine index for each coarse face
const labelField& fineAddressing() const
{
return fineAddressing_;
}
//- Return fine weights
const scalarField& fineWeights() const
{
return fineWeights_;
}
//- Return the interface internal field of the given field
template<class Type>
tmp<Field<Type> > interfaceInternalField
@ -187,7 +220,7 @@ public:
) const;
// Agglomeration
// Coefficient selection
//- Select the given fine-level coefficients and return
virtual tmp<scalarField> selectCoeffs

View file

@ -32,10 +32,11 @@ License
Foam::autoPtr<Foam::SAMGInterface> Foam::SAMGInterface::New
(
const lduPrimitiveMesh& lduMesh,
const crMatrix& prolongation,
const lduInterfacePtrsList& coarseInterfaces,
const lduInterface& fineInterface,
const labelField& localRestrictAddressing,
const labelField& neighbourRestrictAddressing
const labelField& localRowLabel,
const labelField& neighbourRowLabel
)
{
word coupleType(fineInterface.type());
@ -50,10 +51,11 @@ Foam::autoPtr<Foam::SAMGInterface> Foam::SAMGInterface::New
"SAMGInterface::New\n"
"(\n"
" const lduPrimitiveMesh& lduMesh,\n"
" const crMatrix& prolongation,\n"
" const lduInterfacePtrsList& coarseInterfaces,\n"
" const lduInterface& fineInterface,\n"
" const labelField& localRestrictAddressing,\n"
" const labelField& neighbourRestrictAddressing\n"
" const labelField& localRowLabel,\n"
" const labelField& neighbourRowLabel\n"
")"
) << "Unknown SAMGInterface type " << coupleType << ".\n"
<< "Valid SAMGInterface types are :"
@ -66,10 +68,11 @@ Foam::autoPtr<Foam::SAMGInterface> Foam::SAMGInterface::New
cstrIter()
(
lduMesh,
prolongation,
coarseInterfaces,
fineInterface,
localRestrictAddressing,
neighbourRestrictAddressing
localRowLabel,
neighbourRowLabel
)
);
}