| 95 | |
| 96 | template<> |
| 97 | Foam::solverPerformance Foam::fvMatrix<Foam::scalar>::fvSolver::solve |
| 98 | ( |
| 99 | const dictionary& solverControls |
| 100 | ) |
| 101 | { |
| 102 | GeometricField<scalar, fvPatchField, volMesh>& psi = |
| 103 | const_cast<GeometricField<scalar, fvPatchField, volMesh>&> |
| 104 | (fvMat_.psi()); |
| 105 | |
| 106 | scalarField saveDiag(fvMat_.diag()); |
| 107 | fvMat_.addBoundaryDiag(fvMat_.diag(), 0); |
| 108 | |
| 109 | scalarField totalSource(fvMat_.source()); |
| 110 | fvMat_.addBoundarySource(totalSource, false); |
| 111 | |
| 112 | // Assign new solver controls |
| 113 | solver_->read(solverControls); |
| 114 | |
| 115 | solverPerformance solverPerf = solver_->solve |
| 116 | ( |
| 117 | psi.primitiveFieldRef(), |
| 118 | totalSource |
| 119 | ); |
| 120 | |
| 121 | if (solverPerformance::debug) |
| 122 | { |
| 123 | solverPerf.print(Info.masterStream(fvMat_.mesh().comm())); |
| 124 | } |
| 125 | |
| 126 | fvMat_.diag() = saveDiag; |
| 127 | |
| 128 | psi.correctBoundaryConditions(); |
| 129 | |
| 130 | psi.mesh().setSolverPerformance(psi.name(), solverPerf); |
| 131 | |
| 132 | return solverPerf; |
| 133 | } |
| 134 | |
| 135 | |
| 136 | template<> |