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

Add package extension for BlockArrays.jl. #567

Merged
merged 1 commit into from
Jan 9, 2023
Merged

Conversation

fredrikekre
Copy link
Member

This patch adds support for global block matrices. A global block matrix
can be obtained by create_sparsity_pattern(BlockMatrix, dh, ch) or by
create_sparsity_pattern(A::BlockMatrix, dh, ch). The former infers the
block sizes by looking at the fields of the DofHandler, and the latters
uses the blocksizes of the (partially) initilized BlockMatrix (i.e. by
undef_blocks).

For global assembly, start_assemble(::BlockMatrix, ...) returns a
BlockAssembler which pre allocates a vector for pre-computing the
(block number, local index) pairs for each DoF. BlockArrays only support
local condensation of constraints currently and you have to use
apply_assemble! instead of assemble! + apply!.

@codecov-commenter
Copy link

codecov-commenter commented Dec 19, 2022

Codecov Report

Base: 92.87% // Head: 92.45% // Decreases project coverage by -0.42% ⚠️

Coverage data is based on head (53fb5f7) compared to base (372ab4a).
Patch coverage: 86.66% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #567      +/-   ##
==========================================
- Coverage   92.87%   92.45%   -0.43%     
==========================================
  Files          27       28       +1     
  Lines        4127     4202      +75     
==========================================
+ Hits         3833     3885      +52     
- Misses        294      317      +23     
Impacted Files Coverage Δ
ext/FerriteBlockArrays.jl 86.66% <86.66%> (ø)
src/Dofs/ConstraintHandler.jl 94.87% <0.00%> (-1.13%) ⬇️
src/PointEval/PointEvalHandler.jl 92.13% <0.00%> (-0.57%) ⬇️
src/Dofs/MixedDofHandler.jl 85.65% <0.00%> (-0.45%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@KnutAM
Copy link
Member

KnutAM commented Dec 19, 2022

Nice!
Small, maybe stupid, question, what does dof_range(dh, :u) return in this case?

@fredrikekre
Copy link
Member Author

No change, the local matrix is always blocked even when not using a globally blocked matrix.

This patch adds support for global block matrices. A global block matrix
can be obtained by `create_sparsity_pattern(BlockMatrix, dh, ch)` or by
`create_sparsity_pattern(A::BlockMatrix, dh, ch)`. The former infers the
block sizes by looking at the fields of the DofHandler, and the latters
uses the blocksizes of the (partially) initilized BlockMatrix (i.e. by
`undef_blocks`).

For global assembly, `start_assemble(::BlockMatrix, ...)` returns a
`BlockAssembler` which pre allocates a vector for pre-computing the
(block number, local index) pairs for each DoF. BlockArrays only support
local condensation of constraints currently and you have to use
`apply_assemble!` instead of `assemble!` + `apply!`.
@fredrikekre fredrikekre merged commit 9c34e96 into master Jan 9, 2023
@fredrikekre fredrikekre deleted the fe/block-glue branch January 9, 2023 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants