28 typedef unsigned short int t_ind;
38 virtual std::ostream&
print(std::ostream& os)
const;
44 return i-1 +
n*(j-1 +
n*(k-1 +
n*(l-1)));
59 operator const std::vector<Real>&()
const {
return v; }
61 operator std::vector<Real>&() {
return v; }
98 virtual std::ostream&
print(std::ostream& os)
const;
113 if (i == j+1 || i+2 == j) std::swap(i,j);
#define Real
The floating point type to use.
Definition: ImmersedBoundaries.h:18
Simple class for representing a symmetric fourth-order tensor.
Definition: Tensor4.h:92
t_ind index(t_ind i, t_ind j) const
Returns a 0-based array index for the given row and column indices.
Definition: Tensor4.h:104
const Real & operator()(t_ind i, t_ind j, t_ind d, t_ind l) const
Index-1 based component reference.
Definition: Tensor4.C:142
SymmTensor4(t_ind nsd=3, bool makeJ=false)
The default constructor creates an identity tensor.
Definition: Tensor4.C:99
virtual void redim(t_ind nsd)
Auxilliary method used by the constructors.
Definition: Tensor4.C:130
virtual std::ostream & print(std::ostream &os) const
Prints out the tensor to an output stream.
Definition: Tensor4.C:117
Simple class for representing a non-symmetric fourth-order tensor.
Definition: Tensor4.h:26
Tensor4(t_ind nsd=3, Real scale=Real(1), bool makeJ=false)
The default constructor creates a (scaled) identity tensor.
Definition: Tensor4.C:18
Tensor4 & operator=(const Tensor4 &T)
Assignment operator.
Definition: Tensor4.C:69
const Real * ptr() const
Reference through a pointer.
Definition: Tensor4.h:64
friend std::ostream & operator<<(std::ostream &os, const Tensor4 &T)
Output stream operator.
Definition: Tensor4.h:80
void zero()
Sets this to the 0-tensor.
Definition: Tensor4.h:56
virtual void redim(t_ind nsd)
Auxilliary method used by the constructors.
Definition: Tensor4.h:35
t_ind n
Number of spatial dimensions for the tensor.
Definition: Tensor4.h:30
unsigned short int t_ind
Tensor index type (for convenience)
Definition: Tensor4.h:28
virtual std::ostream & print(std::ostream &os) const
Prints out the tensor to an output stream.
Definition: Tensor4.C:49
t_ind m
Dimension of the matrix representation.
Definition: Tensor4.h:31
Tensor4 & operator+=(Real val)
Incrementation operator.
Definition: Tensor4.C:90
std::vector< Real > v
The actual tensor component values.
Definition: Tensor4.h:32
t_ind index(t_ind i, t_ind j, t_ind k, t_ind l) const
Returns a 0-based array index for the given tensor indices.
Definition: Tensor4.h:42
const Real & operator()(t_ind i, t_ind j, t_ind d, t_ind l) const
Index-1 based component reference.
Definition: Tensor4.C:57