GenericTensor¶
-
class
dolfin.cpp.la.
GenericTensor
(*args, **kwargs)¶ Bases:
dolfin.cpp.la.LinearAlgebraObject
A common interface for arbitrary rank tensors.
-
add
()¶ Add block of values using global indices.
Parameters: - double * block (const) –
- std::vector< ArrayView< const dolfin::la_index >> & rows (const) –
Return type: void
-
add_local
()¶ Add block of values using local indices.
Parameters: - double * block (const) –
- std::vector< ArrayView< const dolfin::la_index >> & rows (const) –
Return type: void
-
apply
()¶ Finalize assembly of tensor.
Parameters: mode (std::string) – Return type: void
-
factory
()¶ Return linear algebra backend factory.
Return type: GenericLinearAlgebraFactory &
-
init
()¶ Initialize zero tensor using tensor layout.
Parameters: TensorLayout & tensor_layout (const) – Return type: void
-
local_range
()¶ Return local ownership range.
Parameters: dim (std::size_t) – Return type: std::pair< std::int64_t, std::int64_t >
-
rank
()¶ Return tensor rank (number of dimensions)
Return type: std::size_t
-
set_local
()¶ Set
block of values using local indices.Parameters: - double * block (const) –
- dolfin::la_index * num_rows (const) –
- dolfin::la_index *const * rows (const) –
Return type: void
-
size
()¶ Return size of given dimension.
Parameters: dim (std::size_t) – Return type: std::size_t
-
thisown
¶ The membership flag
-
zero
()¶ Set
all entries to zero and keep any sparse structure.Return type: void
-