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

Specifying coupling between fields/components in create_sparsity_pattern #544

Merged
merged 1 commit into from
Dec 6, 2022

Conversation

fredrikekre
Copy link
Member

This patch implements a new keyword argument coupling to create_sparsity_pattern where the coupling between fields or components in the DofHandler can be specified. coupling should be a matrix of booleans, where rows are test functions and columns the unknowns. Consider for example a system with (u, p) as unknowns, and (v, q) as the corresponding test functions. If there is no coupling between e.g. p and q the coupling matrix would be

    u      p
    -------------
v  | true  true
q  | true  false

i.e. coupling = [true true; true false]. The coupling can also be specified component wise (if one of the fields have multiple components). For example, if (u, v) have two components, the equivalent coupling specified by components would be

     u1     u2    p
    ------------------
v1 | true  true  true
v2 | true  true  true
q  | true  true  false

The resulting sparsity pattern will not have entries for components that do not couple. By default full coupling is assumed (just like before).

@codecov-commenter
Copy link

codecov-commenter commented Dec 2, 2022

Codecov Report

Base: 92.65% // Head: 92.65% // No change to project coverage 👍

Coverage data is based on head (93fb42c) compared to base (93fb42c).
Patch has no changes to coverable lines.

❗ Current head 93fb42c differs from pull request most recent head cd8b7c2. Consider uploading reports for the commit cd8b7c2 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #544   +/-   ##
=======================================
  Coverage   92.65%   92.65%           
=======================================
  Files          23       23           
  Lines        3946     3946           
=======================================
  Hits         3656     3656           
  Misses        290      290           

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.

…tern`

This patch implements a new keyword argument `coupling` to
`create_sparsity_pattern` where the coupling between fields or
components in the DofHandler can be specified. `coupling` should be a
matrix of booleans, where rows are test functions and columns the
unknowns. Consider for example a system with (u, p) as unknowns, and (v,
q) as the corresponding test functions. If there is no coupling between
e.g. p and q the coupling matrix would be
        u      p
        -------------
    v  | true  true
    q  | true  false

i.e. `coupling = [true true; true false]`. The coupling can also be
specified component wise (if one of the fields have multiple
components). For example, if (u, v) have two components, the equivalent
coupling specified by components would be
         u1     u2    p
        ------------------
    v1 | true  true  true
    v2 | true  true  true
    q  | true  true  false

The resulting sparsity pattern will not have entries for components that
do not couple. By default full coupling is assumed (just like
before).

The new functionality is used in the stokes-flow.jl example, where there
are no coupling between test- and trial functions for the pressure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants