Skip to content
Snippets Groups Projects
Commit d27ffa06 authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[MaL] Allocate space for diagonal values.

parent deb816da
No related branches found
No related tags found
No related merge requests found
......@@ -40,6 +40,12 @@ void applyKnownSolution(
SpMat AT = A_eigen.transpose();
// Reserve space for at least one value (on the diagonal). For deactivated
// subdomains some rows and columns might end empty (in the A matrix) and so
// no space is reserved for the Dirichlet conditions in the transposed
// matrix. Then the coeffRef call will do costly reallocations.
AT.reserve(Eigen::VectorXi::Constant(A_eigen.rows(), 1));
for (std::size_t ix = 0; ix < vec_knownX_id.size(); ix++)
{
SpMat::Index const row_id = vec_knownX_id[ix];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment