MCPcopy Create free account
hub / github.com/FEniCS/dolfinx / __complex__

Method __complex__

python/dolfinx/fem/function.py:93–98  ·  view source on GitHub ↗

Complex representation of the constant.

(self)

Source from the content-addressed store, hash-verified

91 return float(self.value)
92
93 def __complex__(self) -> complex:
94 """Complex representation of the constant."""
95 if self.ufl_shape or self.ufl_free_indices:
96 raise TypeError("Cannot evaluate a nonscalar expression to a scalar value.")
97
98 return complex(self.value)
99
100
101class Expression(Generic[Scalar]):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected