xc
Public Member Functions | Public Attributes | Friends | List of all members
XC::BJtensor Class Reference

Boris Jeremic tensor class. More...

#include <BJtensor.h>

Inheritance diagram for XC::BJtensor:
Inheritance graph
[legend]
Collaboration diagram for XC::BJtensor:
Collaboration graph
[legend]

Public Member Functions

 BJtensor (int rank_of_BJtensor=1, const double &initval=0)
 Default constructor. More...
 
 BJtensor (const std::vector< int > &pdim, const double *values)
 Constructor.
 
 BJtensor (const std::vector< int > &pdim, const std::vector< double > &values)
 Constructor.
 
 BJtensor (const std::vector< int > &pdim, const boost::python::list &l)
 Constructor.
 
 BJtensor (const boost::python::list &, const boost::python::list &)
 Constructor.
 
 BJtensor (const std::vector< int > &pdim, const double &initvalue)
 Constructor.
 
 BJtensor (const std::string &flag, const std::vector< int > &pdim)
 Constructor.
 
 BJtensor (const std::string &flag)
 Constructor.
 
 BJtensor (const BJtensor &x)
 
 BJtensor (const nDarray &x)
 
BJtensoroperator= (const BJtensor &rval)
 
BJtensoroperator+= (const BJtensor &rval)
 Addition.
 
BJtensoroperator-= (const BJtensor &rval)
 Subtraction.
 
BJtensoroperator*= (const double &rval)
 Scalar multiplication. Optimized by Zhao Oct2005.
 
BJtensor operator* (const double &rval) const
 
BJtensor operator* (const BJtensor &rval) const
 
BJtensor operator/ (const BJtensor &rval) const
 
BJtensor transpose0110 () const
 
BJtensor transposeoverbar () const
 
BJtensor transpose0101 () const
 
BJtensor transpose0111 () const
 
BJtensor transposeunderbar () const
 
BJtensor transpose1100 () const
 
BJtensor transpose0011 () const
 
BJtensor transpose1001 () const
 
BJtensor transpose11 () const
 
BJtensor symmetrize11 () const
 
double determinant (void) const
 
BJmatrix BJtensor2BJmatrix_1 (void) const
 
BJmatrix BJtensor2BJmatrix_2 (void) const
 
BJmatrix BJtensor2BJmatrix_3 (void) const
 
BJtensor inverse (void) const
 
BJtensor inverse_2 (void) const
 
const double & operator() (int first) const
 
double & operator() (int first)
 
const double & operator() (int first, int second) const
 
double & operator() (int first, int second)
 
const double & operator() (int first, int second, int third) const
 
double & operator() (int first, int second, int third)
 
const double & operator() (int first, int second, int third, int fourth) const
 
double & operator() (int first, int second, int third, int fourth)
 
const BJtensoroperator() (const std::string &) const
 This is supposed to fill in the string indices1 or the string indices2 strings in BJtensor object so that they can be checked for matching later on when operations like single contraction (.), double contraction (:), dyadic product (otimes) are performed the object can choose the right operator. More...
 
void null_indices (void) const
 
const std::string & f_indices1 (void) const
 
const std::string & f_indices2 (void) const
 
- Public Member Functions inherited from XC::nDarray
 nDarray (int rank_of_nDarray=1, const double &initval=0.0)
 Constructor.
 
 nDarray (const std::vector< int > &pdim, const double *values)
 Constructor.
 
 nDarray (const std::vector< int > &pdim, const std::vector< double > &)
 Constructor.
 
 nDarray (const std::vector< int > &pdim, const boost::python::list &)
 Constructor.
 
 nDarray (const boost::python::list &, const boost::python::list &)
 Constructor.
 
 nDarray (const std::vector< int > &pdim, double initvalue)
 
 nDarray (int rows, int cols, double *values)
 Constructor. Special case for BJmatrix and BJvector.
 
 nDarray (int rows, int cols, const std::vector< double > &values)
 Constructor. Special case for BJmatrix and BJvector.
 
 nDarray (int rows, int cols, const boost::python::list &)
 Constructor. Special case for BJmatrix and BJvector.
 
 nDarray (int rows, int cols, double initvalue)
 
 nDarray (const std::string &)
 
 nDarray (const std::string &flag, const std::vector< int > &pdim)
 create a unit XC::nDarray
 
void Initialize (const nDarray &from)
 
void Initialize_all (const nDarray &from)
 
void Reset_to (const double &value)
 Reset data to "value".
 
const double & operator() (int first) const
 
double & operator() (int first)
 
const double & operator() (int first, int second) const
 
double & operator() (int first, int second)
 
const double & operator() (int first, int second, int third) const
 
double & operator() (int first, int second, int third)
 
const double & operator() (int first, int second, int third, int fourth) const
 
double & operator() (int first, int second, int third, int fourth)
 
const double & val (int subscript,...) const
 
double & val (int subscript,...)
 
const double & val4 (int first, int second, int third, int fourth) const
 
double & val4 (int first, int second, int third, int fourth)
 
const double & cval (int subscript,...) const
 
nDarrayoperator+= (const nDarray &)
 nDarray addition
 
nDarrayoperator-= (const nDarray &)
 
nDarray operator+ (const double &rval)
 scalar addition
 
nDarray operator- (const double &rval)
 scalar subtraction
 
nDarrayoperator*= (const double &rval)
 scalar multiplication
 
nDarray operator* (const double &rval) const
 scalar multiplication
 
nDarray operator- ()
 unary minus
 
double sum (void) const
 
double trace (void) const
 
bool operator== (const nDarray &rval) const
 nDarray comparison returns true if they are equal.
 
nDarray eigenvalues (void)
 
nDarray eigenvectors (void)
 
double Frobenius_norm (void)
 
double General_norm (double p)
 
int rank (void) const
 
int dim (int which) const
 
void output (std::ostream &os) const
 Write this object to the argument stream.
 
void outputshort (std::ostream &os) const
 nDarray print function
 
void print (const std::string &name="t", const std::string &msg="Hi there#", std::ostream &os=std::cout) const
 nDarray print function
 
void printshort (std::ostream &os, const std::string &msg="Hi there#") const
 nDarray print function
 
void mathprint (std::ostream &os) const
 nDarray print function for mathematica
 
std::string toString (void) const
 

Public Attributes

std::string indices1
 character array of indices
 
std::string indices2
 

Friends

class stressstraintensor
 
class stresstensor
 
class straintensor
 

Additional Inherited Members

- Protected Member Functions inherited from XC::nDarray
const double * data (void) const
 
void set_dim (const std::vector< int > &)
 
const std::vector< int > & dim (void) const
 
void rank (int)
 
- Protected Attributes inherited from XC::nDarray
nDarray_rep pc_nDarray_rep
 

Detailed Description

Boris Jeremic tensor class.

Constructor & Destructor Documentation

◆ BJtensor()

XC::BJtensor::BJtensor ( int  rank_of_BJtensor = 1,
const double &  initval = 0 
)

Default constructor.

Member Function Documentation

◆ operator()()

const XC::BJtensor & XC::BJtensor::operator() ( const std::string &  indices_from_user) const

This is supposed to fill in the string indices1 or the string indices2 strings in BJtensor object so that they can be checked for matching later on when operations like single contraction (.), double contraction (:), dyadic product (otimes) are performed the object can choose the right operator.

Also when multiplying XC::BJtensor by itself ( like for example: D("ij")*D("kl") the other string indices2 is defined to take the other array of indices so that mulitplication will be O.K. Since only two BJtensors can be multiplied at the time ( binary operation ) only indices1 and indices2 are needed.

◆ symmetrize11()

XC::BJtensor XC::BJtensor::symmetrize11 ( ) const
  • symmterize function for 2th rank BJtensors:

◆ transpose0011()

XC::BJtensor XC::BJtensor::transpose0011 ( ) const
  • transpose function for 4th rank BJtensors:

◆ transpose0101()

XC::BJtensor XC::BJtensor::transpose0101 ( ) const
  • transpose function for 4th rank BJtensors:

◆ transpose0110()

XC::BJtensor XC::BJtensor::transpose0110 ( ) const
  • transpose function for 4th rank BJtensors:

◆ transpose0111()

XC::BJtensor XC::BJtensor::transpose0111 ( ) const
  • transpose function for 4th rank BJtensors:

◆ transpose1001()

XC::BJtensor XC::BJtensor::transpose1001 ( ) const
  • transpose function for 4th rank BJtensors:

◆ transpose11()

XC::BJtensor XC::BJtensor::transpose11 ( ) const
  • transpose function for 2th rank BJtensors:

◆ transpose1100()

XC::BJtensor XC::BJtensor::transpose1100 ( ) const
  • transpose function for 4th rank BJtensors:

◆ transposeoverbar()

XC::BJtensor XC::BJtensor::transposeoverbar ( ) const
  • transpose function for 4th rank BJtensors:

◆ transposeunderbar()

XC::BJtensor XC::BJtensor::transposeunderbar ( ) const
  • transpose function for 4th rank BJtensors:

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