cee::SymmetricTensor Class Reference

A symmetric 3x3 tensor represented by 6 values: xx, yy, zz, xy, yz, zx. More...

Public Member Functions

 SymmetricTensor ()
 Constructs a null tensor. More...
 
 SymmetricTensor (const SymmetricTensor &other)
 Constructs a tensor as a copy of other. More...
 
 SymmetricTensor (double xx, double yy, double zz, double xy, double yz, double zx)
 Constructs a tensor from an the 6 values (xx, yy, zz, xy, yz, zx) More...
 
SymmetricTensoroperator= (const SymmetricTensor &SymmetricTensor)
 Assigns other to this tensor and returns a reference to this tensor. More...
 
bool operator== (const SymmetricTensor &rhs) const
 Returns true if two tensors are equal, otherwise returns false. More...
 
bool operator!= (const SymmetricTensor &rhs) const
 Returns true if two tensors are not equal, otherwise returns false. More...
 
const SymmetricTensor operator+ (const SymmetricTensor &rhs) const
 Returns a tensor that is this tensor added with rhs. More...
 
const SymmetricTensor operator- (const SymmetricTensor &rhs) const
 Returns a tensor that is this tensor subtracted with rhs. More...
 
SymmetricTensoroperator+= (const SymmetricTensor &rhs)
 Adds the given rhs tensor to this. More...
 
SymmetricTensoroperator-= (const SymmetricTensor &rhs)
 Subtracts the given rhs tensor from this. More...
 
const Vec3d operator* (const Vec3d &v) const
 Returns a vector that is this tensor multiplied by vector. More...
 
const SymmetricTensor operator* (double scalar) const
 Returns a tensor that is this tensor multiplied by scalar. More...
 
const SymmetricTensor operator/ (double scalar) const
 Returns a tensor that is this vector divided by scalar. More...
 
SymmetricTensoroperator*= (double scalar)
 Multiplies every component of this tensor by the given scalar. More...
 
SymmetricTensoroperator/= (double scalar)
 Divides every component of this tensor by the given scalar. More...
 
const double & xx () const
 XX element of the tensor. More...
 
const double & yy () const
 YY element of the tensor. More...
 
const double & zz () const
 ZZ element of the tensor. More...
 
const double & xy () const
 XY element of the tensor. More...
 
const double & yz () const
 YZ element of the tensor. More...
 
const double & zx () const
 ZX element of the tensor. More...
 
double & xx ()
 XX element of the tensor. More...
 
double & yy ()
 YY element of the tensor. More...
 
double & zz ()
 ZZ element of the tensor. More...
 
double & xy ()
 XY element of the tensor. More...
 
double & yz ()
 YZ element of the tensor. More...
 
double & zx ()
 ZX element of the tensor. More...
 
void set (double xx, double yy, double zz, double xy, double yz, double zx)
 Sets xx, yy, zz, xy, yz, zx values. More...
 
const double * rawPointer () const
 Returns a pointer to the raw array storing the 6 components. More...
 
double trace () const
 Returns trace. More...
 
SymmetricTensor deviator () const
 Returns the deviator. More...
 
double vonMises () const
 Returns vonMises value. More...
 
double firstPrincipalValue () const
 Returns first principal value. More...
 
double secondPrincipalValue () const
 Returns second principal value. More...
 
double thirdPrincipalValue () const
 Returns third principal value. More...
 
Vec3d firstPrincipalVector () const
 Returns first principal vector. More...
 
Vec3d secondPrincipalVector () const
 Returns second principal value. More...
 
Vec3d thirdPrincipalVector () const
 Returns third principal value. More...
 

Static Public Member Functions

static SymmetricTensor identity ()
 Returns identity tensor. More...
 

Protected Member Functions

 SymmetricTensor (double *values)
 Constructs a null tensor which will not own its data. Use SharedMemorySymmetricTensor to achieve this. More...
 

Friends

SymmetricTensor operator* (double scalar, const SymmetricTensor &t)
 
Inheritance diagram for cee::SymmetricTensor:
cee::SharedMemorySymmetricTensor

Detailed Description

A symmetric 3x3 tensor represented by 6 values: xx, yy, zz, xy, yz, zx.

Constructor & Destructor Documentation

cee::SymmetricTensor::SymmetricTensor ( )

Constructs a null tensor.

cee::SymmetricTensor::SymmetricTensor ( const SymmetricTensor other)

Constructs a tensor as a copy of other.

cee::SymmetricTensor::SymmetricTensor ( double  xx,
double  yy,
double  zz,
double  xy,
double  yz,
double  zx 
)

Constructs a tensor from an the 6 values (xx, yy, zz, xy, yz, zx)

cee::SymmetricTensor::SymmetricTensor ( double *  values)
protected

Constructs a null tensor which will not own its data. Use SharedMemorySymmetricTensor to achieve this.

Member Function Documentation

SymmetricTensor cee::SymmetricTensor::deviator ( ) const

Returns the deviator.

double cee::SymmetricTensor::firstPrincipalValue ( ) const

Returns first principal value.

cee::Vec3d cee::SymmetricTensor::firstPrincipalVector ( ) const

Returns first principal vector.

SymmetricTensor cee::SymmetricTensor::identity ( )
static

Returns identity tensor.

bool cee::SymmetricTensor::operator!= ( const SymmetricTensor rhs) const

Returns true if two tensors are not equal, otherwise returns false.

Exact comparison is used (!= between doubles)

const Vec3d cee::SymmetricTensor::operator* ( const Vec3d v) const

Returns a vector that is this tensor multiplied by vector.

const SymmetricTensor cee::SymmetricTensor::operator* ( double  scalar) const

Returns a tensor that is this tensor multiplied by scalar.

SymmetricTensor & cee::SymmetricTensor::operator*= ( double  scalar)

Multiplies every component of this tensor by the given scalar.

const SymmetricTensor cee::SymmetricTensor::operator+ ( const SymmetricTensor rhs) const

Returns a tensor that is this tensor added with rhs.

cee::SymmetricTensor & cee::SymmetricTensor::operator+= ( const SymmetricTensor rhs)

Adds the given rhs tensor to this.

const SymmetricTensor cee::SymmetricTensor::operator- ( const SymmetricTensor rhs) const

Returns a tensor that is this tensor subtracted with rhs.

cee::SymmetricTensor & cee::SymmetricTensor::operator-= ( const SymmetricTensor rhs)

Subtracts the given rhs tensor from this.

const SymmetricTensor cee::SymmetricTensor::operator/ ( double  scalar) const

Returns a tensor that is this vector divided by scalar.

SymmetricTensor & cee::SymmetricTensor::operator/= ( double  scalar)

Divides every component of this tensor by the given scalar.

SymmetricTensor & cee::SymmetricTensor::operator= ( const SymmetricTensor SymmetricTensor)

Assigns other to this tensor and returns a reference to this tensor.

bool cee::SymmetricTensor::operator== ( const SymmetricTensor rhs) const

Returns true if two tensors are equal, otherwise returns false.

An exact match is required xx() == rhs.xx(), etc.

const double * cee::SymmetricTensor::rawPointer ( ) const

Returns a pointer to the raw array storing the 6 components.

double cee::SymmetricTensor::secondPrincipalValue ( ) const

Returns second principal value.

cee::Vec3d cee::SymmetricTensor::secondPrincipalVector ( ) const

Returns second principal value.

void cee::SymmetricTensor::set ( double  xx,
double  yy,
double  zz,
double  xy,
double  yz,
double  zx 
)

Sets xx, yy, zz, xy, yz, zx values.

double cee::SymmetricTensor::thirdPrincipalValue ( ) const

Returns third principal value.

cee::Vec3d cee::SymmetricTensor::thirdPrincipalVector ( ) const

Returns third principal value.

double cee::SymmetricTensor::trace ( ) const

Returns trace.

double cee::SymmetricTensor::vonMises ( ) const

Returns vonMises value.

const double & cee::SymmetricTensor::xx ( ) const

XX element of the tensor.

double & cee::SymmetricTensor::xx ( )

XX element of the tensor.

const double & cee::SymmetricTensor::xy ( ) const

XY element of the tensor.

double & cee::SymmetricTensor::xy ( )

XY element of the tensor.

const double & cee::SymmetricTensor::yy ( ) const

YY element of the tensor.

double & cee::SymmetricTensor::yy ( )

YY element of the tensor.

const double & cee::SymmetricTensor::yz ( ) const

YZ element of the tensor.

double & cee::SymmetricTensor::yz ( )

YZ element of the tensor.

const double & cee::SymmetricTensor::zx ( ) const

ZX element of the tensor.

double & cee::SymmetricTensor::zx ( )

ZX element of the tensor.

const double & cee::SymmetricTensor::zz ( ) const

ZZ element of the tensor.

double & cee::SymmetricTensor::zz ( )

ZZ element of the tensor.