Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

dolfin::Tensor< T > Class Template Reference

#include <Tensor.h>

Inheritance diagram for dolfin::Tensor< T >:

Inheritance graph
[legend]
Collaboration diagram for dolfin::Tensor< T >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Tensor ()
 Create empty tensor.

 Tensor (int order, int dim)
 Create tensor of given order and dimension.

 Tensor (const Tensor &t)
 Copy constructor.

 ~Tensor ()
 Destructor.

void init (int order, int dim)
 Initialize to given order and dimension.

void clear ()
 Clear tesor.

T & operator() (int i0)
 Evaluation for tensors of order = 1.

T & operator() (int i0, int i1)
 Evaluation for tensors of order = 2.

T & operator() (int i0, int i1, int i2)
 Evaluation for tensors of order = 3.

T & operator() (int *i)
 Evaluation for tensors of general order.

void operator= (const Tensor< T > &t)
 Assignment.


Detailed Description

template<class T>
class dolfin::Tensor< T >

A Tensor is a datastructure containing values accessed by a number of indices. The number of such indices is the order of the tensor. If the order is 1, then the Tensor behaves as a vector, and if the order is 2, then the Thensor behaves as a matrix, but also higher orders (more indices) can be used.

The number of possible values for each index is the dimension of the tensor.

The tensor is stored as an array where element (i_0, i_1, ... , i_m-1) is is given by element

i_0*n^(m-1) + i_1*n^(m-2) + ... + i_m-1,

where m is the order and n is the dimension.


Constructor & Destructor Documentation

template<class T>
dolfin::Tensor< T >::Tensor  ) 
 

Create empty tensor.

template<class T>
dolfin::Tensor< T >::Tensor int  order,
int  dim
 

Create tensor of given order and dimension.

template<class T>
dolfin::Tensor< T >::Tensor const Tensor< T > &  t  ) 
 

Copy constructor.

template<class T>
dolfin::Tensor< T >::~Tensor  ) 
 

Destructor.


Member Function Documentation

template<class T>
void dolfin::Tensor< T >::clear  ) 
 

Clear tesor.

template<class T>
void dolfin::Tensor< T >::init int  order,
int  dim
 

Initialize to given order and dimension.

template<class T>
T & dolfin::Tensor< T >::operator() int *  i  ) 
 

Evaluation for tensors of general order.

template<class T>
T & dolfin::Tensor< T >::operator() int  i0,
int  i1,
int  i2
 

Evaluation for tensors of order = 3.

template<class T>
T & dolfin::Tensor< T >::operator() int  i0,
int  i1
 

Evaluation for tensors of order = 2.

template<class T>
T & dolfin::Tensor< T >::operator() int  i0  ) 
 

Evaluation for tensors of order = 1.

template<class T>
void dolfin::Tensor< T >::operator= const Tensor< T > &  t  ) 
 

Assignment.


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


Documentation automatically generated with Doxygen on 10 Sep 2004.