mirror of
https://github.com/Cantera/cantera.git
synced 2025-02-25 18:55:29 -06:00
Fix some compiler warnings
This commit is contained in:
parent
94ac6c6513
commit
37977ee156
@ -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).
|
||||
|
@ -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),
|
||||
|
@ -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);
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user