Skip to content

Commit

Permalink
Fix integral count
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgensd committed Aug 11, 2023
1 parent 07ccdd7 commit a06c727
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ffcx/codegeneration/form.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ def generator(ir, options):
code = []
cases = []
for itg_type in ("cell", "interior_facet", "exterior_facet"):
cases += [(L.Symbol(itg_type), L.Return(len(ir.subdomain_ids[itg_type])))]
num_integrals = 0
for ids in ir.subdomain_ids[itg_type].values():
num_integrals += len(ids)
cases += [(L.Symbol(itg_type), L.Return(num_integrals))]
code += [L.Switch("integral_type", cases, default=L.Return(0))]
d["num_integrals"] = L.StatementList(code)

Expand Down

2 comments on commit a06c727

@chrisrichardson
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm planning on deleting this code pretty soon. Is the same information updated in form_integrals/offsets? (the new interface)

@jorgensd
Copy link
Member Author

Choose a reason for hiding this comment

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

Please sign in to comment.