Skip to content

Commit

Permalink
Fix in custom element
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisrichardson committed Aug 13, 2023
1 parent 5deeb08 commit d97282c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ffcx/codegeneration/C/finite_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ def generate_custom_element(name, ir):
d["value_shape_length"] = len(ir.value_shape)
if len(ir.value_shape) > 0:
d["value_shape"] = f"value_shape_{name}"
d["value_shape_init"] = f"int value_shape_{name}[] = {{{', '.join(ir.value_shape)}}};"
values = ', '.join(str(i) for i in ir.value_shape)
d["value_shape_init"] = f"int value_shape_{name}[] = {{{values}}};"
else:
d["value_shape"] = "NULL"
d["value_shape_init"] = ""
Expand All @@ -133,7 +134,7 @@ def generate_custom_element(name, ir):
d["wcoeffs_cols"] = ir.wcoeffs.shape[1]
d["wcoeffs"] = f"wcoeffs_{name}"
d["wcoeffs_init"] = f"double wcoeffs_{name}[{ir.wcoeffs.shape[0] * ir.wcoeffs.shape[1]}] = "
d["wcoeffs_init"] += "{" + ",".join([f" {i}" for row in ir.wcoeffs for i in row]) + "};"
d["wcoeffs_init"] += "{" + ", ".join([f" {i}" for row in ir.wcoeffs for i in row]) + "};"

npts = []
x = []
Expand Down

0 comments on commit d97282c

Please sign in to comment.