mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
fvMatrix: Added properly parallel matrix scaling operation
Note that the previous version which allows matrix scaling by a dimensionedScalarField is not currently correct for asymmetric matrices in parallel and the transfer of the scaling factor values from the neighbouring processors is required.
This commit is contained in:
@ -1180,6 +1180,43 @@ void Foam::fvMatrix<Type>::operator*=
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
void Foam::fvMatrix<Type>::operator*=
|
||||||
|
(
|
||||||
|
const volScalarField& vsf
|
||||||
|
)
|
||||||
|
{
|
||||||
|
dimensions_ *= vsf.dimensions();
|
||||||
|
lduMatrix::operator*=(vsf.field());
|
||||||
|
source_ *= vsf.field();
|
||||||
|
|
||||||
|
forAll(vsf.boundaryField(), patchI)
|
||||||
|
{
|
||||||
|
const fvPatchScalarField& psf = vsf.boundaryField()[patchI];
|
||||||
|
|
||||||
|
if (psf.coupled())
|
||||||
|
{
|
||||||
|
internalCoeffs_[patchI] *= psf.patchInternalField();
|
||||||
|
boundaryCoeffs_[patchI] *= psf.patchNeighbourField();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
internalCoeffs_[patchI] *= psf.patchInternalField();
|
||||||
|
boundaryCoeffs_[patchI] *= psf;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (faceFluxCorrectionPtr_)
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"fvMatrix<Type>::operator*="
|
||||||
|
"(const DimensionedField<scalar, volMesh>&)"
|
||||||
|
) << "cannot scale a matrix containing a faceFluxCorrection"
|
||||||
|
<< abort(FatalError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void Foam::fvMatrix<Type>::operator*=
|
void Foam::fvMatrix<Type>::operator*=
|
||||||
(
|
(
|
||||||
|
|||||||
@ -460,6 +460,7 @@ public:
|
|||||||
|
|
||||||
void operator*=(const DimensionedField<scalar, volMesh>&);
|
void operator*=(const DimensionedField<scalar, volMesh>&);
|
||||||
void operator*=(const tmp<DimensionedField<scalar, volMesh> >&);
|
void operator*=(const tmp<DimensionedField<scalar, volMesh> >&);
|
||||||
|
void operator*=(const volScalarField&);
|
||||||
void operator*=(const tmp<volScalarField>&);
|
void operator*=(const tmp<volScalarField>&);
|
||||||
|
|
||||||
void operator*=(const dimensioned<scalar>&);
|
void operator*=(const dimensioned<scalar>&);
|
||||||
|
|||||||
Reference in New Issue
Block a user