Added option to relax only a part of the matrix

This commit is contained in:
Hrvoje Jasak 2017-02-10 10:03:04 +00:00
parent fc2276c2a9
commit 6df1d9861d
2 changed files with 3 additions and 23 deletions

View file

@ -719,7 +719,7 @@ template<class Type>
void Foam::fvMatrix<Type>::relax
(
const scalar alpha,
const word& cellZoneName
const labelList& zoneCells
)
{
if (alpha <= 0)
@ -727,26 +727,7 @@ void Foam::fvMatrix<Type>::relax
return;
}
// Find cell zone and check it is not empty
const label zoneID = psi_.mesh().cellZones().findZoneID(cellZoneName);
if (zoneID < 0)
{
WarningIn
(
"void fvMatrix<Type>::relax\n"
"(\n"
" const scalar alpha,\n"
" const word& cellZoneName\n"
")"
) << "Cannot find cell zone " << cellZoneName
<< ". No relaxation applied"
<< endl;
return;
}
if (psi_.mesh().cellZones()[zoneID].empty())
if (zoneCells.empty())
{
// Zone empty, skip
return;
@ -804,7 +785,6 @@ void Foam::fvMatrix<Type>::relax
}
// Under-relax only cells within the zone
const labelList& zoneCells = psi_.mesh().cellZones()[zoneID];
forAll (zoneCells, zcI)
{

View file

@ -362,7 +362,7 @@ public:
void relax
(
const scalar alpha,
const word& cellZoneName
const labelList& zoneCells
);
//- Complete matrix assembly for solution: