IFEM  90A354
Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
SymmTensor4 Class Reference

Simple class for representing a symmetric fourth-order tensor. More...

#include <Tensor4.h>

Inheritance diagram for SymmTensor4:
Inheritance graph
[legend]
Collaboration diagram for SymmTensor4:
Collaboration graph
[legend]

Public Member Functions

 SymmTensor4 (t_ind nsd=3, bool makeJ=false)
 The default constructor creates an identity tensor.
 
 SymmTensor4 (const std::vector< Real > &x, t_ind nsd=3)
 Constructor creating a tensor from a vector of components. More...
 
const Realoperator() (t_ind i, t_ind j, t_ind d, t_ind l) const
 Index-1 based component reference.
 
Realoperator() (t_ind i, t_ind j, t_ind k, t_ind l)
 Index-1 based component access.
 
- Public Member Functions inherited from Tensor4
 Tensor4 (t_ind nsd=3, Real scale=Real(1), bool makeJ=false)
 The default constructor creates a (scaled) identity tensor.
 
 Tensor4 (const std::vector< Real > &x, t_ind nsd=3)
 Constructor creating a tensor from a vector of components. More...
 
void zero ()
 Sets this to the 0-tensor.
 
 operator const std::vector< Real > & () const
 Type casting to a one-dimensional vector, for referencing.
 
 operator std::vector< Real > & ()
 Type casting to a one-dimensional vector, for assignment.
 
const Realptr () const
 Reference through a pointer.
 
const Realoperator() (t_ind i, t_ind j, t_ind d, t_ind l) const
 Index-1 based component reference.
 
Realoperator() (t_ind i, t_ind j, t_ind k, t_ind l)
 Index-1 based component access.
 
Tensor4operator= (const Tensor4 &T)
 Assignment operator.
 
Tensor4operator= (Real val)
 Overloaded assignment operator.
 
Tensor4operator+= (Real val)
 Incrementation operator.
 

Protected Member Functions

virtual void redim (t_ind nsd)
 Auxilliary method used by the constructors.
 
virtual std::ostream & print (std::ostream &os) const
 Prints out the tensor to an output stream.
 

Private Member Functions

t_ind index (t_ind i, t_ind j) const
 Returns a 0-based array index for the given row and column indices. More...
 

Additional Inherited Members

- Protected Types inherited from Tensor4
typedef unsigned short int t_ind
 Tensor index type (for convenience)
 
- Protected Attributes inherited from Tensor4
t_ind n
 Number of spatial dimensions for the tensor.
 
t_ind m
 Dimension of the matrix representation.
 
std::vector< Realv
 The actual tensor component values.
 

Detailed Description

Simple class for representing a symmetric fourth-order tensor.

Constructor & Destructor Documentation

◆ SymmTensor4()

SymmTensor4::SymmTensor4 ( const std::vector< Real > &  x,
t_ind  nsd = 3 
)

Constructor creating a tensor from a vector of components.

The provided vector is assumed to contain the components of the matrix representation of the tensor, stored in a one-dimensional array.

Member Function Documentation

◆ index()

t_ind SymmTensor4::index ( t_ind  i,
t_ind  j 
) const
inlineprivate

Returns a 0-based array index for the given row and column indices.

Symmetric second-order tensors in 3D are assumed stored with the following order in a one-dimensional array: s11, s22, s33, s12, s23, s13.

References Tensor4::n.

Referenced by operator()(), and print().


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