Merge Request #31: BUGFIX: Minor bugfixes to coupled Matrix. Author: Henrik Rusche. Merge: Henrik Rusche

https://sourceforge.net/p/foam-extend/foam-extend-3.2/merge-requests/31/
This commit is contained in:
Henrik Rusche 2016-05-24 13:03:53 +02:00
commit 81847628ea
3 changed files with 6 additions and 3 deletions

View file

@ -105,6 +105,7 @@ Foam::coupledFvMatrix<Type>::solve(const dictionary& solverControls)
source.set(rowI, new Field<Type>(curMatrix.source())); source.set(rowI, new Field<Type>(curMatrix.source()));
sourceCmpt.set(rowI, new scalarField(curMatrix.psi().size())); sourceCmpt.set(rowI, new scalarField(curMatrix.psi().size()));
curMatrix.completeAssembly();
curMatrix.addBoundarySource(source[rowI]); curMatrix.addBoundarySource(source[rowI]);
interfaces[rowI] = curMatrix.psi().boundaryField().interfaces(); interfaces[rowI] = curMatrix.psi().boundaryField().interfaces();

View file

@ -68,6 +68,8 @@ coupledSolverPerformance coupledFvMatrix<scalar>::solve
fvScalarMatrix& curMatrix = fvScalarMatrix& curMatrix =
static_cast<fvScalarMatrix&>(matrices[rowI]); static_cast<fvScalarMatrix&>(matrices[rowI]);
curMatrix.completeAssembly();
saveDiag.set(rowI, new scalarField(curMatrix.diag())); saveDiag.set(rowI, new scalarField(curMatrix.diag()));
// Need to be able to compare references to support hacks // Need to be able to compare references to support hacks

View file

@ -89,13 +89,13 @@ Foam::scalar Foam::coupledIterativeSolver::normFactor
{ {
typedef FieldField<Field, scalar> scalarFieldField; typedef FieldField<Field, scalar> scalarFieldField;
// Calculate reference value of x
scalar xRef = gAverage(x);
scalarFieldField pA(x.size()); scalarFieldField pA(x.size());
forAll (x, rowI) forAll (x, rowI)
{ {
// Calculate reference value of x
scalar xRef = gAverage(x[rowI]);
pA.set(rowI, new scalarField(x[rowI].size(), xRef)); pA.set(rowI, new scalarField(x[rowI].size(), xRef));
} }