TensorLayout¶
-
class
dolfin.cpp.la.
TensorLayout
(*args)¶ Bases:
dolfin.cpp.common.Variable
This class described the size and possibly the sparsity of a (sparse) tensor. It is used by the linear algebra backends to initialise tensors.
Create a tensor layout.
Parameters: - mpi_comm (MPI_Comm) –
- std::shared_ptr< const IndexMap >> index_maps (std::vector<) –
- primary_dim (std::size_t) –
- sparsity_pattern (Sparsity) –
- ghosted (Ghosts) –
-
Ghosts_GHOSTED
= True¶
-
Ghosts_UNGHOSTED
= False¶
-
Sparsity_DENSE
= False¶
-
Sparsity_SPARSE
= True¶
-
index_map
()¶ Return
IndexMap
for dimension.Parameters: i (std::size_t) – Return type: std::shared_ptr< const IndexMap >
-
init
()¶ Initialize tensor layout.
Parameters: - std::shared_ptr< const IndexMap >> index_maps (std::vector<) –
- ghosted (Ghosts) –
Return type: void
-
is_ghosted
()¶ Require ghosts.
Return type: Ghosts
-
local_range
()¶ Return local range for dimension dim.
Parameters: dim (std::size_t) – Return type: std::pair< std::size_t, std::size_t >
-
primary_dim
¶ Primary storage dim (e.g., 0=row major, 1=column major)
Return type: const std::size_t
-
rank
()¶ Return rank.
Return type: std::size_t
-
size
()¶ Return global size for dimension i (size of tensor, includes non-zeroes)
Parameters: i (std::size_t) – Return type: std::size_t
-
sparsity_pattern
()¶ Return sparsity pattern (possibly null)
Return type: std::shared_ptr< SparsityPattern >
-
thisown
¶ The membership flag