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

Method functiontype

python/dolfinx/fem/function.py:384–394  ·  view source on GitHub ↗
(dtype)

Source from the content-addressed store, hash-verified

382
383 # Create cpp Function
384 def functiontype(dtype):
385 if np.issubdtype(dtype, np.float32):
386 return _cpp.fem.Function_float32
387 elif np.issubdtype(dtype, np.float64):
388 return _cpp.fem.Function_float64
389 elif np.issubdtype(dtype, np.complex64):
390 return _cpp.fem.Function_complex64
391 elif np.issubdtype(dtype, np.complex128):
392 return _cpp.fem.Function_complex128
393 else:
394 raise NotImplementedError(f"Type {dtype} not supported.")
395
396 if x is not None:
397 self._cpp_object = functiontype(dtype)(V._cpp_object, x._cpp_object) # type: ignore

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected