MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / solve

Function solve

src/finiteVolume/fvMatrices/fvScalarMatrix/fvScalarMatrix.C:97–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95
96template<>
97Foam::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
136template<>

Callers 2

fvMatrixSolve.CFile · 0.50
fvMatrix.CFile · 0.50

Calls 6

psiMethod · 0.45
readMethod · 0.45
solveMethod · 0.45
commMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected