small reorganizations to aid static analyzers

This commit is contained in:
Arne Morten Kvarving 2021-09-30 09:37:19 +02:00
parent d2ebc44b15
commit a75a0c7158
3 changed files with 5 additions and 4 deletions

View File

@ -347,7 +347,7 @@ void ASMbase::getNoIntPoints (size_t& nPt, size_t& nIPt)
// Use polynomial order to define number of quadrature points
int ng[3] = { 0, 0, 0 };
this->getOrder(ng[0],ng[1],ng[2]);
for (unsigned char d = 0; d < ndim; d++)
for (unsigned char d = 0; d < ndim && d < 3; d++)
nGp *= ng[d] + nGauss%10;
}

View File

@ -570,7 +570,7 @@ void ASMLRSpline::getNoIntPoints (size_t& nPt, size_t& nIPt)
int ng[3] = { 0, 0, 0 };
int nG1 = 0;
this->getOrder(ng[0],ng[1],ng[2]);
for (unsigned char d = 0; d < ndim; d++)
for (unsigned char d = 0; d < ndim && d < 3; d++)
nG1 = std::max(nG1,ng[d]+nGauss%10);
for (unsigned char d = 0; d < ndim; d++)
nGp = nG1*nG1;

View File

@ -1556,9 +1556,10 @@ bool SIMbase::solutionNorms (const TimeDomain& time,
norm->initIntegration(nIntGP,nBouGP);
// Number of recovered solution components
if (!this->fieldProjections())
size_t nNodes = this->getNoNodes(1);
if (nNodes > 0 && !this->fieldProjections())
for (const Vector& s : ssol)
if ((nCmp = s.size() / this->getNoNodes(1)) > 0)
if ((nCmp = s.size() / nNodes) > 0)
break;
#ifdef USE_OPENMP