Constant

class dolfin.cpp.function.Constant(*args)

Bases: dolfin.cpp.function.Expression

This class represents a constant-valued expression.

Overloaded versions

  • Constant(value)

    Create scalar constant

    Arguments
    value (float)

    The scalar to create a Constant object from.

    Example

    Note

    No example code available for this function.

  • Constant(value0, value1)

    Create vector constant (dim = 2)

    Arguments
    value0 (float)

    The first vector element.

    value1 (float)

    The second vector element.

    Example

    Note

    No example code available for this function.

  • Constant(value0, value1, value2)

    Create vector constant (dim = 3)

    Arguments
    value0 (float)

    The first vector element.

    value1 (float)

    The second vector element.

    value2 (float)

    The third vector element.

    Example

    Note

    No example code available for this function.

  • Constant(values)

    Create vector-valued constant

    Arguments
    values (numpy.array(float))

    Values to create a vector-valued constant from.

  • Constant(value_shape, values)

    Create tensor-valued constant for flattened array of values

    Arguments
    value_shape (numpy.array(int))

    Shape of tensor.

    values (numpy.array(float))

    Values to create tensor-valued constant from.

  • Constant(constant)

    Copy constructor

    Arguments
    constant (Constant)

    Object to be copied.

assign()

Overloaded versions

  • operator=(constant)

    Assignment operator

    Arguments
    constant (Constant)

    Another constant.

  • operator=(constant)

    Assignment operator

    Arguments
    constant (float)

    Another constant.

thisown

The membership flag