namespace ewalena
0.2.15
ewalena is not an acronym
|
#include <include/ewalena/base/tensor.h>
Public Member Functions | |
void | clone (const Tensor< dim, rank, ValueType > &T) |
void | invert (const Tensor< dim, rank, ValueType > &T) |
bool | is_symmetric () const |
unsigned int | n_components () const |
ValueType & | operator() (const unsigned int index,...) |
const ValueType & | operator() (const unsigned int index,...) const |
const ValueType * | operator* () const |
ValueType * | operator* () |
void | operator*= (const ValueType &scalar) |
Tensor< dim, rank, ValueType > | operator+ (const Tensor< dim, rank, ValueType > &T) |
void | operator+= (const Tensor< dim, rank, ValueType > &T) |
Tensor< dim, rank, ValueType > | operator- (const Tensor< dim, rank, ValueType > &T) |
void | operator-= (const Tensor< dim, rank, ValueType > &T) |
void | operator/= (const ValueType &scalar) |
bool | operator== (const Tensor< dim, rank, ValueType > &T) const |
void | reinit () |
void | sadd (const ValueType &a, const Tensor< dim, rank, ValueType > &T_a) |
void | sadd (const ValueType &a, const Tensor< dim, rank, ValueType > &T_a, const ValueType &b, const Tensor< dim, rank, ValueType > &T_b) |
void | sadd (const ValueType &a, const Tensor< dim, rank, ValueType > &T_a, const ValueType &b, const Tensor< dim, rank, ValueType > &T_b, const ValueType &c, const Tensor< dim, rank, ValueType > &T_c) |
void | sadd (const std::vector< ValueType > &a, const std::vector< Tensor< dim, rank, ValueType > > &T_a) |
Tensor (const bool zero=true) | |
Tensor (const Tensor &T) | |
std::pair< unsigned int, unsigned int > | voight_components () const |
~Tensor () | |
Protected Attributes | |
int | __dim |
unsigned int | __n_components |
int | __rank |
Private Attributes | |
ValueType * | data |
Friends | |
std::ostream & | operator<< (std::ostream &output, const Tensor< dim, rank, ValueType > &T) |
A class that denotes a tensor with no special qualities, ie. no special symmetries, data access, etc.
ewalena::Tensor< dim, rank, ValueType >::Tensor | ( | const bool | zero = true | ) |
Constructor.
ewalena::Tensor< dim, rank, ValueType >::~Tensor | ( | ) |
Destructor.
ewalena::Tensor< dim, rank, ValueType >::Tensor | ( | const Tensor< dim, rank, ValueType > & | T | ) |
Initialize a tensor with another tensor T
with a memory copy.
void ewalena::Tensor< dim, rank, ValueType >::clone | ( | const Tensor< dim, rank, ValueType > & | T | ) |
Clone the contents of tensor to
this
tensor.
void ewalena::Tensor< dim, rank, ValueType >::invert | ( | const Tensor< dim, rank, ValueType > & | T | ) | [inline] |
Invert tensor .
bool ewalena::Tensor< dim, rank, ValueType >::is_symmetric | ( | ) | const |
Return true if this
tensor is symmetric.
unsigned int ewalena::Tensor< dim, rank, ValueType >::n_components | ( | ) | const [inline] |
Return the number of components this tensor has, ie. .
Reimplemented in ewalena::Crystal::CrystalFieldBase< dim, rank, ValueType >, ewalena::Crystal::CrystalFieldBase< 3, 3, ValueType >, ewalena::Crystal::CrystalFieldBase< 3, 4, ValueType >, ewalena::Crystal::CrystalFieldBase< 3, 1, ValueType >, and ewalena::Crystal::CrystalFieldBase< 3, 2, ValueType >.
ValueType & ewalena::Tensor< dim, rank, ValueType >::operator() | ( | const unsigned int | index, |
... | |||
) | [inline] |
Read-write access to the i
th, j
th, etc. index of this tensor.
const ValueType & ewalena::Tensor< dim, rank, ValueType >::operator() | ( | const unsigned int | index, |
... | |||
) | const [inline] |
Read only access to the i
th, j
th, etc. index of this tensor.
const ValueType* ewalena::Tensor< dim, rank, ValueType >::operator* | ( | ) | const [inline] |
Read-write access operator to the underlying C array structure associated with this tensor field.
Reimplemented in ewalena::Crystal::CrystalFieldBase< dim, rank, ValueType >, ewalena::Crystal::CrystalFieldBase< 3, 3, ValueType >, ewalena::Crystal::CrystalFieldBase< 3, 4, ValueType >, ewalena::Crystal::CrystalFieldBase< 3, 1, ValueType >, ewalena::Crystal::CrystalFieldBase< 3, 2, ValueType >, ewalena::Point< dim, ValueType >, ewalena::Crystal::ElasticField< ValueType >, ewalena::Crystal::DielectricField< ValueType >, ewalena::Crystal::PiezoelectricField< ValueType >, ewalena::Crystal::PyroelectricField< ValueType >, and ewalena::Crystal::FerroelectricField< ValueType >.
ValueType* ewalena::Tensor< dim, rank, ValueType >::operator* | ( | ) | [inline] |
Read only access operator to the underlying C array structure associated with this tensor field.
Reimplemented in ewalena::Point< dim, ValueType >.
void ewalena::Tensor< dim, rank, ValueType >::operator*= | ( | const ValueType & | scalar | ) | [inline] |
Inline multiplication operator. Multiply each element in this
tensor by a scalar
value.
Reimplemented in ewalena::Point< dim, ValueType >.
Tensor< dim, rank, ValueType > ewalena::Tensor< dim, rank, ValueType >::operator+ | ( | const Tensor< dim, rank, ValueType > & | T | ) | [inline] |
Inline addition operator. Return this
plus T
tensor.
void ewalena::Tensor< dim, rank, ValueType >::operator+= | ( | const Tensor< dim, rank, ValueType > & | T | ) | [inline] |
Inline addition operator. Add T
to this
tensor.
Tensor< dim, rank, ValueType > ewalena::Tensor< dim, rank, ValueType >::operator- | ( | const Tensor< dim, rank, ValueType > & | T | ) | [inline] |
Inline subtraction operator. Return this
minus T
tensor.
void ewalena::Tensor< dim, rank, ValueType >::operator-= | ( | const Tensor< dim, rank, ValueType > & | T | ) | [inline] |
Inline subtraction operator. Subtract T
from this
tensor.
void ewalena::Tensor< dim, rank, ValueType >::operator/= | ( | const ValueType & | scalar | ) | [inline] |
Inline division operator. Divide each element in this
tensor by a scalar
value.
Reimplemented in ewalena::Point< dim, ValueType >.
bool ewalena::Tensor< dim, rank, ValueType >::operator== | ( | const Tensor< dim, rank, ValueType > & | T | ) | const [inline] |
Equivalence operator. Return true if this
tensor is an identical copy of the tensor T
.
void ewalena::Tensor< dim, rank, ValueType >::reinit | ( | ) |
Reinitialise the contents of this tensor to nothing (zero).
void ewalena::Tensor< dim, rank, ValueType >::sadd | ( | const ValueType & | a, |
const Tensor< dim, rank, ValueType > & | T_a | ||
) | [inline] |
Sum-add a tensor to this
tensor: \,.
void ewalena::Tensor< dim, rank, ValueType >::sadd | ( | const ValueType & | a, |
const Tensor< dim, rank, ValueType > & | T_a, | ||
const ValueType & | b, | ||
const Tensor< dim, rank, ValueType > & | T_b | ||
) | [inline] |
Sum-add two tensors to this
tensor: \,.
void ewalena::Tensor< dim, rank, ValueType >::sadd | ( | const ValueType & | a, |
const Tensor< dim, rank, ValueType > & | T_a, | ||
const ValueType & | b, | ||
const Tensor< dim, rank, ValueType > & | T_b, | ||
const ValueType & | c, | ||
const Tensor< dim, rank, ValueType > & | T_c | ||
) | [inline] |
Sum-add three tensors to this
tensor: \,.
void ewalena::Tensor< dim, rank, ValueType >::sadd | ( | const std::vector< ValueType > & | a, |
const std::vector< Tensor< dim, rank, ValueType > > & | T_a | ||
) | [inline] |
Sum-add a vector of tensors to this
tensor: \,.
std::pair<unsigned int, unsigned int> ewalena::Tensor< dim, rank, ValueType >::voight_components | ( | ) | const |
Return the size of the Voight matrix representation of this tensor.
std::ostream& operator<< | ( | std::ostream & | output, |
const Tensor< dim, rank, ValueType > & | T | ||
) | [friend] |
Output operator to stream.
int ewalena::Tensor< dim, rank, ValueType >::__dim [protected] |
Internal object storing the tensor dimension.
unsigned int ewalena::Tensor< dim, rank, ValueType >::__n_components [protected] |
Internal reference to the number of components this tensor has, ie. . (For internal reference this is just the length of the underlying data array structure).
int ewalena::Tensor< dim, rank, ValueType >::__rank [protected] |
Internal object storing the tensor rank.
ValueType* ewalena::Tensor< dim, rank, ValueType >::data [private] |
Internal object denoting this tensor data.