uBLASVector

class dolfin.cpp.la.uBLASVector(*args)

Bases: dolfin.cpp.la.GenericVector

This class provides a simple vector class based on uBLAS. It is a simple wrapper for a uBLAS vector implementing the GenericVector interface.

The interface is intentionally simple. For advanced usage, access the underlying uBLAS vector and use the standard uBLAS interface which is documented at http://www.boost.org/libs/numeric/ublas/doc/index.htm.

Overloaded versions

  • uBLASVector()

    Create empty vector

  • uBLASVector(N)

    Create vector of size N

  • uBLASVector(x)

    Copy constructor

  • uBLASVector(x)

    Construct vector from a ublas_vector

add_local()

Overloaded versions

  • add_local(block, m, rows)

    Add block of values using local indices

  • add_local(values)

    Add values to each entry on local process

data(deepcopy=True)

Return an array to underlaying data

This method is only available for the uBLAS linear algebra backend.

Arguments
deepcopy
Return a copy of the data. If set to False a reference to the Matrix need to be kept, otherwise the data will be destroyed together with the destruction of the Matrix
gather()

Overloaded versions

  • gather(x, indices)

    Gather entries into local vector x

  • gather(x, indices)

    Gather entries into x

get_local()

Overloaded versions

  • get_local(block, m, rows)

    Get block of values using local indices

  • get_local(values)

    Get all values on local process

init()

Overloaded versions

  • init(comm, N)

    Initialize vector to size N

  • init(comm, range)

    Resize vector with given ownership range

  • init(comm, range, local_to_global_map, ghost_indices)

    Resize vector with given ownership range and with ghost values

resize()

Resize vector to size N

set_local()

Overloaded versions

  • set_local(block, m, rows)

    Set block of values using local indices

  • set_local(values)

    Set all values on local process

sum()

Overloaded versions

  • sum()

    Return sum of values of vector

  • sum(rows)

    Return sum of selected rows in vector. Repeated entries are only summed once.

thisown

The membership flag

vec()

Overloaded versions

  • vec()

    Return reference to uBLAS vector (const version)

  • vec()

    Return reference to uBLAS vector (non-const version)