Merge remote-tracking branch 'origin/BUGFIX/coarseningAndAgglomeration' into nextRelease
This commit is contained in:
commit
09f257eeab
22 changed files with 190 additions and 183 deletions
|
@ -661,8 +661,8 @@ $(BlockLduInterfaceField)/blockVectorNGAMGInterfaceFields.C
|
||||||
|
|
||||||
matrices/blockLduMatrix/BlockAmg/blockAmgCycles.C
|
matrices/blockLduMatrix/BlockAmg/blockAmgCycles.C
|
||||||
matrices/blockLduMatrix/BlockAmg/blockAmgLevels.C
|
matrices/blockLduMatrix/BlockAmg/blockAmgLevels.C
|
||||||
matrices/blockLduMatrix/BlockAmg/BlockAmgPolicy/blockAmgPolicies.C
|
matrices/blockLduMatrix/BlockAmg/BlockMatrixCoarsening/blockMatrixCoarsenings.C
|
||||||
matrices/blockLduMatrix/BlockAmg/BlockAmgPolicy/blockAamgPolicies.C
|
matrices/blockLduMatrix/BlockAmg/BlockMatrixCoarsening/blockMatrixAgglomerations.C
|
||||||
|
|
||||||
matrices/blockLduMatrix/BlockLduPrecons/BlockLduPrecon/blockLduPrecons.C
|
matrices/blockLduMatrix/BlockLduPrecons/BlockLduPrecon/blockLduPrecons.C
|
||||||
matrices/blockLduMatrix/BlockLduPrecons/BlockNoPrecon/blockNoPrecons.C
|
matrices/blockLduMatrix/BlockLduPrecons/BlockNoPrecon/blockNoPrecons.C
|
||||||
|
|
|
@ -55,7 +55,7 @@ template<class Type>
|
||||||
class coarseBlockAmgLevel;
|
class coarseBlockAmgLevel;
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
class BlockAmgPolicy;
|
class BlockMatrixCoarsening;
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
class BlockAmgLevel;
|
class BlockAmgLevel;
|
||||||
|
|
|
@ -39,7 +39,7 @@ SourceFiles
|
||||||
#define BlockAmgLevel_H
|
#define BlockAmgLevel_H
|
||||||
|
|
||||||
#include "BlockLduMatrix.H"
|
#include "BlockLduMatrix.H"
|
||||||
#include "BlockAmgPolicy.H"
|
#include "BlockMatrixCoarsening.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ template<class Type>
|
||||||
class BlockAmgCycle;
|
class BlockAmgCycle;
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
class BlockAmgPolicy;
|
class BlockMatrixCoarsening;
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
class BlockAmgSolver;
|
class BlockAmgSolver;
|
||||||
|
|
|
@ -22,17 +22,17 @@ License
|
||||||
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
|
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Class
|
Class
|
||||||
BlockAamgPolicy
|
BlockMatrixAgglomeration
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Agglomerative AMG policy, adjusted for BlockLduMatrix
|
Agglomerative block matrix AMG corsening, adjusted for BlockLduMatrix
|
||||||
|
|
||||||
Author
|
Author
|
||||||
Klas Jareteg, 2012-12-13
|
Klas Jareteg, 2012-12-13
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "BlockAamgPolicy.H"
|
#include "BlockMatrixAgglomeration.H"
|
||||||
#include "coeffFields.H"
|
#include "coeffFields.H"
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
#include "BlockGAMGInterfaceField.H"
|
#include "BlockGAMGInterfaceField.H"
|
||||||
|
@ -41,13 +41,13 @@ Author
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
const Foam::scalar Foam::BlockAamgPolicy<Type>::weightFactor_ = 0.65;
|
const Foam::scalar Foam::BlockMatrixAgglomeration<Type>::weightFactor_ = 0.65;
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void Foam::BlockAamgPolicy<Type>::calcChild()
|
void Foam::BlockMatrixAgglomeration<Type>::calcChild()
|
||||||
{
|
{
|
||||||
// Algorithm:
|
// Algorithm:
|
||||||
// 1) Create temporary equation addressing using a double-pass algorithm.
|
// 1) Create temporary equation addressing using a double-pass algorithm.
|
||||||
|
@ -249,7 +249,7 @@ void Foam::BlockAamgPolicy<Type>::calcChild()
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
nCoarseEqns_ > BlockAmgPolicy<Type>::minCoarseEqns()
|
nCoarseEqns_ > BlockMatrixCoarsening<Type>::minCoarseEqns()
|
||||||
&& 3*nCoarseEqns_ <= 2*nRows
|
&& 3*nCoarseEqns_ <= 2*nRows
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
@ -264,7 +264,7 @@ void Foam::BlockAamgPolicy<Type>::calcChild()
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::BlockAamgPolicy<Type>::BlockAamgPolicy
|
Foam::BlockMatrixAgglomeration<Type>::BlockMatrixAgglomeration
|
||||||
(
|
(
|
||||||
const BlockLduMatrix<Type>& matrix,
|
const BlockLduMatrix<Type>& matrix,
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
|
@ -272,7 +272,7 @@ Foam::BlockAamgPolicy<Type>::BlockAamgPolicy
|
||||||
const label minCoarseEqns
|
const label minCoarseEqns
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
BlockAmgPolicy<Type>(matrix, dict, groupSize, minCoarseEqns),
|
BlockMatrixCoarsening<Type>(matrix, dict, groupSize, minCoarseEqns),
|
||||||
matrix_(matrix),
|
matrix_(matrix),
|
||||||
normPtr_
|
normPtr_
|
||||||
(
|
(
|
||||||
|
@ -292,7 +292,7 @@ Foam::BlockAamgPolicy<Type>::BlockAamgPolicy
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::BlockAamgPolicy<Type>::~BlockAamgPolicy()
|
Foam::BlockMatrixAgglomeration<Type>::~BlockMatrixAgglomeration()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
@ -300,13 +300,14 @@ Foam::BlockAamgPolicy<Type>::~BlockAamgPolicy()
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::autoPtr<Foam::BlockLduMatrix<Type> >
|
Foam::autoPtr<Foam::BlockLduMatrix<Type> >
|
||||||
Foam::BlockAamgPolicy<Type>::restrictMatrix() const
|
Foam::BlockMatrixAgglomeration<Type>::restrictMatrix() const
|
||||||
{
|
{
|
||||||
if (!coarsen_)
|
if (!coarsen_)
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
"autoPtr<amgMatrix> BlockAamgPolicy<Type>::restrictMatrix() const"
|
"autoPtr<amgMatrix> "
|
||||||
|
"BlockMatrixAgglomeration<Type>::restrictMatrix() const"
|
||||||
) << "Requesting coarse matrix when it cannot be created"
|
) << "Requesting coarse matrix when it cannot be created"
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
@ -335,7 +336,7 @@ Foam::BlockAamgPolicy<Type>::restrictMatrix() const
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
"autoPtr<BlockLduMatrix<Type> > BlockAamgPolicy<Type>::"
|
"autoPtr<BlockLduMatrix<Type> > BlockMatrixAgglomeration<Type>::"
|
||||||
"restrictMatrix() const"
|
"restrictMatrix() const"
|
||||||
) << "Child array does not correspond to fine level. " << endl
|
) << "Child array does not correspond to fine level. " << endl
|
||||||
<< " Child size: " << child_.size()
|
<< " Child size: " << child_.size()
|
||||||
|
@ -671,39 +672,42 @@ Foam::BlockAamgPolicy<Type>::restrictMatrix() const
|
||||||
|
|
||||||
if (cCoeff >= 0)
|
if (cCoeff >= 0)
|
||||||
{
|
{
|
||||||
activeCoarseUpper[cCoeff] += activeFineUpper[fineCoeffI];
|
activeCoarseUpper[cCoeff]
|
||||||
activeCoarseLower[cCoeff] += activeFineLower[fineCoeffI];
|
+= activeFineUpper[fineCoeffI];
|
||||||
|
activeCoarseLower[cCoeff]
|
||||||
|
+= activeFineLower[fineCoeffI];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Add the fine face coefficients into the diagonal.
|
// Add the fine face coefficients into the diagonal.
|
||||||
activeCoarseDiag[-1 - cCoeff] +=
|
activeCoarseDiag[-1 - cCoeff] +=
|
||||||
activeFineUpper[fineCoeffI] + activeFineLower[fineCoeffI];
|
activeFineUpper[fineCoeffI]
|
||||||
|
+ activeFineLower[fineCoeffI];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (fineUpper.activeType() == blockCoeffBase::LINEAR)
|
else if (fineUpper.activeType() == blockCoeffBase::LINEAR)
|
||||||
{
|
{
|
||||||
FatalErrorIn("autoPtr<amgMatrix> BlockAamgPolicy<Type>::restrictMatrix() const")
|
FatalErrorIn("autoPtr<amgMatrix> BlockMatrixAgglomeration<Type>::restrictMatrix() const")
|
||||||
<< "Matrix diagonal of square type and upper of linear type is not implemented"
|
<< "Matrix diagonal of square type and upper of linear type is not implemented"
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalErrorIn("autoPtr<amgMatrix> BlockAamgPolicy<Type>::restrictMatrix() const")
|
FatalErrorIn("autoPtr<amgMatrix> BlockMatrixAgglomeration<Type>::restrictMatrix() const")
|
||||||
<< "Matrix diagonal of square type and upper of scalar type is not implemented"
|
<< "Matrix diagonal of square type and upper of scalar type is not implemented"
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (fineDiag.activeType() == blockCoeffBase::LINEAR)
|
else if (fineDiag.activeType() == blockCoeffBase::LINEAR)
|
||||||
{
|
{
|
||||||
FatalErrorIn("autoPtr<amgMatrix> BlockAamgPolicy<Type>::restrictMatrix() const")
|
FatalErrorIn("autoPtr<amgMatrix> BlockMatrixAgglomeration<Type>::restrictMatrix() const")
|
||||||
<< "Matrix diagonal of linear type not implemented"
|
<< "Matrix diagonal of linear type not implemented"
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalErrorIn("autoPtr<amgMatrix> BlockAamgPolicy<Type>::restrictMatrix() const")
|
FatalErrorIn("autoPtr<amgMatrix> BlockMatrixAgglomeration<Type>::restrictMatrix() const")
|
||||||
<< "Matrix diagonal of scalar type not implemented"
|
<< "Matrix diagonal of scalar type not implemented"
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
@ -726,24 +730,26 @@ Foam::BlockAamgPolicy<Type>::restrictMatrix() const
|
||||||
|
|
||||||
if (cCoeff >= 0)
|
if (cCoeff >= 0)
|
||||||
{
|
{
|
||||||
activeCoarseUpper[cCoeff] += activeFineUpper[fineCoeffI];
|
activeCoarseUpper[cCoeff]
|
||||||
|
+= activeFineUpper[fineCoeffI];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Add the fine face coefficient into the diagonal.
|
// Add the fine face coefficient into the diagonal.
|
||||||
activeCoarseDiag[-1 - cCoeff] += 2*activeFineUpper[fineCoeffI];
|
activeCoarseDiag[-1 - cCoeff]
|
||||||
|
+= 2*activeFineUpper[fineCoeffI];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (fineUpper.activeType() == blockCoeffBase::LINEAR)
|
else if (fineUpper.activeType() == blockCoeffBase::LINEAR)
|
||||||
{
|
{
|
||||||
FatalErrorIn("autoPtr<amgMatrix> BlockAamgPolicy<Type>::restrictMatrix() const")
|
FatalErrorIn("autoPtr<amgMatrix> BlockMatrixAgglomeration<Type>::restrictMatrix() const")
|
||||||
<< "Matrix diagonal of square type and upper of linear type is not implemented"
|
<< "Matrix diagonal of square type and upper of linear type is not implemented"
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalErrorIn("autoPtr<amgMatrix> BlockAamgPolicy<Type>::restrictMatrix() const")
|
FatalErrorIn("autoPtr<amgMatrix> BlockMatrixAgglomeration<Type>::restrictMatrix() const")
|
||||||
<< "Matrix diagonal of square type and upper of scalar type is not implemented"
|
<< "Matrix diagonal of square type and upper of scalar type is not implemented"
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
@ -753,7 +759,7 @@ Foam::BlockAamgPolicy<Type>::restrictMatrix() const
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
"autoPtr<amgMatrix> BlockAamgPolicy<Type>::"
|
"autoPtr<amgMatrix> BlockMatrixAgglomeration<Type>::"
|
||||||
"restrictMatrix() const"
|
"restrictMatrix() const"
|
||||||
) << "Matrix diagonal of linear type not implemented"
|
) << "Matrix diagonal of linear type not implemented"
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
|
@ -762,7 +768,7 @@ Foam::BlockAamgPolicy<Type>::restrictMatrix() const
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
"autoPtr<amgMatrix> BlockAamgPolicy<Type>::"
|
"autoPtr<amgMatrix> BlockMatrixAgglomeration<Type>::"
|
||||||
"restrictMatrix() const"
|
"restrictMatrix() const"
|
||||||
) << "Matrix diagonal of scalar type not implemented"
|
) << "Matrix diagonal of scalar type not implemented"
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
|
@ -780,7 +786,7 @@ Foam::BlockAamgPolicy<Type>::restrictMatrix() const
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void Foam::BlockAamgPolicy<Type>::restrictResidual
|
void Foam::BlockMatrixAgglomeration<Type>::restrictResidual
|
||||||
(
|
(
|
||||||
const CoeffField<Type>& res,
|
const CoeffField<Type>& res,
|
||||||
CoeffField<Type>& coarseRes
|
CoeffField<Type>& coarseRes
|
||||||
|
@ -809,7 +815,7 @@ void Foam::BlockAamgPolicy<Type>::restrictResidual
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalErrorIn("void BlockAamgPolicy<Type>::restrictResidual() const")
|
FatalErrorIn("void BlockMatrixAgglomeration<Type>::restrictResidual() const")
|
||||||
<< "Only present for square type coeff type"
|
<< "Only present for square type coeff type"
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
@ -817,7 +823,7 @@ void Foam::BlockAamgPolicy<Type>::restrictResidual
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void Foam::BlockAamgPolicy<Type>::restrictResidual
|
void Foam::BlockMatrixAgglomeration<Type>::restrictResidual
|
||||||
(
|
(
|
||||||
const Field<Type>& res,
|
const Field<Type>& res,
|
||||||
Field<Type>& coarseRes
|
Field<Type>& coarseRes
|
||||||
|
@ -833,7 +839,7 @@ void Foam::BlockAamgPolicy<Type>::restrictResidual
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void Foam::BlockAamgPolicy<Type>::prolongateCorrection
|
void Foam::BlockMatrixAgglomeration<Type>::prolongateCorrection
|
||||||
(
|
(
|
||||||
Field<Type>& x,
|
Field<Type>& x,
|
||||||
const Field<Type>& coarseX
|
const Field<Type>& coarseX
|
|
@ -22,23 +22,23 @@ License
|
||||||
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
|
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Class
|
Class
|
||||||
BlockAamgPolicy
|
BlockMatrixAgglomeration
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Agglomerative AMG policy
|
Agglomerative block matrix AMG coarsening
|
||||||
|
|
||||||
Author
|
Author
|
||||||
Klas Jareteg, 2013-04-15
|
Klas Jareteg, 2013-04-15
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
BlockAamgPolicy.C
|
BlockMatrixAgglomeration.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef BlockAamgPolicy_H
|
#ifndef BlockMatrixAgglomeration_H
|
||||||
#define BlockAamgPolicy_H
|
#define BlockMatrixAgglomeration_H
|
||||||
|
|
||||||
#include "BlockAmgPolicy.H"
|
#include "BlockMatrixCoarsening.H"
|
||||||
#include "BlockLduMatrix.H"
|
#include "BlockLduMatrix.H"
|
||||||
#include "BlockCoeffNorm.H"
|
#include "BlockCoeffNorm.H"
|
||||||
#include "BlockCoeff.H"
|
#include "BlockCoeff.H"
|
||||||
|
@ -51,13 +51,13 @@ namespace Foam
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class BlockAamgPolicy Declaration
|
Class BlockMatrixAgglomeration Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
class BlockAamgPolicy
|
class BlockMatrixAgglomeration
|
||||||
:
|
:
|
||||||
public BlockAmgPolicy<Type>
|
public BlockMatrixCoarsening<Type>
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -85,10 +85,10 @@ public:
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
BlockAamgPolicy(const BlockAamgPolicy<Type>&);
|
BlockMatrixAgglomeration(const BlockMatrixAgglomeration<Type>&);
|
||||||
|
|
||||||
// Disallow default bitwise assignment
|
// Disallow default bitwise assignment
|
||||||
void operator=(const BlockAamgPolicy<Type>&);
|
void operator=(const BlockMatrixAgglomeration<Type>&);
|
||||||
|
|
||||||
//- Calculate child
|
//- Calculate child
|
||||||
void calcChild();
|
void calcChild();
|
||||||
|
@ -109,7 +109,7 @@ public:
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from matrix and group size
|
//- Construct from matrix and group size
|
||||||
BlockAamgPolicy
|
BlockMatrixAgglomeration
|
||||||
(
|
(
|
||||||
const BlockLduMatrix<Type>& matrix,
|
const BlockLduMatrix<Type>& matrix,
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
|
@ -119,7 +119,7 @@ public:
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
|
|
||||||
virtual ~BlockAamgPolicy();
|
virtual ~BlockMatrixAgglomeration();
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
@ -165,7 +165,7 @@ public:
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#ifdef NoRepository
|
#ifdef NoRepository
|
||||||
# include "BlockAamgPolicy.C"
|
# include "BlockMatrixAgglomeration.C"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
@ -22,18 +22,18 @@ License
|
||||||
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
|
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Class
|
Class
|
||||||
BlockAmgPolicy
|
BlockMatrixCoarsening
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "BlockAmgPolicy.H"
|
#include "BlockMatrixCoarsening.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::autoPtr<Foam::BlockAmgPolicy<Type> > Foam::BlockAmgPolicy<Type>::New
|
Foam::autoPtr<Foam::BlockMatrixCoarsening<Type> > Foam::BlockMatrixCoarsening<Type>::New
|
||||||
(
|
(
|
||||||
const word& policyType,
|
const word& coarseningType,
|
||||||
const BlockLduMatrix<Type>& matrix,
|
const BlockLduMatrix<Type>& matrix,
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
const label groupSize,
|
const label groupSize,
|
||||||
|
@ -41,27 +41,27 @@ Foam::autoPtr<Foam::BlockAmgPolicy<Type> > Foam::BlockAmgPolicy<Type>::New
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
typename matrixConstructorTable::iterator constructorIter =
|
typename matrixConstructorTable::iterator constructorIter =
|
||||||
matrixConstructorTablePtr_->find(policyType);
|
matrixConstructorTablePtr_->find(coarseningType);
|
||||||
|
|
||||||
if (constructorIter == matrixConstructorTablePtr_->end())
|
if (constructorIter == matrixConstructorTablePtr_->end())
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
"autoPtr<BlockAmgPolicy<Type> > BlockAmgPolicy<Type>::New\n"
|
"autoPtr<BlockMatrixCoarsening<Type> > BlockMatrixCoarsening<Type>::New\n"
|
||||||
"(\n"
|
"(\n"
|
||||||
" const word& policyType,\n"
|
" const word& coarseningType,\n"
|
||||||
" const lduMatrix& matrix,\n"
|
" const lduMatrix& matrix,\n"
|
||||||
" const label groupSize\n"
|
" const label groupSize\n"
|
||||||
" const label nCoarseCells\n"
|
" const label nCoarseCells\n"
|
||||||
")"
|
")"
|
||||||
) << "Unknown AMG policy " << policyType
|
) << "Unknown AMG coarsening type. " << coarseningType
|
||||||
<< endl << endl
|
<< endl << endl
|
||||||
<< "Valid AMG policies are :" << endl
|
<< "Valid AMG coarsening types are :" << endl
|
||||||
<< matrixConstructorTablePtr_->toc()
|
<< matrixConstructorTablePtr_->toc()
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
return autoPtr<BlockAmgPolicy<Type> >
|
return autoPtr<BlockMatrixCoarsening<Type> >
|
||||||
(
|
(
|
||||||
constructorIter()
|
constructorIter()
|
||||||
(
|
(
|
|
@ -22,22 +22,22 @@ License
|
||||||
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
|
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Class
|
Class
|
||||||
BlockAmgPolicy
|
BlockMatrixCoarsening
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Virtual base class for AMG coarsening policy, implemented for
|
Virtual base class for block matrix AMG coarsening, implemented for
|
||||||
BlockLduMatrix
|
BlockLduMatrix
|
||||||
|
|
||||||
Author
|
Author
|
||||||
Klas Jareteg, 2012-12-15
|
Klas Jareteg, 2012-12-15
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
BlockAmgPolicy.C
|
BlockMatrixCoarsening.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef BlockAmgPolicy_H
|
#ifndef BlockMatrixCoarsening_H
|
||||||
#define BlockAmgPolicy_H
|
#define BlockMatrixCoarsening_H
|
||||||
|
|
||||||
#include "runTimeSelectionTables.H"
|
#include "runTimeSelectionTables.H"
|
||||||
#include "primitiveFieldsFwd.H"
|
#include "primitiveFieldsFwd.H"
|
||||||
|
@ -62,11 +62,11 @@ template<class Type>
|
||||||
class BlockAmgLevel;
|
class BlockAmgLevel;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class BlockAmgPolicy Declaration
|
Class BlockMatrixCoarsening Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
class BlockAmgPolicy
|
class BlockMatrixCoarsening
|
||||||
{
|
{
|
||||||
// Private Data
|
// Private Data
|
||||||
|
|
||||||
|
@ -82,16 +82,16 @@ class BlockAmgPolicy
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
BlockAmgPolicy(const BlockAmgPolicy&);
|
BlockMatrixCoarsening(const BlockMatrixCoarsening&);
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
//- Disallow default bitwise assignment
|
||||||
void operator=(const BlockAmgPolicy&);
|
void operator=(const BlockMatrixCoarsening&);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
TypeName("BlockAmgPolicy");
|
TypeName("BlockMatrixCoarsening");
|
||||||
|
|
||||||
// KRJ: 2012-12-15: Replaced by the above function
|
// KRJ: 2012-12-15: Replaced by the above function
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
|
@ -103,7 +103,7 @@ public:
|
||||||
declareRunTimeSelectionTable
|
declareRunTimeSelectionTable
|
||||||
(
|
(
|
||||||
autoPtr,
|
autoPtr,
|
||||||
BlockAmgPolicy,
|
BlockMatrixCoarsening,
|
||||||
matrix,
|
matrix,
|
||||||
(
|
(
|
||||||
const BlockLduMatrix<Type>& matrix,
|
const BlockLduMatrix<Type>& matrix,
|
||||||
|
@ -118,9 +118,9 @@ public:
|
||||||
// Selectors
|
// Selectors
|
||||||
|
|
||||||
//- Select given name, group size and matrix
|
//- Select given name, group size and matrix
|
||||||
static autoPtr<BlockAmgPolicy<Type> > New
|
static autoPtr<BlockMatrixCoarsening<Type> > New
|
||||||
(
|
(
|
||||||
const word& policyType,
|
const word& coarseningType,
|
||||||
const BlockLduMatrix<Type>& matrix,
|
const BlockLduMatrix<Type>& matrix,
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
const label groupSize,
|
const label groupSize,
|
||||||
|
@ -131,7 +131,7 @@ public:
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from components
|
//- Construct from components
|
||||||
BlockAmgPolicy
|
BlockMatrixCoarsening
|
||||||
(
|
(
|
||||||
const BlockLduMatrix<Type>& matrix,
|
const BlockLduMatrix<Type>& matrix,
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
|
@ -147,7 +147,7 @@ public:
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
|
|
||||||
virtual ~BlockAmgPolicy()
|
virtual ~BlockMatrixCoarsening()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
@ -196,20 +196,20 @@ public:
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#ifdef NoRepository
|
#ifdef NoRepository
|
||||||
# include "BlockAmgPolicy.C"
|
# include "BlockMatrixCoarsening.C"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define makeBlockAmgPolicy(BlockAmgPolicyType, typeBlockAmgPolicyType) \
|
#define makeBlockMatrixCoarsening(BlockMatrixCoarseningType, typeBlockMatrixCoarseningType) \
|
||||||
\
|
\
|
||||||
defineNamedTemplateTypeNameAndDebug(typeBlockAmgPolicyType, 0); \
|
defineNamedTemplateTypeNameAndDebug(typeBlockMatrixCoarseningType, 0); \
|
||||||
\
|
\
|
||||||
addToRunTimeSelectionTable(BlockAmgPolicyType, typeBlockAmgPolicyType, matrix);
|
addToRunTimeSelectionTable(BlockMatrixCoarseningType, typeBlockMatrixCoarseningType, matrix);
|
||||||
|
|
||||||
#define makeBlockAmgPolicys(blockAmgPolicyType) \
|
#define makeBlockMatrixCoarsenings(blockAmgCoarseningType) \
|
||||||
\
|
\
|
||||||
makeBlockAmgPolicy(blockScalarAmgPolicy, blockAmgPolicyType##Scalar); \
|
makeBlockMatrixCoarsening(blockScalarMatrixCoarsening, blockAmgCoarseningType##Scalar); \
|
||||||
makeBlockAmgPolicy(blockVectorAmgPolicy, blockAmgPolicyType##Vector); \
|
makeBlockMatrixCoarsening(blockVectorMatrixCoarsening, blockAmgCoarseningType##Vector); \
|
||||||
makeBlockAmgPolicy(blockTensorAmgPolicy, blockAmgPolicyType##Tensor);
|
makeBlockMatrixCoarsening(blockTensorMatrixCoarsening, blockAmgCoarseningType##Tensor);
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
|
@ -23,8 +23,8 @@ License
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "blockAamgPolicies.H"
|
#include "blockMatrixAgglomerations.H"
|
||||||
#include "blockAmgPolicies.H"
|
#include "blockMatrixCoarsenings.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ namespace Foam
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
makeBlockAmgPolicys(blockAamgPolicy);
|
makeBlockMatrixCoarsenings(blockMatrixAgglomeration);
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
|
@ -22,27 +22,27 @@ License
|
||||||
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
|
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Class
|
Class
|
||||||
BlockAamgPolicy
|
BlockMatrixAgglomeration
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Typedefs for block AMG policies.
|
Typedefs for block matrix AMG coarsening.
|
||||||
|
|
||||||
Author
|
Author
|
||||||
Klas Jareteg, 2012-12-15
|
Klas Jareteg, 2012-12-15
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
blockAamgPolicies.C
|
blockMatrixAgglomeration.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef blockAamgPolicies_H
|
#ifndef blockMatrixAgglomerations_H
|
||||||
#define blockAamgPolicies_H
|
#define blockMatrixAgglomerations_H
|
||||||
|
|
||||||
// Disabled instantiation for primitive types by force. HJ, 15/Apr/2013
|
// Disabled instantiation for primitive types by force. HJ, 15/Apr/2013
|
||||||
#include "scalarBlockAamgPolicy.H"
|
#include "scalarBlockMatrixAgglomeration.H"
|
||||||
#include "vectorBlockAamgPolicy.H"
|
#include "vectorBlockMatrixAgglomeration.H"
|
||||||
#include "tensorBlockAamgPolicy.H"
|
#include "tensorBlockMatrixAgglomeration.H"
|
||||||
#include "BlockAamgPolicy.H"
|
#include "BlockMatrixAgglomeration.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
@ -51,9 +51,9 @@ namespace Foam
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
typedef BlockAamgPolicy<scalar> blockAamgPolicyScalar;
|
typedef BlockMatrixAgglomeration<scalar> blockMatrixAgglomerationScalar;
|
||||||
typedef BlockAamgPolicy<vector> blockAamgPolicyVector;
|
typedef BlockMatrixAgglomeration<vector> blockMatrixAgglomerationVector;
|
||||||
typedef BlockAamgPolicy<tensor> blockAamgPolicyTensor;
|
typedef BlockMatrixAgglomeration<tensor> blockMatrixAgglomerationTensor;
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
@ -23,7 +23,7 @@ License
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "blockAmgPolicies.H"
|
#include "blockMatrixCoarsenings.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
@ -32,25 +32,25 @@ namespace Foam
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
defineNamedTemplateTypeNameAndDebug(blockScalarAmgPolicy, 0);
|
defineNamedTemplateTypeNameAndDebug(blockScalarMatrixCoarsening, 0);
|
||||||
defineNamedTemplateTypeNameAndDebug(blockVectorAmgPolicy, 0);
|
defineNamedTemplateTypeNameAndDebug(blockVectorMatrixCoarsening, 0);
|
||||||
defineNamedTemplateTypeNameAndDebug(blockTensorAmgPolicy, 0);
|
defineNamedTemplateTypeNameAndDebug(blockTensorMatrixCoarsening, 0);
|
||||||
|
|
||||||
defineTemplateRunTimeSelectionTable
|
defineTemplateRunTimeSelectionTable
|
||||||
(
|
(
|
||||||
blockScalarAmgPolicy,
|
blockScalarMatrixCoarsening,
|
||||||
matrix
|
matrix
|
||||||
);
|
);
|
||||||
|
|
||||||
defineTemplateRunTimeSelectionTable
|
defineTemplateRunTimeSelectionTable
|
||||||
(
|
(
|
||||||
blockVectorAmgPolicy,
|
blockVectorMatrixCoarsening,
|
||||||
matrix
|
matrix
|
||||||
);
|
);
|
||||||
|
|
||||||
defineTemplateRunTimeSelectionTable
|
defineTemplateRunTimeSelectionTable
|
||||||
(
|
(
|
||||||
blockTensorAmgPolicy,
|
blockTensorMatrixCoarsening,
|
||||||
matrix
|
matrix
|
||||||
);
|
);
|
||||||
|
|
|
@ -22,23 +22,23 @@ License
|
||||||
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
|
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Class
|
Class
|
||||||
BlockAmgPolicy
|
BlockMatrixCoarsening
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Typedefs for block AMG policies.
|
Typedefs for block matrix AMG coarsening.
|
||||||
|
|
||||||
Author
|
Author
|
||||||
Klas Jareteg, 2012-12-15
|
Klas Jareteg, 2012-12-15
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
blockAmgPolicies.C
|
blockMatrixCoarsenings.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef blockAmgPolicies_H
|
#ifndef blockMatrixCoarsenings_H
|
||||||
#define blockAmgPolicies_H
|
#define blockMatrixCoarsenings_H
|
||||||
|
|
||||||
#include "BlockAmgPolicy.H"
|
#include "BlockMatrixCoarsening.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
@ -47,9 +47,9 @@ namespace Foam
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
typedef BlockAmgPolicy<scalar> blockScalarAmgPolicy;
|
typedef BlockMatrixCoarsening<scalar> blockScalarMatrixCoarsening;
|
||||||
typedef BlockAmgPolicy<vector> blockVectorAmgPolicy;
|
typedef BlockMatrixCoarsening<vector> blockVectorMatrixCoarsening;
|
||||||
typedef BlockAmgPolicy<tensor> blockTensorAmgPolicy;
|
typedef BlockMatrixCoarsening<tensor> blockTensorMatrixCoarsening;
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
@ -22,23 +22,23 @@ License
|
||||||
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
|
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Class
|
Class
|
||||||
BlockAamgPolicy
|
BlockMatrixAgglomeration
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Specialisation of the BlockAamgPolicy for scalars.
|
Specialisation of the BlockMatrixAgglomeration for scalars.
|
||||||
|
|
||||||
Author
|
Author
|
||||||
Klas Jareteg, 2013-01-31
|
Klas Jareteg, 2013-01-31
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef scalarBlockAamgPolicy_H
|
#ifndef scalarBlockMatrixAgglomeration_H
|
||||||
#define scalarBlockAamgPolicy_H
|
#define scalarBlockMatrixAgglomeration_H
|
||||||
|
|
||||||
#include "blockAmgPolicies.H"
|
#include "blockMatrixCoarsenings.H"
|
||||||
#include "blockAamgPolicies.H"
|
#include "blockMatrixAgglomerations.H"
|
||||||
#include "BlockAamgPolicy.H"
|
#include "BlockMatrixAgglomeration.H"
|
||||||
#include "BlockAmgPolicy.H"
|
#include "BlockMatrixCoarsening.H"
|
||||||
#include "runTimeSelectionTables.H"
|
#include "runTimeSelectionTables.H"
|
||||||
#include "scalarBlockLduMatrix.H"
|
#include "scalarBlockLduMatrix.H"
|
||||||
#include "scalarBlockConstraint.H"
|
#include "scalarBlockConstraint.H"
|
||||||
|
@ -52,19 +52,19 @@ namespace Foam
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class BlockAamgPolicy Declaration
|
Class BlockMatrixAgglomeration Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
//- Restrict matrix
|
//- Restrict matrix
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
inline autoPtr<BlockLduMatrix<scalar> >
|
inline autoPtr<BlockLduMatrix<scalar> >
|
||||||
BlockAamgPolicy<scalar>::restrictMatrix() const
|
BlockMatrixAgglomeration<scalar>::restrictMatrix() const
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
"autoPtr<BlockLduMatrix<scalar> > "
|
"autoPtr<BlockLduMatrix<scalar> > "
|
||||||
"BlockAamgPolicy<Type>::restrictMatrix() const"
|
"BlockMatrixAgglomeration<Type>::restrictMatrix() const"
|
||||||
) << "Function not implemented for Type=scalar. " << endl
|
) << "Function not implemented for Type=scalar. " << endl
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
|
|
|
@ -22,22 +22,22 @@ License
|
||||||
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
|
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Class
|
Class
|
||||||
BlockAamgPolicy
|
BlockMatrixAgglomeration
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Specialisation of the BlockAamgPolicy for tensors.
|
Specialisation of the BlockMatrixAgglomeration for tensors.
|
||||||
|
|
||||||
Author
|
Author
|
||||||
Klas Jareteg, 2013-01-31
|
Klas Jareteg, 2013-01-31
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef tensorBlockAamgPolicy_H
|
#ifndef tensorBlockMatrixAgglomeration_H
|
||||||
#define tensorBlockAamgPolicy_H
|
#define tensorBlockMatrixAgglomeration_H
|
||||||
|
|
||||||
#include "blockAmgPolicies.H"
|
#include "blockMatrixCoarsenings.H"
|
||||||
#include "blockAamgPolicies.H"
|
#include "blockMatrixAgglomerations.H"
|
||||||
#include "BlockAamgPolicy.H"
|
#include "BlockMatrixAgglomeration.H"
|
||||||
#include "runTimeSelectionTables.H"
|
#include "runTimeSelectionTables.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
@ -46,18 +46,18 @@ namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class BlockAamgPolicy Declaration
|
Class BlockMatrixAgglomeration Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
//- Restrict matrix
|
//- Restrict matrix
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
inline autoPtr<BlockLduMatrix<tensor> > BlockAamgPolicy<tensor>::restrictMatrix
|
inline autoPtr<BlockLduMatrix<tensor> > BlockMatrixAgglomeration<tensor>::restrictMatrix
|
||||||
() const
|
() const
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
"autoPtr<BlockLduMatrix<tensor> > BlockAamgPolicy<Type>::"
|
"autoPtr<BlockLduMatrix<tensor> > BlockMatrixAgglomeration<Type>::"
|
||||||
"restrictMatrix() const"
|
"restrictMatrix() const"
|
||||||
) << "Function not implemented for Type=tensor. " << endl
|
) << "Function not implemented for Type=tensor. " << endl
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
|
@ -22,22 +22,22 @@ License
|
||||||
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
|
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Class
|
Class
|
||||||
BlockAamgPolicy
|
BlockMatrixAgglomeration
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Specialisation of the BlockAamgPolicy for vectors.
|
Specialisation of the BlockMatrixAgglomeration for vectors.
|
||||||
|
|
||||||
Author
|
Author
|
||||||
Klas Jareteg, 2013-01-31
|
Klas Jareteg, 2013-01-31
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef vectorBlockAamgPolicy_H
|
#ifndef vectorBlockMatrixAgglomeration_H
|
||||||
#define vectorBlockAamgPolicy_H
|
#define vectorBlockMatrixAgglomeration_H
|
||||||
|
|
||||||
#include "blockAmgPolicies.H"
|
#include "blockMatrixCoarsenings.H"
|
||||||
#include "blockAamgPolicies.H"
|
#include "blockMatrixAgglomerations.H"
|
||||||
#include "BlockAamgPolicy.H"
|
#include "BlockMatrixAgglomeration.H"
|
||||||
#include "runTimeSelectionTables.H"
|
#include "runTimeSelectionTables.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
@ -46,18 +46,19 @@ namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class BlockAamgPolicy Declaration
|
Class BlockMatrixAgglomeration Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
//- Restrict matrix
|
//- Restrict matrix
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
inline autoPtr<BlockLduMatrix<vector> > BlockAamgPolicy<vector>::restrictMatrix
|
inline autoPtr<BlockLduMatrix<vector> >
|
||||||
|
BlockMatrixAgglomeration<vector>::restrictMatrix
|
||||||
() const
|
() const
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
"autoPtr<BlockLduMatrix<vector> > BlockAamgPolicy<Type>::"
|
"autoPtr<BlockLduMatrix<vector> > BlockMatrixAgglomeration<Type>::"
|
||||||
"restrictMatrix() const"
|
"restrictMatrix() const"
|
||||||
) << "Function not implemented for Type=vector. " << endl
|
) << "Function not implemented for Type=vector. " << endl
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
|
@ -50,7 +50,7 @@ Foam::coarseBlockAmgLevel<Type>::coarseBlockAmgLevel
|
||||||
(
|
(
|
||||||
autoPtr<BlockLduMatrix<Type> > matrixPtr,
|
autoPtr<BlockLduMatrix<Type> > matrixPtr,
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
const word& policyType,
|
const word& coarseningType,
|
||||||
const label groupSize,
|
const label groupSize,
|
||||||
const label minCoarseEqns,
|
const label minCoarseEqns,
|
||||||
const word& smootherType
|
const word& smootherType
|
||||||
|
@ -60,11 +60,11 @@ Foam::coarseBlockAmgLevel<Type>::coarseBlockAmgLevel
|
||||||
x_(matrixPtr_->diag().size(),pTraits<Type>::zero),
|
x_(matrixPtr_->diag().size(),pTraits<Type>::zero),
|
||||||
b_(matrixPtr_->diag().size(),pTraits<Type>::zero),
|
b_(matrixPtr_->diag().size(),pTraits<Type>::zero),
|
||||||
dict_(dict),
|
dict_(dict),
|
||||||
policyPtr_
|
coarseningPtr_
|
||||||
(
|
(
|
||||||
BlockAmgPolicy<Type>::New
|
BlockMatrixCoarsening<Type>::New
|
||||||
(
|
(
|
||||||
policyType,
|
coarseningType,
|
||||||
matrixPtr_,
|
matrixPtr_,
|
||||||
dict_,
|
dict_,
|
||||||
groupSize,
|
groupSize,
|
||||||
|
@ -148,13 +148,13 @@ void Foam::coarseBlockAmgLevel<Type>::restrictResidual
|
||||||
|
|
||||||
residual(x, b, res);
|
residual(x, b, res);
|
||||||
|
|
||||||
policyPtr_->restrictResidual(res, coarseRes);
|
coarseningPtr_->restrictResidual(res, coarseRes);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// No pre-sweeps done: x = 0 and residual = b
|
// No pre-sweeps done: x = 0 and residual = b
|
||||||
policyPtr_->restrictResidual(b, coarseRes);
|
coarseningPtr_->restrictResidual(b, coarseRes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,7 +166,7 @@ void Foam::coarseBlockAmgLevel<Type>::prolongateCorrection
|
||||||
const Field<Type>& coarseX
|
const Field<Type>& coarseX
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
policyPtr_->prolongateCorrection(x, coarseX);
|
coarseningPtr_->prolongateCorrection(x, coarseX);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -279,17 +279,17 @@ void Foam::coarseBlockAmgLevel<Type>::scaleX
|
||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::autoPtr<Foam::BlockAmgLevel<Type> > Foam::coarseBlockAmgLevel<Type>::makeNextLevel() const
|
Foam::autoPtr<Foam::BlockAmgLevel<Type> > Foam::coarseBlockAmgLevel<Type>::makeNextLevel() const
|
||||||
{
|
{
|
||||||
if (policyPtr_->coarsen())
|
if (coarseningPtr_->coarsen())
|
||||||
{
|
{
|
||||||
return autoPtr<Foam::BlockAmgLevel<Type> >
|
return autoPtr<Foam::BlockAmgLevel<Type> >
|
||||||
(
|
(
|
||||||
new coarseBlockAmgLevel
|
new coarseBlockAmgLevel
|
||||||
(
|
(
|
||||||
policyPtr_->restrictMatrix(),
|
coarseningPtr_->restrictMatrix(),
|
||||||
dict(),
|
dict(),
|
||||||
policyPtr_->type(),
|
coarseningPtr_->type(),
|
||||||
policyPtr_->groupSize(),
|
coarseningPtr_->groupSize(),
|
||||||
policyPtr_->minCoarseEqns(),
|
coarseningPtr_->minCoarseEqns(),
|
||||||
smootherPtr_->type()
|
smootherPtr_->type()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
|
@ -70,8 +70,8 @@ class coarseBlockAmgLevel
|
||||||
//- Dictionary
|
//- Dictionary
|
||||||
const dictionary& dict_;
|
const dictionary& dict_;
|
||||||
|
|
||||||
//- AMG policy
|
//- AMG coarsening
|
||||||
autoPtr<BlockAmgPolicy<Type> > policyPtr_;
|
autoPtr<BlockMatrixCoarsening<Type> > coarseningPtr_;
|
||||||
|
|
||||||
//- Smoother
|
//- Smoother
|
||||||
autoPtr<BlockLduSmoother<Type> > smootherPtr_;
|
autoPtr<BlockLduSmoother<Type> > smootherPtr_;
|
||||||
|
@ -96,7 +96,7 @@ public:
|
||||||
(
|
(
|
||||||
autoPtr<BlockLduMatrix<Type> > matrixPtr,
|
autoPtr<BlockLduMatrix<Type> > matrixPtr,
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
const word& policyType,
|
const word& coarseningType,
|
||||||
const label groupSize,
|
const label groupSize,
|
||||||
const label minCoarseEqns,
|
const label minCoarseEqns,
|
||||||
const word& smootherType
|
const word& smootherType
|
||||||
|
|
|
@ -49,7 +49,7 @@ Foam::fineBlockAmgLevel<Type>::fineBlockAmgLevel
|
||||||
(
|
(
|
||||||
const BlockLduMatrix<Type>& matrix,
|
const BlockLduMatrix<Type>& matrix,
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
const word& policyType,
|
const word& coarseningType,
|
||||||
const label groupSize,
|
const label groupSize,
|
||||||
const label minCoarseEqns,
|
const label minCoarseEqns,
|
||||||
const word& smootherType
|
const word& smootherType
|
||||||
|
@ -57,11 +57,11 @@ Foam::fineBlockAmgLevel<Type>::fineBlockAmgLevel
|
||||||
:
|
:
|
||||||
matrix_(matrix),
|
matrix_(matrix),
|
||||||
dict_(dict),
|
dict_(dict),
|
||||||
policyPtr_
|
coarseningPtr_
|
||||||
(
|
(
|
||||||
BlockAmgPolicy<Type>::New
|
BlockMatrixCoarsening<Type>::New
|
||||||
(
|
(
|
||||||
policyType,
|
coarseningType,
|
||||||
matrix_,
|
matrix_,
|
||||||
dict_,
|
dict_,
|
||||||
groupSize,
|
groupSize,
|
||||||
|
@ -145,7 +145,7 @@ void Foam::fineBlockAmgLevel<Type>::restrictResidual
|
||||||
|
|
||||||
// Here x != 0. It is assumed that the buffer will contain the residual
|
// Here x != 0. It is assumed that the buffer will contain the residual
|
||||||
// if no pre-sweeps have been done. HJ, 4/Sep/2006
|
// if no pre-sweeps have been done. HJ, 4/Sep/2006
|
||||||
policyPtr_->restrictResidual(xBuffer, coarseRes);
|
coarseningPtr_->restrictResidual(xBuffer, coarseRes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -156,7 +156,7 @@ void Foam::fineBlockAmgLevel<Type>::prolongateCorrection
|
||||||
const Field<Type>& coarseX
|
const Field<Type>& coarseX
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
policyPtr_->prolongateCorrection(x, coarseX);
|
coarseningPtr_->prolongateCorrection(x, coarseX);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -267,17 +267,17 @@ template<class Type>
|
||||||
Foam::autoPtr<Foam::BlockAmgLevel<Type> >
|
Foam::autoPtr<Foam::BlockAmgLevel<Type> >
|
||||||
Foam::fineBlockAmgLevel<Type>::makeNextLevel() const
|
Foam::fineBlockAmgLevel<Type>::makeNextLevel() const
|
||||||
{
|
{
|
||||||
if (policyPtr_->coarsen())
|
if (coarseningPtr_->coarsen())
|
||||||
{
|
{
|
||||||
return autoPtr<Foam::BlockAmgLevel<Type> >
|
return autoPtr<Foam::BlockAmgLevel<Type> >
|
||||||
(
|
(
|
||||||
new coarseBlockAmgLevel<Type>
|
new coarseBlockAmgLevel<Type>
|
||||||
(
|
(
|
||||||
policyPtr_->restrictMatrix(),
|
coarseningPtr_->restrictMatrix(),
|
||||||
dict(),
|
dict(),
|
||||||
policyPtr_->type(),
|
coarseningPtr_->type(),
|
||||||
policyPtr_->groupSize(),
|
coarseningPtr_->groupSize(),
|
||||||
policyPtr_->minCoarseEqns(),
|
coarseningPtr_->minCoarseEqns(),
|
||||||
smootherPtr_->type()
|
smootherPtr_->type()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
|
@ -55,7 +55,7 @@ template<class Type>
|
||||||
class coarseBlockAmgLevel;
|
class coarseBlockAmgLevel;
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
class BlockAmgPolicy;
|
class BlockMatrixCoarsening;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class fineBlockAmgLevel Declaration
|
Class fineBlockAmgLevel Declaration
|
||||||
|
@ -74,8 +74,8 @@ class fineBlockAmgLevel
|
||||||
//- Dictionary
|
//- Dictionary
|
||||||
const dictionary& dict_;
|
const dictionary& dict_;
|
||||||
|
|
||||||
//- AMG policy
|
//- AMG coarsening
|
||||||
autoPtr<BlockAmgPolicy<Type> > policyPtr_;
|
autoPtr<BlockMatrixCoarsening<Type> > coarseningPtr_;
|
||||||
|
|
||||||
//- Smoother
|
//- Smoother
|
||||||
autoPtr<BlockLduSmoother<Type> > smootherPtr_;
|
autoPtr<BlockLduSmoother<Type> > smootherPtr_;
|
||||||
|
@ -101,7 +101,7 @@ public:
|
||||||
(
|
(
|
||||||
const BlockLduMatrix<Type>& matrix,
|
const BlockLduMatrix<Type>& matrix,
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
const word& policyType,
|
const word& coarseningType,
|
||||||
const label groupSize,
|
const label groupSize,
|
||||||
const label minCoarseEqns,
|
const label minCoarseEqns,
|
||||||
const word& smootherType
|
const word& smootherType
|
||||||
|
|
|
@ -68,7 +68,7 @@ Foam::BlockAmgPrecon<Type>::BlockAmgPrecon
|
||||||
(
|
(
|
||||||
matrix,
|
matrix,
|
||||||
dict,
|
dict,
|
||||||
dict.lookup("policy"),
|
dict.lookup("coarseningType"),
|
||||||
readLabel(dict.lookup("groupSize")),
|
readLabel(dict.lookup("groupSize")),
|
||||||
readLabel(dict.lookup("minCoarseEqns")),
|
readLabel(dict.lookup("minCoarseEqns")),
|
||||||
dict.lookup("smoother")
|
dict.lookup("smoother")
|
||||||
|
|
|
@ -22,7 +22,7 @@ License
|
||||||
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
|
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Algebraic Multigrid solver with run-time selection of policy and cycle
|
Algebraic Multigrid solver with run-time selection of coarsening and cycle
|
||||||
|
|
||||||
Author
|
Author
|
||||||
Klas Jareteg, 2013-04-15
|
Klas Jareteg, 2013-04-15
|
||||||
|
|
|
@ -25,7 +25,7 @@ Class
|
||||||
BlockAmgSolver
|
BlockAmgSolver
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Algebraic Multigrid solver with run-time selection of policy and cycle
|
Algebraic Multigrid solver with run-time selection of coarsening and cycle
|
||||||
adjusted for BlockLduMatrix.
|
adjusted for BlockLduMatrix.
|
||||||
|
|
||||||
Author
|
Author
|
||||||
|
|
|
@ -46,8 +46,8 @@ License
|
||||||
// KRJ: 2012-12-15: Multigrid solver
|
// KRJ: 2012-12-15: Multigrid solver
|
||||||
#include "blockAmgSolvers.H"
|
#include "blockAmgSolvers.H"
|
||||||
#include "blockAmgPrecons.H"
|
#include "blockAmgPrecons.H"
|
||||||
#include "blockAmgPolicies.H"
|
#include "blockMatrixCoarsenings.H"
|
||||||
#include "blockAamgPolicies.H"
|
#include "blockMatrixAgglomerations.H"
|
||||||
#include "blockCoeffNorms.H"
|
#include "blockCoeffNorms.H"
|
||||||
#include "blockCoeffTwoNorms.H"
|
#include "blockCoeffTwoNorms.H"
|
||||||
#include "blockCoeffMaxNorms.H"
|
#include "blockCoeffMaxNorms.H"
|
||||||
|
@ -132,12 +132,12 @@ makeBlockSolverTypeName(block##Type##GMRESSolver); \
|
||||||
addSolverToBlockMatrix(Type, block##Type##GMRESSolver, symMatrix); \
|
addSolverToBlockMatrix(Type, block##Type##GMRESSolver, symMatrix); \
|
||||||
addSolverToBlockMatrix(Type, block##Type##GMRESSolver, asymMatrix); \
|
addSolverToBlockMatrix(Type, block##Type##GMRESSolver, asymMatrix); \
|
||||||
\
|
\
|
||||||
typedef BlockAmgPolicy<type > block##Type##AmgPolicy; \
|
typedef BlockMatrixCoarsening<type > block##Type##MatrixCoarsening; \
|
||||||
defineNamedTemplateTypeNameAndDebug(block##Type##AmgPolicy, 0); \
|
defineNamedTemplateTypeNameAndDebug(block##Type##MatrixCoarsening, 0); \
|
||||||
defineTemplateRunTimeSelectionTable(block##Type##AmgPolicy, matrix); \
|
defineTemplateRunTimeSelectionTable(block##Type##MatrixCoarsening, matrix); \
|
||||||
\
|
\
|
||||||
typedef BlockAamgPolicy<type > block##Type##AamgPolicy; \
|
typedef BlockMatrixAgglomeration<type > block##Type##MatrixAgglomeration; \
|
||||||
makeBlockAmgPolicy(block##Type##AmgPolicy, block##Type##AamgPolicy); \
|
makeBlockMatrixCoarsening(block##Type##MatrixCoarsening, block##Type##MatrixAgglomeration); \
|
||||||
\
|
\
|
||||||
typedef BlockCoeffNorm<type > block##Type##CoeffNorm; \
|
typedef BlockCoeffNorm<type > block##Type##CoeffNorm; \
|
||||||
defineNamedTemplateTypeNameAndDebug(block##Type##CoeffNorm, 0); \
|
defineNamedTemplateTypeNameAndDebug(block##Type##CoeffNorm, 0); \
|
||||||
|
|
Reference in a new issue