Loading...
Searching...
No Matches
dolfin::TensorLayout Class Reference

`#include <TensorLayout.h>`

Inheritance diagram for dolfin::TensorLayout:
[legend]
Collaboration diagram for dolfin::TensorLayout:
[legend]

## Public Types

enum class | Sparsity : bool { SPARSE = true , DENSE = false }
| Sparse or dense layout.
enum class | Ghosts : bool { GHOSTED = true , UNGHOSTED = false }
| Ghosted or unghosted layout.

## Public Member Functions

| TensorLayout (MPI_Comm comm, std::size_t primary_dim, Sparsity sparsity_pattern)
| Create empty tensor layout.
| TensorLayout (MPI_Comm mpi_comm, std::vector< std::shared_ptr< const IndexMap > > index_maps, std::size_t primary_dim, Sparsity sparsity_pattern, Ghosts ghosted)
| Create a tensor layout.
void | init (std::vector< std::shared_ptr< const IndexMap > > index_maps, Ghosts ghosted)
| Initialize tensor layout.
std::size_t | rank () const
| Return rank.
std::size_t | size (std::size_t i) const
std::pair< std::size_t, std::size_t > | local_range (std::size_t dim) const
| Return local range for dimension dim.
std::shared_ptr< SparsityPattern > | sparsity_pattern ()
| Return sparsity pattern (possibly null).
std::shared_ptr< const SparsityPattern > | sparsity_pattern () const
| Return sparsity pattern (possibly null), const version.
std::string | str (bool verbose) const
| Return informal string representation (pretty-print).
MPI_Comm | mpi_comm () const
| Return MPI communicator.
std::shared_ptr< const IndexMap > | index_map (std::size_t i) const
| Return IndexMap for dimension.
Ghosts | is_ghosted () const
| Require ghosts.
Public Member Functions inherited from dolfin::Variable
| Variable ()
| Create unnamed variable.
| Variable (const std::string name, const std::string label)
| Create variable with given name and label.
| Variable (const Variable &variable)
| Copy constructor.
virtual | ~Variable ()
| Destructor.
const Variable & | operator= (const Variable &variable)
| Assignment operator.
void | rename (const std::string name, const std::string label)
| Rename variable.
std::string | name () const
| Return name.
std::string | label () const
| Return label (description).
std::size_t | id () const

## Public Attributes

const std::size_t | primary_dim
| Primary storage dim (e.g., 0=row major, 1=column major).
Public Attributes inherited from dolfin::Variable
Parameters | parameters
| Parameters.

## Detailed Description

This class described the size and possibly the sparsity of a (sparse) tensor. It is used by the linear algebra backends to initialise tensors.

## Member Function Documentation

## size()

std::size_t TensorLayout::size | ( | std::size_t | i | ) | const

Return global size for dimension i (size of tensor, includes non-zeroes)

## str()

std::string TensorLayout::str | ( | bool | verbose | ) | const

virtual

Return informal string representation (pretty-print).

Reimplemented from dolfin::Variable.

The documentation for this class was generated from the following files:

- /build/dolfin-wwk1CC/dolfin-2019.2.0~legacy20240219.1c52e83/dolfin/la/TensorLayout.h
- /build/dolfin-wwk1CC/dolfin-2019.2.0~legacy20240219.1c52e83/dolfin/la/TensorLayout.cpp