GenericVector

class dolfin.cpp.la.GenericVector(*args, **kwargs)

Bases: dolfin.cpp.la.GenericTensor

This class defines a common interface for vectors.

abs()

Replace all entries in the vector by their absolute values

add()

Overloaded versions

  • add(block, num_rows, rows)

    Add block of values using global indices

  • add(block, rows)

    Add block of values using global indices

  • add(block, rows)

    Add block of values using global indices

  • add(block, m, rows)

    Add block of values using global indices

add_local()

Overloaded versions

  • add_local(block, num_rows, rows)

    Add block of values using local indices

  • add_local(block, rows)

    Add block of values using local indices

  • add_local(block, rows)

    Add block of values using local indices

  • add_local(block, m, rows)

    Add block of values using local indices

  • add_local(values)

    Add values to each entry on local process

array()

Return a numpy array representation of the local part of a Vector

axpy()

Add multiple of given vector (AXPY operation)

copy()

Return copy of vector

gather()

Overloaded versions

  • gather(x, indices)

    Gather entries into local vector x

  • gather(x, indices)

    Gather entries into x

gather_on_zero()

Gather all entries into x on process 0

get_local()

Overloaded versions

  • get_local(block, num_rows, rows)

    Get block of values using local indices

  • get_local(block, m, rows)

    Get block of values using local indices (values must all live on the local process, ghost are accessible)

  • get_local(values)

    Get all values on local process

init()

Overloaded versions

  • init(tensor_layout)

    Initialize zero tensor using sparsity pattern

  • init(comm, N)

    Initialize vector to global size N

  • init(comm, range)

    Initialize vector with given local ownership range

  • init(comm, range, local_to_global_map, ghost_indices)

    Initialise vector with given ownership range and with ghost values

inner()

Return inner product with given vector

local_range()

Overloaded versions

  • local_range(dim)

    Return local ownership range

  • local_range()

    Return local ownership range of a vector

local_size()

Return local size of vector

max()

Return maximum value of vector

min()

Return minimum value of vector

norm()

Return norm of vector

owns_index()

Determine whether global vector index is owned by this process

set_local()

Overloaded versions

  • set_local(block, num_rows, rows)

    Set block of values using local indices

  • set_local(block, m, rows)

    Set block of values using local indices

  • set_local(values)

    Set all values on local process

size()

Overloaded versions

  • size(dim)

    Return size of given dimension

  • size()

    Return global size of vector

sum()

Overloaded versions

  • sum()

    Return sum of vector

  • sum(rows)

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

thisown

The membership flag