36 std::array<double,3>
myT;
50 FFaTensor2(
double t11,
double t22,
double t12 = 0.0) {
myT = {t11,t22,t12}; }
62 for (
int i=0; i<3; i++)
myT[i] += t.
myT[i];
69 for (
int i=0; i<3; i++)
myT[i] -= t.
myT[i];
76 for (
int i=0; i<3; i++)
myT[i] *= d;
83 for (
int i=0; i<3; i++)
myT[i] /= d;
88 const double*
getPt()
const {
return myT.data(); }
159 #ifdef FFA_INDEXCHECK
161 std::cerr <<
"FFaTensor2::operator[]: index i="<< i
162 <<
" is out of range [0,2]"<< std::endl;
169 #ifdef FFA_INDEXCHECK
171 std::cerr <<
"FFaTensor2::operator[]: index i="<< i
172 <<
" is out of range [0,2]"<< std::endl;
Class to represent a 1D simple tensor.
Definition: FFaTensor1.H:31
Class to represent a 2D symmetrical tensor.
Definition: FFaTensor2.H:35
FFaTensor2 & operator+=(const FFaTensor2 &t)
Addition operator.
Definition: FFaTensor2.H:60
FFaTensor2 & rotate(const double ex[2], const double ey[2])
Rotates the tensor to the given coordinate system axes.
Definition: FFaTensor2.C:53
FFaTensor2 & operator/=(double d)
Scaling operator (division by a scalar).
Definition: FFaTensor2.H:81
friend FFaTensor2 operator-(const FFaTensor2 &)
Unary negation operator.
FFaTensor2(double d=0.0)
Default constructor initializing the tensor to 0 (or given value).
Definition: FFaTensor2.H:40
const double & operator[](int i) const
Zero-based indexing operator (read only).
Definition: FFaTensor2.H:157
FFaTensor2 & operator*=(double d)
Scaling operator (multiplication by a scalar).
Definition: FFaTensor2.H:74
void prinsipalValues(double &max, double &min) const
Gets the principal values of the tensor.
Definition: FFaTensor2.C:130
friend FFaTensor2 operator+(const FFaTensor2 &, const FFaTensor2 &)
Global addition operator.
FFaTensor2(const double *t)
Constructor creating a tensor from a double array.
Definition: FFaTensor2.H:44
FFaTensor2(const float *t)
Constructor creating a tensor from a float array.
Definition: FFaTensor2.H:42
double maxShear() const
Returns the max shear value of the tensor.
Definition: FFaTensor2.C:70
friend std::istream & operator>>(std::istream &s, FFaTensor2 &b)
Reading operator.
const double * getPt() const
Accesses the internal array (read only).
Definition: FFaTensor2.H:88
double * getPt()
Accesses the internal array (for update).
Definition: FFaTensor2.H:90
friend std::ostream & operator<<(std::ostream &s, const FFaTensor2 &b)
Printing operator.
FFaTensor2 & operator=(const FFaTensor1 &t)
Overloaded assignment operator.
Definition: FFaTensor2.C:45
void fill(double d)
Initializes all tensor components to the given value.
Definition: FFaTensor2.H:53
double minPrinsipal() const
Returns the min principal value of the tensor.
Definition: FFaTensor2.C:116
double maxPrinsipal(bool absMax=false) const
Returns the max or absolute max principal value of the tensor.
Definition: FFaTensor2.C:102
friend FFaTensor2 operator/(const FFaTensor2 &, double)
Scaling operator, division by a scalar.
FFaTensor2 & operator-=(const FFaTensor2 &t)
Subtraction operator.
Definition: FFaTensor2.H:67
FFaTensor2(double t11, double t22, double t12=0.0)
Constructor creating a tensor from 2 or 3 component values.
Definition: FFaTensor2.H:50
friend bool operator==(const FFaTensor2 &, const FFaTensor2 &)
Equality operator,.
friend FFaTensor2 operator*(const FFaTensor2 &, double)
Scaling operator, multiplication of a tensor and a scalar.
double vonMises() const
Returns the von Mises value of the tensor.
Definition: FFaTensor2.C:60
std::array< double, 3 > myT
Tensor component values (11,22,12)
Definition: FFaTensor2.H:36
friend bool operator!=(const FFaTensor2 &, const FFaTensor2 &)
Inequality operator,.
Class to represent a 3D symmetric tensor.
Definition: FFaTensor3.H:35
Class for point transformations in 3D space.
Definition: FFaMat33.H:27
Class for positions in 3D space.
Definition: FFaMat34.H:32
Class for point vectors in 3D space.
Definition: FFaVec3.H:40
real(sp), dimension(:,:,:), pointer b
Definition: diffractionModule.f90:22