Merge pull request #4194 from hnil/trueimpes_scaling_fix

- made heuristic scaling of trueimpes
This commit is contained in:
Atgeirr Flø Rasmussen 2022-11-01 12:00:06 +01:00 committed by GitHub
commit e872cfb21d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -122,7 +122,11 @@ namespace Amg
VectorBlockType bweights;
MatrixBlockType block_transpose = Details::transposeDenseMatrix(block);
block_transpose.solve(bweights, rhs);
bweights /= 1000.0; // given normal densities this scales weights to about 1.
double abs_max = *std::max_element(
bweights.begin(), bweights.end(), [](double a, double b) { return std::fabs(a) < std::fabs(b); });
// probably a scaling which could give approximately total compressibility would be better
bweights /= std::fabs(abs_max); // given normal densities this scales weights to about 1.
weights[index] = bweights;
++index;
}