Bugfix: const signature handling for manipulateMatrix in fvPatchField

This commit is contained in:
Hrvoje Jasak 2016-08-01 14:42:49 +01:00
parent d442bc4693
commit b7e1ca950a
3 changed files with 8 additions and 4 deletions

View file

@ -242,7 +242,7 @@ void Foam::fvPatchField<Type>::evaluate(const Pstream::commsTypes)
template<class Type> template<class Type>
void Foam::fvPatchField<Type>::manipulateMatrix(fvMatrix<Type>& matrix) const void Foam::fvPatchField<Type>::manipulateMatrix(fvMatrix<Type>& matrix)
{ {
// do nothing // do nothing
} }

View file

@ -463,7 +463,7 @@ public:
// Matrix manipulation // Matrix manipulation
//- Manipulate matrix //- Manipulate matrix
virtual void manipulateMatrix(fvMatrix<Type>& matrix) const; virtual void manipulateMatrix(fvMatrix<Type>& matrix);
// I-O // I-O

View file

@ -729,8 +729,12 @@ void Foam::fvMatrix<Type>::completeAssembly()
assemblyCompleted_ = true; assemblyCompleted_ = true;
const typename GeometricField<Type, fvPatchField, volMesh>:: // Cast away const to manipulate matrix
GeometricBoundaryField& bFields = psi_.boundaryField(); GeometricField<Type, fvPatchField, volMesh>& ncPsi =
const_cast<GeometricField<Type, fvPatchField, volMesh>& >(psi_);
typename GeometricField<Type, fvPatchField, volMesh>::
GeometricBoundaryField& bFields = ncPsi.boundaryField();
forAll(bFields, patchI) forAll(bFields, patchI)
{ {