This class defines a Tensor that can change its shape. More...
#include <PiecewiseBilinear.h>
Public Member Functions | |
ColumnMajorMatrixTempl (const unsigned int rows=Moose::dim, const unsigned int cols=Moose::dim) | |
Constructor that sets an initial number of entries and shape. More... | |
ColumnMajorMatrixTempl (const ColumnMajorMatrixTempl< T > &rhs) | |
Copy Constructor defined in terms of operator=() More... | |
ColumnMajorMatrixTempl (const TypeTensor< T > &tensor) | |
Constructor that fills in the ColumnMajorMatrixTempl with values from a libMesh TypeTensor. More... | |
ColumnMajorMatrixTempl (const DenseMatrix< T > &rhs) | |
ColumnMajorMatrixTempl (const DenseVector< T > &rhs) | |
ColumnMajorMatrixTempl (const TypeVector< T > &col1, const TypeVector< T > &col2, const TypeVector< T > &col3) | |
Constructor that takes in 3 vectors and uses them to create columns. More... | |
unsigned int | numEntries () const |
The total number of entries in the Tensor. More... | |
void | reshape (const unsigned int rows, const unsigned int cols) |
Change the shape of the tensor. More... | |
T & | operator() (const unsigned int i, const unsigned int j=0) |
Get the i,j entry j defaults to zero so you can use it as a column vector. More... | |
T | operator() (const unsigned int i, const unsigned int j=0) const |
Get the i,j entry. More... | |
void | print () |
Print the tensor. More... | |
void | print_scientific (std::ostream &os) |
Prints to file. More... | |
void | fill (TypeTensor< T > &tensor) |
Fills the passed in tensor with the values from this tensor. More... | |
void | fill (DenseMatrix< T > &rhs) |
Fills the passed in dense matrix with the values from this tensor. More... | |
void | fill (DenseVector< T > &rhs) |
Fills the passed in dense vector with the values from this tensor. More... | |
ColumnMajorMatrixTempl< T > | transpose () const |
Returns a matrix that is the transpose of the matrix this was called on. More... | |
ColumnMajorMatrixTempl< T > | deviatoric () |
Returns a matrix that is the deviatoric of the matrix this was called on. More... | |
ColumnMajorMatrixTempl< T > | abs () |
Returns a matrix that is the absolute value of the matrix this was called on. More... | |
void | setDiag (T value) |
Set the value of each of the diagonals to the passed in value. More... | |
void | addDiag (T value) |
Add to each of the diagonals the passsed in value. More... | |
T | tr () const |
The trace of the CMM. More... | |
void | zero () |
Zero the matrix. More... | |
void | identity () |
Turn the matrix into an identity matrix. More... | |
T | doubleContraction (const ColumnMajorMatrixTempl< T > &rhs) const |
Double contraction of two matrices ie A : B = Sum(A_ab * B_ba) More... | |
T | norm () |
The Euclidean norm of the matrix. More... | |
unsigned int | n () const |
Returns the number of rows. More... | |
unsigned int | m () const |
Returns the number of columns. More... | |
void | eigen (ColumnMajorMatrixTempl< T > &eval, ColumnMajorMatrixTempl< T > &evec) const |
Returns eigen system solve for a symmetric real matrix. More... | |
void | eigenNonsym (ColumnMajorMatrixTempl< T > &eval_real, ColumnMajorMatrixTempl< T > &eval_img, ColumnMajorMatrixTempl< T > &evec_right, ColumnMajorMatrixTempl< T > &eve_left) const |
Returns eigen system solve for a non-symmetric real matrix. More... | |
void | exp (ColumnMajorMatrixTempl< T > &z) const |
Returns matrix that is the exponential of the matrix this was called on. More... | |
void | inverse (ColumnMajorMatrixTempl< T > &invA) const |
Returns inverse of a general matrix. More... | |
T * | rawData () |
Returns a reference to the raw data pointer. More... | |
const T * | rawData () const |
ColumnMajorMatrixTempl< T > | kronecker (const ColumnMajorMatrixTempl< T > &rhs) const |
Kronecker Product. More... | |
ColumnMajorMatrixTempl< T > & | operator= (const TypeTensor< T > &rhs) |
Sets the values in this tensor to the values on the RHS. More... | |
ColumnMajorMatrixTempl< T > & | operator= (const DenseMatrix< T > &rhs) |
Sets the values in this dense matrix to the values on the RHS. More... | |
ColumnMajorMatrixTempl< T > & | operator= (const DenseVector< T > &rhs) |
Sets the values in this dense vector to the values on the RHS. More... | |
template<typename T2 > | |
ColumnMajorMatrixTempl< T > & | operator= (const ColumnMajorMatrixTempl< T2 > &rhs) |
Sets the values in this tensor to the values on the RHS Will also reshape this tensor if necessary. More... | |
ColumnMajorMatrixTempl< T > & | operator= (const ColumnMajorMatrixTempl< T > &rhs)=default |
defaulted operator= More... | |
ColumnMajorMatrixTempl< T > | operator* (T scalar) const |
Scalar multiplication of the ColumnMajorMatrixTempl. More... | |
ColumnMajorMatrixTempl< T > | operator* (const TypeVector< T > &rhs) const |
Matrix Vector Multiplication of the libMesh TypeVector Type. More... | |
ColumnMajorMatrixTempl< T > | operator* (const ColumnMajorMatrixTempl< T > &rhs) const |
Matrix Vector Multiplication of the TypeTensor Product. More... | |
ColumnMajorMatrixTempl< T > | operator+ (const ColumnMajorMatrixTempl< T > &rhs) const |
Matrix Matrix Addition. More... | |
ColumnMajorMatrixTempl< T > | operator- (const ColumnMajorMatrixTempl< T > &rhs) const |
Matrix Matrix Subtraction. More... | |
ColumnMajorMatrixTempl< T > & | operator+= (const ColumnMajorMatrixTempl< T > &rhs) |
Matrix Matrix Addition plus assignment. More... | |
ColumnMajorMatrixTempl< T > & | operator+= (const TypeTensor< T > &rhs) |
Matrix Tensor Addition Plus Assignment. More... | |
ColumnMajorMatrixTempl< T > & | operator-= (const ColumnMajorMatrixTempl< T > &rhs) |
Matrix Matrix Subtraction plus assignment. More... | |
ColumnMajorMatrixTempl< T > | operator+ (T scalar) const |
Scalar addition. More... | |
ColumnMajorMatrixTempl< T > & | operator*= (T scalar) |
Scalar Multiplication plus assignment. More... | |
ColumnMajorMatrixTempl< T > & | operator/= (T scalar) |
Scalar Division plus assignment. More... | |
ColumnMajorMatrixTempl< T > & | operator+= (T scalar) |
Scalar Addition plus assignment. More... | |
void | checkSquareness () const |
Check if matrix is square. More... | |
void | checkShapeEquality (const ColumnMajorMatrixTempl< T > &rhs) const |
Check if matrices are of same shape. More... | |
bool | operator== (const ColumnMajorMatrixTempl< T > &rhs) const |
Equality operators. More... | |
bool | operator!= (const ColumnMajorMatrixTempl< T > &rhs) const |
template<> | |
void | eigen (ColumnMajorMatrixTempl< DualReal > &, ColumnMajorMatrixTempl< DualReal > &) const |
template<> | |
void | eigenNonsym (ColumnMajorMatrixTempl< DualReal > &, ColumnMajorMatrixTempl< DualReal > &, ColumnMajorMatrixTempl< DualReal > &, ColumnMajorMatrixTempl< DualReal > &) const |
template<> | |
void | inverse (ColumnMajorMatrixTempl< DualReal > &) const |
Protected Attributes | |
unsigned int | _n_rows |
unsigned int | _n_cols |
unsigned int | _n_entries |
std::vector< T > | _values |
Friends | |
template<typename T2 > | |
void | dataStore (std::ostream &, ColumnMajorMatrixTempl< T2 > &, void *) |
template<typename T2 > | |
void | dataLoad (std::istream &, ColumnMajorMatrixTempl< T2 > &, void *) |
This class defines a Tensor that can change its shape.
This means a 3x3x3x3 Tensor can be represented as a 9x9 or an 81x1. Further, the values of this tensor are COLUMN major ordered!
Definition at line 15 of file PiecewiseBilinear.h.
|
explicit |
Constructor that sets an initial number of entries and shape.
Defaults to creating the same size tensor as TensorValue
Definition at line 22 of file ColumnMajorMatrix.C.
ColumnMajorMatrixTempl< T >::ColumnMajorMatrixTempl | ( | const ColumnMajorMatrixTempl< T > & | rhs | ) |
|
explicit |
Constructor that fills in the ColumnMajorMatrixTempl with values from a libMesh TypeTensor.
Definition at line 36 of file ColumnMajorMatrix.C.
|
explicit |
Definition at line 48 of file ColumnMajorMatrix.C.
|
explicit |
Definition at line 55 of file ColumnMajorMatrix.C.
ColumnMajorMatrixTempl< T >::ColumnMajorMatrixTempl | ( | const TypeVector< T > & | col1, |
const TypeVector< T > & | col2, | ||
const TypeVector< T > & | col3 | ||
) |
Constructor that takes in 3 vectors and uses them to create columns.
Definition at line 62 of file ColumnMajorMatrix.C.
|
inline |
Returns a matrix that is the absolute value of the matrix this was called on.
Definition at line 312 of file ColumnMajorMatrix.C.
|
inline |
Add to each of the diagonals the passsed in value.
Definition at line 497 of file ColumnMajorMatrix.h.
void ColumnMajorMatrixTempl< T >::checkShapeEquality | ( | const ColumnMajorMatrixTempl< T > & | rhs | ) | const |
Check if matrices are of same shape.
Definition at line 296 of file ColumnMajorMatrix.C.
void ColumnMajorMatrixTempl< T >::checkSquareness | ( | ) | const |
Check if matrix is square.
Definition at line 288 of file ColumnMajorMatrix.C.
Referenced by ColumnMajorMatrixTempl< Real >::kronecker().
|
inline |
Returns a matrix that is the deviatoric of the matrix this was called on.
Definition at line 470 of file ColumnMajorMatrix.h.
|
inline |
Double contraction of two matrices ie A : B = Sum(A_ab * B_ba)
Definition at line 541 of file ColumnMajorMatrix.h.
void ColumnMajorMatrixTempl< DualReal >::eigen | ( | ColumnMajorMatrixTempl< DualReal > & | , |
ColumnMajorMatrixTempl< DualReal > & | |||
) | const |
Definition at line 168 of file ColumnMajorMatrix.C.
void ColumnMajorMatrixTempl< T >::eigen | ( | ColumnMajorMatrixTempl< T > & | eval, |
ColumnMajorMatrixTempl< T > & | evec | ||
) | const |
Returns eigen system solve for a symmetric real matrix.
Definition at line 137 of file ColumnMajorMatrix.C.
void ColumnMajorMatrixTempl< T >::eigenNonsym | ( | ColumnMajorMatrixTempl< T > & | eval_real, |
ColumnMajorMatrixTempl< T > & | eval_img, | ||
ColumnMajorMatrixTempl< T > & | evec_right, | ||
ColumnMajorMatrixTempl< T > & | eve_left | ||
) | const |
Returns eigen system solve for a non-symmetric real matrix.
Definition at line 176 of file ColumnMajorMatrix.C.
Referenced by ColumnMajorMatrixTempl< Real >::exp().
void ColumnMajorMatrixTempl< DualReal >::eigenNonsym | ( | ColumnMajorMatrixTempl< DualReal > & | , |
ColumnMajorMatrixTempl< DualReal > & | , | ||
ColumnMajorMatrixTempl< DualReal > & | , | ||
ColumnMajorMatrixTempl< DualReal > & | |||
) | const |
Definition at line 230 of file ColumnMajorMatrix.C.
void ColumnMajorMatrixTempl< T >::exp | ( | ColumnMajorMatrixTempl< T > & | z | ) | const |
Returns matrix that is the exponential of the matrix this was called on.
Definition at line 240 of file ColumnMajorMatrix.C.
|
inline |
Fills the passed in tensor with the values from this tensor.
Definition at line 418 of file ColumnMajorMatrix.h.
|
inline |
Fills the passed in dense matrix with the values from this tensor.
Definition at line 431 of file ColumnMajorMatrix.h.
|
inline |
Fills the passed in dense vector with the values from this tensor.
Definition at line 444 of file ColumnMajorMatrix.h.
|
inline |
Turn the matrix into an identity matrix.
Definition at line 529 of file ColumnMajorMatrix.h.
Referenced by ColumnMajorMatrixTempl< Real >::deviatoric().
void ColumnMajorMatrixTempl< T >::inverse | ( | ColumnMajorMatrixTempl< T > & | invA | ) | const |
Returns inverse of a general matrix.
Definition at line 262 of file ColumnMajorMatrix.C.
void ColumnMajorMatrixTempl< DualReal >::inverse | ( | ColumnMajorMatrixTempl< DualReal > & | ) | const |
Definition at line 305 of file ColumnMajorMatrix.C.
ColumnMajorMatrixTempl< T > ColumnMajorMatrixTempl< T >::kronecker | ( | const ColumnMajorMatrixTempl< T > & | rhs | ) | const |
Kronecker Product.
Definition at line 83 of file ColumnMajorMatrix.C.
|
inline |
Returns the number of columns.
Definition at line 563 of file ColumnMajorMatrix.h.
Referenced by ColumnMajorMatrixTempl< Real >::operator=(), RankTwoTensorTempl< Real >::operator=(), and MetaPhysicL::RawType< ColumnMajorMatrixTempl< T > >::value().
|
inline |
Returns the number of rows.
Definition at line 556 of file ColumnMajorMatrix.h.
Referenced by ColumnMajorMatrixTempl< Real >::operator=(), RankTwoTensorTempl< Real >::operator=(), and MetaPhysicL::RawType< ColumnMajorMatrixTempl< T > >::value().
|
inline |
The Euclidean norm of the matrix.
Definition at line 327 of file ColumnMajorMatrix.C.
|
inline |
The total number of entries in the Tensor.
i.e. cols * rows
Definition at line 341 of file ColumnMajorMatrix.h.
|
inline |
Definition at line 801 of file ColumnMajorMatrix.h.
|
inline |
Get the i,j entry j defaults to zero so you can use it as a column vector.
Definition at line 366 of file ColumnMajorMatrix.h.
|
inline |
Get the i,j entry.
j defaults to zero so you can use it as a column vector. This is the version used for a const ColumnMajorMatrixTempl.
Definition at line 377 of file ColumnMajorMatrix.h.
|
inline |
Scalar multiplication of the ColumnMajorMatrixTempl.
Definition at line 622 of file ColumnMajorMatrix.h.
|
inline |
Matrix Vector Multiplication of the libMesh TypeVector Type.
Definition at line 634 of file ColumnMajorMatrix.h.
|
inline |
Matrix Vector Multiplication of the TypeTensor Product.
Note that the Tensor type is treated as a single dimension Vector for this operation Matrix Matrix Multiplication
Definition at line 668 of file ColumnMajorMatrix.h.
|
inline |
|
inline |
Matrix Matrix Addition.
Definition at line 686 of file ColumnMajorMatrix.h.
|
inline |
Scalar addition.
Definition at line 753 of file ColumnMajorMatrix.h.
|
inline |
Matrix Matrix Addition plus assignment.
Note that this is faster than regular addition because the result doesn't have to get copied out
Definition at line 714 of file ColumnMajorMatrix.h.
|
inline |
Matrix Tensor Addition Plus Assignment.
Definition at line 726 of file ColumnMajorMatrix.h.
|
inline |
|
inline |
Matrix Matrix Subtraction.
Definition at line 700 of file ColumnMajorMatrix.h.
|
inline |
Matrix Matrix Subtraction plus assignment.
Note that this is faster than regular subtraction because the result doesn't have to get copied out
Definition at line 741 of file ColumnMajorMatrix.h.
|
inline |
|
inline |
Sets the values in this tensor to the values on the RHS.
Will also reshape this tensor if necessary.
Definition at line 584 of file ColumnMajorMatrix.h.
ColumnMajorMatrixTempl< T > & ColumnMajorMatrixTempl< T >::operator= | ( | const DenseMatrix< T > & | rhs | ) |
Sets the values in this dense matrix to the values on the RHS.
Will also reshape this tensor if necessary.
Definition at line 100 of file ColumnMajorMatrix.C.
ColumnMajorMatrixTempl< T > & ColumnMajorMatrixTempl< T >::operator= | ( | const DenseVector< T > & | rhs | ) |
Sets the values in this dense vector to the values on the RHS.
Will also reshape this tensor if necessary.
Definition at line 119 of file ColumnMajorMatrix.C.
|
inline |
Sets the values in this tensor to the values on the RHS Will also reshape this tensor if necessary.
Definition at line 609 of file ColumnMajorMatrix.h.
|
default |
defaulted operator=
|
inline |
|
inline |
Print the tensor.
Definition at line 388 of file ColumnMajorMatrix.h.
|
inline |
Prints to file.
Definition at line 403 of file ColumnMajorMatrix.h.
|
inline |
Returns a reference to the raw data pointer.
Definition at line 570 of file ColumnMajorMatrix.h.
Referenced by ColumnMajorMatrixTempl< Real >::eigen(), ColumnMajorMatrixTempl< Real >::eigenNonsym(), ColumnMajorMatrixTempl< Real >::inverse(), and RankTwoTensorTempl< Real >::operator=().
|
inline |
Definition at line 577 of file ColumnMajorMatrix.h.
|
inline |
Change the shape of the tensor.
Note that cols * rows should be equal to numEntries()!
Definition at line 348 of file ColumnMajorMatrix.h.
Referenced by PiecewiseBilinear::parse(), and PiecewiseBilinear::PiecewiseBilinear().
|
inline |
Set the value of each of the diagonals to the passed in value.
Definition at line 487 of file ColumnMajorMatrix.h.
|
inline |
The trace of the CMM.
Definition at line 507 of file ColumnMajorMatrix.h.
Referenced by ColumnMajorMatrixTempl< Real >::deviatoric().
|
inline |
Returns a matrix that is the transpose of the matrix this was called on.
Definition at line 455 of file ColumnMajorMatrix.h.
|
inline |
|
friend |
|
friend |
|
protected |
Definition at line 330 of file ColumnMajorMatrix.h.
Referenced by ColumnMajorMatrixTempl< Real >::checkShapeEquality(), ColumnMajorMatrixTempl< Real >::eigen(), ColumnMajorMatrixTempl< Real >::eigenNonsym(), ColumnMajorMatrixTempl< Real >::kronecker(), ColumnMajorMatrixTempl< Real >::operator*(), and ColumnMajorMatrixTempl< Real >::operator==().
|
protected |
Definition at line 330 of file ColumnMajorMatrix.h.
Referenced by ColumnMajorMatrixTempl< Real >::eigen(), ColumnMajorMatrixTempl< Real >::eigenNonsym(), and ColumnMajorMatrixTempl< Real >::operator==().
|
protected |
Definition at line 330 of file ColumnMajorMatrix.h.
Referenced by ColumnMajorMatrixTempl< Real >::checkShapeEquality(), ColumnMajorMatrixTempl< Real >::eigen(), ColumnMajorMatrixTempl< Real >::eigenNonsym(), ColumnMajorMatrixTempl< Real >::kronecker(), ColumnMajorMatrixTempl< Real >::operator*(), and ColumnMajorMatrixTempl< Real >::operator==().
|
protected |
Definition at line 331 of file ColumnMajorMatrix.h.
Referenced by ColumnMajorMatrixTempl< Real >::ColumnMajorMatrixTempl(), dataLoad(), dataStore(), ColumnMajorMatrixTempl< Real >::eigen(), ColumnMajorMatrixTempl< Real >::eigenNonsym(), ColumnMajorMatrixTempl< Real >::operator*(), ColumnMajorMatrixTempl< Real >::operator+(), ColumnMajorMatrixTempl< Real >::operator+=(), ColumnMajorMatrixTempl< Real >::operator-(), ColumnMajorMatrixTempl< Real >::operator-=(), and ColumnMajorMatrixTempl< Real >::operator==().