Constant

Constant(self, *args, **kwargs)

Symbol representing a constant, scalar value in symbolic equations. A Constant carries a scalar value.

Parameters

Name Type Description Default
name str Name of the symbol. required
dtype devito.types.constant.Constant.data - type Any object that can be interpreted as a numpy data type. np.float32

Examples

>>> from devito import Constant
>>> c = Constant(name='c')
>>> c
c
>>> c.data
0.0
>>> c.data = 4
>>> c.data
4.0

Notes

The parameters must always be given as keyword arguments, since SymPy uses *args to (re-)create the dimension arguments of the symbolic object.

Attributes

Name Description
data The value of the data object, as a scalar (int, float, …).
is_Constant bool(x) -> bool
is_Input bool(x) -> bool
Back to top