mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Remove unnecessary intermediate variables
This commit is contained in:
parent
5385bd275e
commit
1306a65104
@ -171,7 +171,6 @@ int checkZeroDiagonal(BridgeMatrix& mat) {
|
|||||||
// this could be removed if Dune::BCRSMatrix features an API call that returns colIndices and rowPointers
|
// this could be removed if Dune::BCRSMatrix features an API call that returns colIndices and rowPointers
|
||||||
template <class BridgeMatrix, class BridgeVector, int block_size>
|
template <class BridgeMatrix, class BridgeVector, int block_size>
|
||||||
void BdaBridge<BridgeMatrix, BridgeVector, block_size>::getSparsityPattern(const BridgeMatrix& mat, std::vector<int> &h_rows, std::vector<int> &h_cols) {
|
void BdaBridge<BridgeMatrix, BridgeVector, block_size>::getSparsityPattern(const BridgeMatrix& mat, std::vector<int> &h_rows, std::vector<int> &h_cols) {
|
||||||
int sum_nnzs = 0;
|
|
||||||
|
|
||||||
h_rows.clear();
|
h_rows.clear();
|
||||||
h_cols.clear();
|
h_cols.clear();
|
||||||
@ -179,13 +178,10 @@ void BdaBridge<BridgeMatrix, BridgeVector, block_size>::getSparsityPattern(const
|
|||||||
// convert colIndices and rowPointers
|
// convert colIndices and rowPointers
|
||||||
h_rows.emplace_back(0);
|
h_rows.emplace_back(0);
|
||||||
for (typename BridgeMatrix::const_iterator r = mat.begin(); r != mat.end(); ++r) {
|
for (typename BridgeMatrix::const_iterator r = mat.begin(); r != mat.end(); ++r) {
|
||||||
int size_row = 0;
|
|
||||||
for (auto c = r->begin(); c != r->end(); ++c) {
|
for (auto c = r->begin(); c != r->end(); ++c) {
|
||||||
h_cols.emplace_back(c.index());
|
h_cols.emplace_back(c.index());
|
||||||
size_row++;
|
|
||||||
}
|
}
|
||||||
sum_nnzs += size_row;
|
h_rows.emplace_back(h_cols.size());
|
||||||
h_rows.emplace_back(sum_nnzs);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// h_rows and h_cols could be changed to 'unsigned int', but cusparse expects 'int'
|
// h_rows and h_cols could be changed to 'unsigned int', but cusparse expects 'int'
|
||||||
|
Loading…
Reference in New Issue
Block a user