Skip to content

Add Form arity property#470

Open
schnellerhase wants to merge 3 commits intomainfrom
schnellerhase/form-arity
Open

Add Form arity property#470
schnellerhase wants to merge 3 commits intomainfrom
schnellerhase/form-arity

Conversation

@schnellerhase
Copy link
Copy Markdown
Contributor

@schnellerhase schnellerhase commented Mar 19, 2026

There is currently no better way than len(form.arguments()) to check for the arity/rank of a form. Introduces property for simpler access. Since rank is already associated with tensor ranks in ufl, use the name arity.

Ref FEniCS/dolfinx#4118.

@schnellerhase schnellerhase self-assigned this Mar 19, 2026
@schnellerhase schnellerhase requested a review from jorgensd March 19, 2026 11:06
@jorgensd
Copy link
Copy Markdown
Member

A form doesn’t necessarily have a slingle arity, as each individual integrand can have different arities. This is for instance why things such as ‘ufl.system’ exists, as it would split the form by rank 2 and rank 1 systems.

if we want to have arity as a property, it should probably be max arity.

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.

2 participants