# Problem with ldumatrix solver

 Register Blogs Members List Search Today's Posts Mark Forums Read

 January 4, 2014, 08:42 Problem with ldumatrix solver #1 New Member   Fujiang Yu Join Date: Jan 2014 Posts: 12 Rep Power: 8 Hello, friends, I'm now dealing with linear iterative solvers in Openfoam. After several days' code reading, I have got a small problem in ldumatrix solver. I'm now reading the code of Preconditional CG method(PCG.C in Openfoam), and nearly have got through most of it. But there still exists a small problem in this part // --- Calculate normalisation factor scalar normFactor = this->normFactor(psi, source, wA, pA); if (lduMatrix::debug >= 2) { Info<< " Normalisation factor = " << normFactor << endl; } // --- Calculate normalised residual norm solverPerf.initialResidual() = gSumMag(rA)/normFactor; solverPerf.finalResidual() = solverPerf.initialResidual(); I'm really curious with the normFactor part, which is defined in lduMatrixSolver.C Foam::scalar Foam::lduMatrix::solver::normFactor ( const scalarField& psi, const scalarField& source, const scalarField& Apsi, scalarField& tmpField ) const { // --- Calculate A dot reference value of psi matrix_.sumA(tmpField, interfaceBouCoeffs_, interfaces_); tmpField *= gAverage(psi); return gSum(mag(Apsi - tmpField) + mag(source - tmpField)) + solverPerformance::small_; In this function, it seems to return |Ax-p|+|b-p|+Ɛ, which I can't find any relation with the definition of normalisation. In the comment, it says that the code wants to build up the normalised residual norm, but it should be rA/|rA|, so what does it mean in this part of code. Please help me figure out this problem. Thank you for your time and regard Frank Yu

 January 6, 2014, 00:48 #2 New Member   Fujiang Yu Join Date: Jan 2014 Posts: 12 Rep Power: 8 Could anybody help me with this problem

 Tags ldumatrix, pcg, solver