Loading...
Searching...
No Matches
dolfin::GenericTensor Class Referenceabstract

A common interface for arbitrary rank tensors. More...

`#include <GenericTensor.h>`

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

## Public Member Functions

virtual | ~GenericTensor ()
| Destructor.
virtual void | init (const TensorLayout &tensor_layout)=0
| Initialize zero tensor using tensor layout.
virtual bool | empty () const =0
| Return true if empty.
virtual std::size_t | rank () const =0
| Return tensor rank (number of dimensions).
virtual std::size_t | size (std::size_t dim) const =0
| Return size of given dimension.
virtual std::pair< std::int64_t, std::int64_t > | local_range (std::size_t dim) const =0
| Return local ownership range.
virtual void | get (double *block, const dolfin::la_index *num_rows, const dolfin::la_index *const *rows) const =0
| Get block of values.
virtual void | set (const double *block, const dolfin::la_index *num_rows, const dolfin::la_index *const *rows)=0
| Set block of values using global indices.
virtual void | set_local (const double *block, const dolfin::la_index *num_rows, const dolfin::la_index *const *rows)=0
| Set block of values using local indices.
virtual void | add (const double *block, const std::vector< ArrayView< const dolfin::la_index > > &rows)=0
| Add block of values using global indices.
virtual void | add_local (const double *block, const std::vector< ArrayView< const dolfin::la_index > > &rows)=0
| Add block of values using local indices.
virtual void | add (const double *block, const dolfin::la_index *num_rows, const dolfin::la_index *const *rows)=0
| Add block of values using global indices.
virtual void | add_local (const double *block, const dolfin::la_index *num_rows, const dolfin::la_index *const *rows)=0
| Add block of values using local indices.
virtual void | zero ()=0
| Set all entries to zero and keep any sparse structure.
virtual void | apply (std::string mode)=0
| Finalize assembly of tensor.
virtual std::string | str (bool verbose) const =0
| Return MPI communicator.
virtual GenericLinearAlgebraFactory & | factory () const =0
| Return linear algebra backend factory.
Public Member Functions inherited from dolfin::LinearAlgebraObject
virtual const LinearAlgebraObject * | instance () const
| Return concrete instance / unwrap (const version).
virtual LinearAlgebraObject * | instance ()
| Return concrete instance / unwrap (non-const version).
virtual std::shared_ptr< const LinearAlgebraObject > | shared_instance () const
| Return concrete shared ptr instance / unwrap (const version).
virtual std::shared_ptr< LinearAlgebraObject > | shared_instance ()
| Return concrete shared ptr instance / unwrap (non-const version).
virtual MPI_Comm | mpi_comm () const =0
| Return MPI communicator.
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

## Additional Inherited Members

Public Attributes inherited from dolfin::Variable
Parameters | parameters
| Parameters.

## Detailed Description

A common interface for arbitrary rank tensors.

## Member Function Documentation

## add() [1/2]

virtual void dolfin::GenericTensor::add | ( | const double * | block,
|  | const dolfin::la_index * | num_rows,
|  | const dolfin::la_index *const * | rows )

pure virtual

Add block of values using global indices.

Implemented in dolfin::GenericMatrix, dolfin::GenericVector, and dolfin::Scalar.

## add() [2/2]

virtual void dolfin::GenericTensor::add | ( | const double * | block,
|  | const std::vector< ArrayView< const dolfin::la_index > > & | rows )

pure virtual

Add block of values using global indices.

Implemented in dolfin::GenericMatrix, dolfin::GenericVector, and dolfin::Scalar.

## add_local() [1/2]

virtual void dolfin::GenericTensor::add_local | ( | const double * | block,
|  | const dolfin::la_index * | num_rows,
|  | const dolfin::la_index *const * | rows )

pure virtual

Add block of values using local indices.

Implemented in dolfin::GenericMatrix, dolfin::GenericVector, and dolfin::Scalar.

## add_local() [2/2]

virtual void dolfin::GenericTensor::add_local | ( | const double * | block,
|  | const std::vector< ArrayView< const dolfin::la_index > > & | rows )

pure virtual

Add block of values using local indices.

Implemented in dolfin::GenericMatrix, dolfin::GenericVector, and dolfin::Scalar.

## apply()

virtual void dolfin::GenericTensor::apply | ( | std::string | mode | ) |

pure virtual

Finalize assembly of tensor.

Implemented in dolfin::EigenMatrix, dolfin::EigenVector, dolfin::GenericMatrix, dolfin::GenericVector, dolfin::Matrix, dolfin::PETScMatrix, dolfin::PETScVector, dolfin::Scalar, dolfin::TpetraMatrix, dolfin::TpetraVector, and dolfin::Vector.

## empty()

virtual bool dolfin::GenericTensor::empty | ( |  | ) | const

pure virtual

Return true if empty.

Implemented in dolfin::EigenMatrix, dolfin::EigenVector, dolfin::Matrix, dolfin::PETScMatrix, dolfin::PETScVector, dolfin::Scalar, dolfin::TpetraMatrix, dolfin::TpetraVector, and dolfin::Vector.

## factory()

virtual GenericLinearAlgebraFactory & dolfin::GenericTensor::factory | ( |  | ) | const

pure virtual

Return linear algebra backend factory.

Implemented in dolfin::EigenMatrix, dolfin::EigenVector, dolfin::Matrix, dolfin::PETScMatrix, dolfin::PETScVector, dolfin::Scalar, dolfin::TpetraMatrix, dolfin::TpetraVector, and dolfin::Vector.

## get()

virtual void dolfin::GenericTensor::get | ( | double * | block,
|  | const dolfin::la_index * | num_rows,
|  | const dolfin::la_index *const * | rows ) const

pure virtual

Get block of values.

Implemented in dolfin::GenericMatrix, dolfin::GenericVector, and dolfin::Scalar.

## init()

virtual void dolfin::GenericTensor::init | ( | const TensorLayout & | tensor_layout | ) |

pure virtual

Initialize zero tensor using tensor layout.

Implemented in dolfin::EigenMatrix, dolfin::EigenVector, dolfin::GenericVector, dolfin::Matrix, dolfin::PETScMatrix, dolfin::PETScVector, dolfin::Scalar, dolfin::TpetraMatrix, dolfin::TpetraVector, and dolfin::Vector.

## local_range()

virtual std::pair< std::int64_t, std::int64_t > dolfin::GenericTensor::local_range | ( | std::size_t | dim | ) | const

pure virtual

Return local ownership range.

Implemented in dolfin::EigenMatrix, dolfin::GenericMatrix, dolfin::GenericVector, dolfin::Matrix, dolfin::PETScMatrix, dolfin::Scalar, and dolfin::TpetraMatrix.

## rank()

virtual std::size_t dolfin::GenericTensor::rank | ( |  | ) | const

pure virtual

Return tensor rank (number of dimensions).

Implemented in dolfin::GenericMatrix, dolfin::GenericVector, and dolfin::Scalar.

## set()

virtual void dolfin::GenericTensor::set | ( | const double * | block,
|  | const dolfin::la_index * | num_rows,
|  | const dolfin::la_index *const * | rows )

pure virtual

Set block of values using global indices.

Implemented in dolfin::GenericMatrix, dolfin::GenericVector, and dolfin::Scalar.

## set_local()

virtual void dolfin::GenericTensor::set_local | ( | const double * | block,
|  | const dolfin::la_index * | num_rows,
|  | const dolfin::la_index *const * | rows )

pure virtual

Set block of values using local indices.

Implemented in dolfin::GenericMatrix, dolfin::GenericVector, and dolfin::Scalar.

## size()

virtual std::size_t dolfin::GenericTensor::size | ( | std::size_t | dim | ) | const

pure virtual

Return size of given dimension.

Implemented in dolfin::EigenMatrix, dolfin::GenericMatrix, dolfin::GenericVector, dolfin::Matrix, dolfin::PETScMatrix, dolfin::PETScNestMatrix, dolfin::Scalar, and dolfin::TpetraMatrix.

## str()

virtual std::string dolfin::GenericTensor::str | ( | bool | verbose | ) | const

pure virtual

Return MPI communicator.

Return informal string representation (pretty-print)

Reimplemented from dolfin::Variable.

Implemented in dolfin::EigenMatrix, dolfin::EigenVector, dolfin::GenericMatrix, dolfin::GenericVector, dolfin::Matrix, dolfin::PETScMatrix, dolfin::PETScNestMatrix, dolfin::PETScVector, dolfin::Scalar, dolfin::TpetraMatrix, dolfin::TpetraVector, and dolfin::Vector.

## zero()

virtual void dolfin::GenericTensor::zero | ( |  | ) |

pure virtual

Set all entries to zero and keep any sparse structure.

Implemented in dolfin::EigenMatrix, dolfin::EigenVector, dolfin::GenericMatrix, dolfin::GenericVector, dolfin::Matrix, dolfin::PETScMatrix, dolfin::PETScVector, dolfin::Scalar, dolfin::TpetraMatrix, dolfin::TpetraVector, and dolfin::Vector.

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

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