ENH: GAMGInterface: additional checking

This commit is contained in:
mattijs
2013-04-03 16:34:45 +01:00
parent 9e3c5f3b30
commit 7b345de5a7
2 changed files with 22 additions and 1 deletions

View File

@ -83,6 +83,27 @@ Foam::tmp<Foam::scalarField> Foam::GAMGInterface::agglomerateCoeffs
tmp<scalarField> tcoarseCoeffs(new scalarField(size(), 0.0)); tmp<scalarField> tcoarseCoeffs(new scalarField(size(), 0.0));
scalarField& coarseCoeffs = tcoarseCoeffs(); scalarField& coarseCoeffs = tcoarseCoeffs();
if (fineCoeffs.size() != faceRestrictAddressing_.size())
{
FatalErrorIn
(
"GAMGInterface::agglomerateCoeffs(const scalarField&) const"
) << "Size of coefficients " << fineCoeffs.size()
<< " does not correspond to the size of the restriction "
<< faceRestrictAddressing_.size()
<< abort(FatalError);
}
if (debug && max(faceRestrictAddressing_) > size())
{
FatalErrorIn
(
"GAMGInterface::agglomerateCoeffs(const scalarField&) const"
) << "Face restrict addressing addresses outside of coarse interface"
<< " size. Max addressing:" << max(faceRestrictAddressing_)
<< " coarse size:" << size()
<< abort(FatalError);
}
forAll(faceRestrictAddressing_, ffi) forAll(faceRestrictAddressing_, ffi)
{ {
coarseCoeffs[faceRestrictAddressing_[ffi]] += fineCoeffs[ffi]; coarseCoeffs[faceRestrictAddressing_[ffi]] += fineCoeffs[ffi];

View File

@ -224,7 +224,7 @@ public:
return faceCells_; return faceCells_;
} }
//- Return face restrict addressing //- Return (local)face restrict addressing
virtual const labelList& faceRestrictAddressing() const virtual const labelList& faceRestrictAddressing() const
{ {
return faceRestrictAddressing_; return faceRestrictAddressing_;