Skip to content

Commit 855585d

Browse files
finsbergschnellerhasegarth-wells
authored
Allow dolfinx.fem.Constant to take native float as value type (#3847)
* Allow constant to take native float as value type * Update python/dolfinx/fem/function.py Co-authored-by: Paul T. Kühner <56360279+schnellerhase@users.noreply.github.com> * Run ruff --------- Co-authored-by: Paul T. Kühner <56360279+schnellerhase@users.noreply.github.com> Co-authored-by: Garth N. Wells <gnw20@cam.ac.uk>
1 parent e5ee6ae commit 855585d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

python/dolfinx/fem/function.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ class Constant(ufl.Constant):
3838
]
3939

4040
def __init__(
41-
self, domain, c: typing.Union[np.ndarray, Sequence, np.floating, np.complexfloating]
41+
self,
42+
domain,
43+
c: typing.Union[float, np.floating, complex, np.complexfloating, Sequence, np.ndarray],
4244
):
4345
"""A constant with respect to a domain.
4446

0 commit comments

Comments
 (0)