Vector¶
-
class
dolfin.cpp.la.
Vector
(*args)¶ Bases:
dolfin.cpp.la.GenericVector
This class provides the default DOLFIN vector class, based on the default DOLFIN linear algebra backend.
Overloaded versions
Vector()
Create empty vector
Vector(comm, N)
Create vector of size N
Vector(x)
Copy constructor
Vector(x)
Create a Vector from a GenericVector
-
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
-
down_cast
()¶
-
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 (values must all live on the local process)
get_local(values)
Get all values on local process
-
init
()¶ Overloaded versions
init(comm, N)
Initialize vector to size N
init(comm, range)
Initialize vector with given ownership range
init(comm, range, local_to_global_map, ghost_indices)
Initialize vector with given ownership range and with ghost values
-
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
Overloaded versions
shared_instance()
Return concrete shared ptr instance / unwrap (const version)
shared_instance()
Return concrete shared ptr instance / unwrap (non-const version)
-
sum
()¶ Return sum of values of vector
-
thisown
¶ The membership flag