Skip to content

Handle restrictions on MeshSequence#264

Merged
mscroggs merged 8 commits intoFEniCS:mainfrom
firedrakeproject:ksagiyam/introduce_mixed_map
Oct 15, 2025
Merged

Handle restrictions on MeshSequence#264
mscroggs merged 8 commits intoFEniCS:mainfrom
firedrakeproject:ksagiyam/introduce_mixed_map

Conversation

@ksagiyam
Copy link
Contributor

@ksagiyam ksagiyam commented Mar 27, 2024

Depend on #382 (small).

In multi-domain (submesh) problems, there are situations where, say, an exterior-facet integration of domainA is an interior-facet integration of domainB. In this PR we extend the Measure class to correctly represent such integration. Specifically, in the above example, if we choose domainA as the "primal" integration domain, we define the interested measure as:

meas = Measure(
    "ds", domainA,
    intersect_measures=(
        Measure("dS", domainB),
    )
)

. This required changing:

  • integral sorting (form.py),
  • IntegralData grouping (algorithms/domain_analysis.py),
  • signature (algorithms/signature.py),

accordingly.

We also modified RestrictionPropagator class and apply_restrictions() function. apply_restriction() function now takes default_restrictions kwarg, so that we can specify the default restrictions domain-wise. In the above case, we will have something like:

apply_restrictions(
    integral,
    default_restrictions={
        domainA: None,
        domainB: "+",
    }
)

.

@ksagiyam ksagiyam changed the title Introduce MixedMesh Introduce MixedMesh + handle restrictions on MixedMesh Aug 21, 2024
@ksagiyam ksagiyam force-pushed the ksagiyam/introduce_mixed_map branch 2 times, most recently from 23696eb to ae55b3b Compare November 20, 2024 13:38
@ksagiyam ksagiyam force-pushed the ksagiyam/introduce_mixed_map branch from ae55b3b to 4ced3a7 Compare December 10, 2024 15:53
@ksagiyam ksagiyam force-pushed the ksagiyam/introduce_mixed_map branch 5 times, most recently from 7e4dd44 to ef8fd99 Compare January 10, 2025 21:23
@ksagiyam ksagiyam force-pushed the ksagiyam/introduce_mixed_map branch 2 times, most recently from 988189f to 36559fc Compare January 17, 2025 21:33
@ksagiyam ksagiyam force-pushed the ksagiyam/introduce_mixed_map branch from 36559fc to 9317b5b Compare February 6, 2025 23:48
@ksagiyam ksagiyam force-pushed the ksagiyam/introduce_mixed_map branch from 9317b5b to 883ee0b Compare February 20, 2025 13:38
@mscroggs
Copy link
Member

Should this PR be closed in favour of #303? Or this a different feature?

@ksagiyam ksagiyam force-pushed the ksagiyam/introduce_mixed_map branch from 883ee0b to 2d76a5e Compare March 7, 2025 12:55
@ksagiyam
Copy link
Contributor Author

ksagiyam commented Sep 8, 2025

@jorgensd Could we possibly aim to merge this PR this week? I have following PRs, but it would be great to have this merged at least before coming Firedrake workshop.

@jorgensd
Copy link
Member

jorgensd commented Sep 8, 2025

@jorgensd Could we possibly aim to merge this PR this week? I have following PRs, but it would be great to have this merged at least before coming Firedrake workshop.

I'd like some of the other developers to also have a look at this (at the change is rather big, and cascades into different corners of UFL).
@mscroggs @jhale @michalhabera

@ksagiyam ksagiyam force-pushed the ksagiyam/introduce_mixed_map branch from a0ae366 to e82f3f1 Compare September 9, 2025 11:15
@ksagiyam ksagiyam force-pushed the ksagiyam/introduce_mixed_map branch 2 times, most recently from 9c380c1 to bad931e Compare September 23, 2025 22:11
@ksagiyam
Copy link
Contributor Author

@jhale If time allows, could you have a look at this?

@ksagiyam ksagiyam force-pushed the ksagiyam/introduce_mixed_map branch from bad931e to 67cf895 Compare September 25, 2025 11:41
@ksagiyam ksagiyam changed the title Introduce MeshSequence + handle restrictions on MeshSequence Handle restrictions on MeshSequence Sep 26, 2025
ksagiyam and others added 6 commits October 3, 2025 13:04
… ...) on construction

Co-authored-by: Pablo Brubeck <brubeck@protonmail.com>
* Add some type hints and simplify _extract_and_check_domain

* Use future annotations and set ruff target
@ksagiyam ksagiyam force-pushed the ksagiyam/introduce_mixed_map branch from 67cf895 to e9e1eab Compare October 3, 2025 12:42


def test_mixed_function_space_with_mesh_sequence_basic():
@pytest.mark.skipif(sys.version_info >= (3, 14), reason="Hits recursion error on Python 3.14.0rc1 ")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you test if this is still required? The other cases have been resolved, ref. #428.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks no longer necessary. I will remove once #428 is merged. Thanks!

@ksagiyam ksagiyam force-pushed the ksagiyam/introduce_mixed_map branch from f5e4d98 to 69eaf16 Compare October 13, 2025 15:21
@ksagiyam ksagiyam mentioned this pull request Oct 13, 2025
@ksagiyam ksagiyam force-pushed the ksagiyam/introduce_mixed_map branch from 0fc455f to f52f7c6 Compare October 13, 2025 15:42
@jhale jhale self-requested a review October 15, 2025 14:20
Copy link
Member

@jhale jhale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slack conversation on the necessity or not of a more advanced boolean algebra on measures was satisfactory addressed.

@mscroggs mscroggs added this pull request to the merge queue Oct 15, 2025
Merged via the queue into FEniCS:main with commit fe31a3f Oct 15, 2025
18 checks passed
@mscroggs mscroggs deleted the ksagiyam/introduce_mixed_map branch October 15, 2025 14:34
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.

6 participants