Skip to content

vStrain

vStrain is a static storage container which stores a vector of six double values. It is used to store mechanical strains in Voigt notations, as a storage unit in Storage3D container.

The data inside of the vStrain container is manipulated using a number of dedicated methods:

Constructors

cpp
vStrain();

Default constructor, sets vector values to zero;

cpp
vStrain(const vStrain& vecinit);

Copy constructor, initializes the current vector with a copy of vecinit.

cpp
vStrain(std::array<double,6> vecinit);

Constructor, initializes the current vector with a copy of vecinit.

cpp
vStrain(std::initializer_list<double> vecinit);

Constructor, initializes the current vector using initializer list vecinit.

Access operators

cpp
double& operator[](const size_t i);
double const& operator[](const size_t i) const;

Return (const) reference to the element i.

cpp
double* data(void);
const double* data(void) const;

Returns (const) pointer to the first element of the vector.

Arithmetic and vector operations

cpp
vStrain operator*(const double m) const;

Returns current vector with all components multiplied by the factor m.

cpp
vStrain operator/(const double m) const;

Returns current vector with all components divided by the factor m.

cpp
vStrain operator+(const vStrain& rhs) const;

Returns the sum of two vectors.

cpp
vStrain operator-(const vStrain& rhs) const;

Returns the difference of two vectors.

cpp
vStrain& operator*=(const double m);

Multiplies all entries of the current vector by the factor m.

cpp
vStrain& operator/=(const double m);

Divides all entries of the current vector by the factor m.

cpp
vStrain& operator-=(const vStrain& rhs);

Subtracts vector rhs from the current vector.

cpp
vStrain& operator+=(const vStrain& rhs);

Adds vector rhs to the current vector.

cpp
vStrain& operator=(const vStrain& rhs);

Assigns the content of the vector rhs to the current vector.

cpp
double norm(double p);

Returns Frobenius norm of the strain tensor (internally considers full tensor notations).

cpp
double double_contract(const vStrain& Bstrain) const;

Returns double contraction of two strain tensors (internally considers full tensor notations).

cpp
double trace() const;

Returns the trace of the strain tensor (internally considers full strain tensors).

cpp
double determinant() const;

Returns the determinant of the strain tensor (internally considers full strain tensors).

cpp
vStrain rotated(const dMatrix3x3& RotationMatrix) const;

Returns the copy of the current strain vector rotated by RotationMatrix (internally considers full tensor notations).

cpp
vStrain& rotate(const dMatrix3x3& RotationMatrix);

Rotates the current strain vector by RotationMatrix (internally considers full tensor notations).

cpp
double PEEQ() const;

Returns equivalent plastic strain.

cpp
double max_abs(void) const;

Returns maximum strain component.

cpp
double get_tensor(const int i, const int j) const;

Returns strain tensor element using tensor indices i,j.

cpp
dMatrix3x3 tensor(void) const;

Returns strain tensor corresponding to the current Voigt vector.

Data manipulation methods

cpp
void set_to_zero(void);

Sets all entries to zero.

Container properties

cpp
constexpr size_t size(void) const;

Returns the size of the stored vector.

MPI communication methods

cpp
void pack(std::vector<double>& buffer);

The method, which packs the content of the current object into the MPI communication buffer.

cpp
void unpack(std::vector<double>& buffer, size_t& it);

The method, which unpacks (reads) the content of the current object from the MPI communication buffer. The existing data in the container is overwritten.

Read/write methods

cpp
std::string print(void) const;

Returns formatted string of the vector values ready to print to the terminal.

cpp
void read_ASCII(std::istream& inp);

Reads vector content from the input stream.

cpp
void write_ASCII(std::ostream& outp, const int precision = 16, const char sep = ' ') const;

Writes vector content in ASCII format with the specified precision using sep as entry separator into the output stream.

cpp
std::string get_output_string(const int precision = 16, const char sep = ' ') const;

Returns output string with vector content in ASCII format with the specified precision using sep as entry separator.

cpp
std::vector<double> get_vector() const;

Returns std::vector containing current vector components.

cpp
std::vector<float> get_vector_float() const;

Returns std::vector<float> containing current vector components rounded to float precision.

Released under the GNU GPLv3 License.