mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
simplify: use dotproduct in DRS for vector
This commit is contained in:
parent
f98be9d43b
commit
e1db2d2344
@ -139,13 +139,9 @@ void scaleVectorDRS(Vector& vector, std::size_t pressureIndex, const Opm::CPRPar
|
|||||||
using Block = typename Vector::block_type;
|
using Block = typename Vector::block_type;
|
||||||
if (param.cpr_use_drs_) {
|
if (param.cpr_use_drs_) {
|
||||||
for (std::size_t j = 0; j < vector.size(); ++j) {
|
for (std::size_t j = 0; j < vector.size(); ++j) {
|
||||||
double val(0.0);
|
|
||||||
Block& block = vector[j];
|
Block& block = vector[j];
|
||||||
const Block& bw = weights[j];
|
const Block& bw = weights[j];
|
||||||
for (std::size_t i = 0; i < Block::dimension; i++) {
|
block[pressureIndex] = bw.dot(block);
|
||||||
val += bw[i]*block[i];
|
|
||||||
}
|
|
||||||
block[pressureIndex] = val;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user