Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small optimimization of constraint condensation #417

Merged
merged 1 commit into from
Feb 7, 2022

Conversation

fredrikekre
Copy link
Member

Use a dict of size n constraints instead of a vector of size ndofs.

@lijas
Copy link
Collaborator

lijas commented Feb 7, 2022

I guess it is more memory efficient, but is it faster?

@fredrikekre
Copy link
Member Author

No reason it should be slower 🤷 (compared to everything else in this function I don't think it is noticeable). Just seems nicer to allocate only what you need, in particular since the number of constrained dofs usually is much smaller then the number of total dofs.

@codecov-commenter
Copy link

codecov-commenter commented Feb 7, 2022

Codecov Report

Merging #417 (d6acbf2) into master (27192eb) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #417      +/-   ##
==========================================
- Coverage   91.30%   91.29%   -0.01%     
==========================================
  Files          22       22              
  Lines        3046     3043       -3     
==========================================
- Hits         2781     2778       -3     
  Misses        265      265              
Impacted Files Coverage Δ
src/Dofs/ConstraintHandler.jl 94.65% <100.00%> (-0.04%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 27192eb...d6acbf2. Read the comment docs.

@lijas
Copy link
Collaborator

lijas commented Feb 7, 2022

Ok makes sense. I think I use the same trick in create_constraint_matrix, so you can update that as well maybe.
Otherwise this looks good to me.

Use a dict of size n constraints instead of a vector of size ndofs.
@fredrikekre fredrikekre merged commit 9bfc3ad into master Feb 7, 2022
@fredrikekre fredrikekre deleted the fe/optimize_condense branch February 7, 2022 17:09
koehlerson pushed a commit that referenced this pull request Apr 22, 2022
Use a dict of size n constraints instead of a vector of size ndofs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants