chemistryModel::ISAT: Minor optimisation

This commit is contained in:
Henry Weller
2022-01-25 11:18:15 +00:00
parent 8bb48df87f
commit af8e4376e6

View File

@ -222,14 +222,11 @@ void Foam::chemistryTabulationMethods::ISAT::calcNewC
// //
Rphiq = phi0->Rphi(); Rphiq = phi0->Rphi();
for (label i=0; i<nEqns + 1; i++) for (label i=0; i<nEqns - 2; i++)
{ {
if (reduction_) if (reduction_)
{ {
const label si = const label si = completeToSimplified[i];
i < nEqns - 2
? completeToSimplified[i]
: i - (nEqns - 2) + phi0->nActive();
if (si != -1) if (si != -1)
{ {
@ -257,7 +254,7 @@ void Foam::chemistryTabulationMethods::ISAT::calcNewC
else else
{ {
// Extrapolate using the gradients matrix // Extrapolate using the gradients matrix
for (label j=0; j<nEqns; j++) for (label j=0; j<nEqns + 1; j++)
{ {
Rphiq[i] += gradientsMatrix(i, j)*dphi[j]; Rphiq[i] += gradientsMatrix(i, j)*dphi[j];
} }