Fix some compiler warnings

This commit is contained in:
Ray Speth 2023-06-22 11:40:55 -04:00 committed by Ingmar Schoegl
parent 94ac6c6513
commit 37977ee156
4 changed files with 8 additions and 5 deletions

View File

@ -66,7 +66,7 @@ public:
//! Size of SolutionArray (number of entries)
int size() const {
return m_size;
return static_cast<int>(m_size);
}
//! Resize SolutionArray objects with a single dimension (default).

View File

@ -138,7 +138,8 @@ Eigen::SparseMatrix<double> IdealGasConstPressureMoleReactor::jacobian()
std::vector<Eigen::Triplet<double>> species_trips(dnk_dnj.nonZeros());
for (int k = 0; k < dnk_dnj.outerSize(); k++) {
for (Eigen::SparseMatrix<double>::InnerIterator it(dnk_dnj, k); it; ++it) {
species_trips.emplace_back(it.row(), it.col(), it.value());
species_trips.emplace_back(static_cast<int>(it.row()),
static_cast<int>(it.col()), it.value());
}
}
addSurfaceJacobian(species_trips);
@ -168,7 +169,7 @@ Eigen::SparseMatrix<double> IdealGasConstPressureMoleReactor::jacobian()
for (int k = 0; k < dnk_dnj.outerSize(); k++) {
for (Eigen::SparseMatrix<double>::InnerIterator it(dnk_dnj, k); it; ++it) {
// gas phase species need the addition of V / N * omega_dot
if (it.row() < m_nsp) {
if (static_cast<size_t>(it.row()) < m_nsp) {
it.valueRef() = it.value() + netProductionRates[it.row()] * molarVol;
}
m_jac_trips.emplace_back(static_cast<int>(it.row() + m_sidx),

View File

@ -172,7 +172,8 @@ Eigen::SparseMatrix<double> IdealGasMoleReactor::jacobian()
std::vector<Eigen::Triplet<double>> species_trips;
for (int k = 0; k < dnk_dnj.outerSize(); k++) {
for (Eigen::SparseMatrix<double>::InnerIterator it(dnk_dnj, k); it; ++it) {
species_trips.emplace_back(it.row(), it.col(), it.value());
species_trips.emplace_back(static_cast<int>(it.row()),
static_cast<int>(it.col()), it.value());
}
}
addSurfaceJacobian(species_trips);

View File

@ -130,7 +130,8 @@ void MoleReactor::addSurfaceJacobian(vector<Eigen::Triplet<double>> &triplets)
scalar /= m_vol;
}
// push back scaled value triplet
triplets.emplace_back(row, col, scalar * it.value());
triplets.emplace_back(static_cast<int>(row), static_cast<int>(col),
scalar * it.value());
}
}
}