OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
oofem::StressStrainBaseVector Class Referenceabstract

Base class for stress/strain vector representations. More...

#include <stressstrainbasevector.h>

+ Inheritance diagram for oofem::StressStrainBaseVector:
+ Collaboration diagram for oofem::StressStrainBaseVector:

Public Member Functions

 StressStrainBaseVector (MaterialMode)
 Constructor. Creates zero value stress/strain vector for given material mode. More...
 
 StressStrainBaseVector (const FloatArray &, MaterialMode)
 Constructor. Creates stress/strain vector, values taken from given vector, mode is parameter. More...
 
 ~StressStrainBaseVector ()
 Destructor. More...
 
StressStrainBaseVectoroperator= (const StressStrainBaseVector &)
 Assignment operator. More...
 
MaterialMode giveStressStrainMode () const
 Returns the material mode of receiver. More...
 
void letStressStrainModeBe (const MaterialMode newMode)
 Changes the material mode of receiver. More...
 
void convertToFullForm (FloatArray &fullform) const
 Computes the full form of receiver. More...
 
void convertFromFullForm (const FloatArray &reducedform, MaterialMode mode)
 Assign to receiver the reduced form of given vector. More...
 
virtual void computePrincipalValues (FloatArray &answer) const =0
 Member function that computes principal values of receiver (strain vector). More...
 
virtual void computePrincipalValDir (FloatArray &answer, FloatMatrix &dir) const =0
 Computes principal values and directions of receiver vector. More...
 
void transformTo (StressStrainBaseVector &answer, const FloatMatrix &base, int transpose=0) const
 Transforms receiver vector into another coordinate system. More...
 
contextIOResultType storeYourself (DataStream &stream)
 
contextIOResultType restoreYourself (DataStream &stream)
 
double computeVolumetricPart () const
 Returns the volumetric part of the vector. More...
 
- Public Member Functions inherited from oofem::FloatArray
 FloatArray (int n=0)
 Constructor for sized array. Data is zeroed. More...
 
 FloatArray (double)=delete
 Disallow double parameter, which can otherwise give unexpected results. More...
 
 FloatArray (const FloatArray &src)
 Copy constructor. Creates the array from another array. More...
 
 FloatArray (FloatArray &&src)
 Move constructor. Creates the array from another array. More...
 
 FloatArray (std::initializer_list< double >list)
 Initializer list constructor. More...
 
virtual ~FloatArray ()
 Destructor. More...
 
FloatArrayoperator= (const FloatArray &src)
 Assignment operator. More...
 
FloatArrayoperator= (FloatArray &&src)
 Move operator. More...
 
FloatArrayoperator= (std::initializer_list< double >list)
 Assignment operator. More...
 
void push_back (const double &iVal)
 Add one element. More...
 
bool isFinite () const
 Returns true if no element is NAN or infinite. More...
 
double & at (int i)
 Coefficient access function. More...
 
double at (int i) const
 Coefficient access function. More...
 
double & operator() (int i)
 Coefficient access function. More...
 
double & operator[] (int i)
 
const double & operator() (int i) const
 Coefficient access function. More...
 
const double & operator[] (int i) const
 
void checkBounds (int i) const
 Checks size of receiver towards requested bounds. More...
 
void checkSizeTowards (const IntArray &loc)
 Checks size of receiver towards values stored in loc array. More...
 
void reserve (int s)
 Allocates enough size to fit s, and clears the array. More...
 
void resizeWithValues (int s, int allocChunk=0)
 Checks size of receiver towards requested bounds. More...
 
void resize (int s)
 Resizes receiver towards requested size. More...
 
void clear ()
 Clears receiver (zero size). More...
 
void hardResize (int s)
 Resizes the size of the receiver to requested bounds. More...
 
bool containsOnlyZeroes () const
 Returns nonzero if all coefficients of the receiver are 0, else returns zero. More...
 
int giveSize () const
 Returns the size of receiver. More...
 
bool isNotEmpty () const
 Returns true if receiver is not empty. More...
 
bool isEmpty () const
 Returns true if receiver is empty. More...
 
void negated ()
 Switches the sign of every coefficient of receiver. More...
 
virtual void printYourself () const
 Print receiver on stdout. More...
 
virtual void printYourself (const std::string &name) const
 Print receiver on stdout with custom name. More...
 
virtual void printYourselfToFile (const std::string filename, const bool showDimensions=true) const
 Print receiver to file. More...
 
virtual void pY () const
 Print receiver on stdout with high accuracy. More...
 
void zero ()
 Zeroes all coefficients of receiver. More...
 
void append (const FloatArray &a)
 Appends array to reciever. More...
 
void append (double a)
 Appends value to reciever. More...
 
void beProductOf (const FloatMatrix &aMatrix, const FloatArray &anArray)
 Receiver becomes the result of the product of aMatrix and anArray. More...
 
void beTProductOf (const FloatMatrix &aMatrix, const FloatArray &anArray)
 Receiver becomes the result of the product of aMatrix^T and anArray. More...
 
void beVectorProductOf (const FloatArray &v1, const FloatArray &v2)
 Computes vector product (or cross product) of vectors given as parameters, $ v_1 \times v_2 $, and stores the result into receiver. More...
 
void beScaled (double s, const FloatArray &b)
 Sets receiver to be $ a = s b $. More...
 
void add (const FloatArray &src)
 Adds array src to receiver. More...
 
void add (double factor, const FloatArray &b)
 Adds array times factor to receiver. More...
 
void plusProduct (const FloatMatrix &b, const FloatArray &s, double dV)
 Adds the product $ b^T . s dV $. More...
 
void add (double offset)
 Adds scalar to receiver. More...
 
void subtract (const FloatArray &src)
 Subtracts array src to receiver. More...
 
void times (double s)
 Multiplies receiver with scalar. More...
 
void beMaxOf (const FloatArray &a, const FloatArray &b)
 Sets receiver to maximum of a or b's respective elements. More...
 
void beMinOf (const FloatArray &a, const FloatArray &b)
 Sets receiver to be minimum of a or b's respective elements. More...
 
void beDifferenceOf (const FloatArray &a, const FloatArray &b)
 Sets receiver to be a - b. More...
 
void beDifferenceOf (const FloatArray &a, const FloatArray &b, int n)
 Sets receiver to be a - b, using only the first n entries. More...
 
void beSubArrayOf (const FloatArray &src, const IntArray &indx)
 Extract sub vector form src array and stores the result into receiver. More...
 
void addSubVector (const FloatArray &src, int si)
 Adds the given vector as sub-vector to receiver. More...
 
void assemble (const FloatArray &fe, const IntArray &loc)
 Assembles the array fe (typically, the load vector of a finite element) into the receiver, using loc as location array. More...
 
void assembleSquared (const FloatArray &fe, const IntArray &loc)
 Assembles the array fe with each component squared. More...
 
void copySubVector (const FloatArray &src, int si)
 Copy the given vector as sub-vector to receiver. More...
 
double distance (const FloatArray &x) const
 Computes the distance between position represented by receiver and position given as parameter. More...
 
double distance (const FloatArray *x) const
 
double distance (const FloatArray &iP1, const FloatArray &iP2, double &oXi, double &oXiUnbounded) const
 Computes distance between the position represented by the reciever and a line segment represented by it's start point iP1 and it's end point iP2. More...
 
double distance_square (const FloatArray &iP1, const FloatArray &iP2, double &oXi, double &oXiUnbounded) const
 
double distance_square (const FloatArray &x) const
 Computes the square of distance between position represented by receiver and position given as parameter. More...
 
int giveIndexMinElem (void)
 Returns index (between 1 and Size) of minimum element in the array. More...
 
int giveIndexMaxElem (void)
 Returns index (between 1 and Size) of maximum element in the array. More...
 
double dotProduct (const FloatArray &x) const
 Computes the dot product (or inner product) of receiver and argument. More...
 
double dotProduct (const FloatArray &x, int size) const
 Computes the dot product (or inner product) of receiver and argument. More...
 
double normalize ()
 Normalizes receiver. More...
 
double computeNorm () const
 Computes the norm (or length) of the vector. More...
 
double computeSquaredNorm () const
 Computes the square of the norm. More...
 
double sum () const
 Computes the sum of receiver values. More...
 
double product () const
 Computes the product of receiver values. More...
 
void rotatedWith (FloatMatrix &r, char mode)
 Returns the receiver a rotated according the change-of-base matrix r. More...
 
const double * givePointer () const
 Gives the pointer to the raw data, breaking encapsulation. More...
 
double * givePointer ()
 
void beVectorForm (const FloatMatrix &aMatrix)
 Reciever will be a vector with 9 components formed from a 3x3 matrix. More...
 
void beSymVectorForm (const FloatMatrix &aMatrix)
 Reciever will be a vector with 6 components formed from a 3x3 matrix. More...
 
void beSymVectorFormOfStrain (const FloatMatrix &aMatrix)
 
void changeComponentOrder ()
 Swaps the fourth and sixth index in the array. More...
 
void power (const double exponent)
 Raise each element to its power. More...
 
void beColumnOf (const FloatMatrix &mat, int col)
 Reciever will be set to a given column in a matrix. More...
 
contextIOResultType storeYourself (DataStream &stream) const
 
contextIOResultType restoreYourself (DataStream &stream)
 
int givePackSize (DataStream &buff) const
 
std::vector< double >::iterator begin ()
 
std::vector< double >::iterator end ()
 
std::vector< double >::const_iterator begin () const
 
std::vector< double >::const_iterator end () const
 
FloatArrayoperator= (const double &)
 Assignment of scalar to all components of receiver. More...
 

Protected Member Functions

virtual void giveTranformationMtrx (FloatMatrix &answer, const FloatMatrix &base, int transpose=0) const =0
 Computes 3d transformation matrix from standard vector transformation matrix. More...
 

Protected Attributes

StressStrainMatMode mode
 Stress strain mode. More...
 
- Protected Attributes inherited from oofem::FloatArray
std::vector< double > values
 Stored values. More...
 

Detailed Description

Base class for stress/strain vector representations.

It is derived from FloatArray class, which is used to store the stress/strain vector components in reduced form. Additional attribute is introduced to keep the stress/strain mode. This allows to implement various stress/strain vector methods regarding the correct stress/strain mode without doing so in full form. The full form includes all components, even if they are zero due to stress/strain mode nature, but in the reduced format, only relevant nonzero components are stored. If in particular mode particular stress component is zero, the corresponding strain is not computed and not stored in reduced vector, and in full vector there is zero value on corresponding position. On the other hand, if zero strain component is imposed this condition must be taken into account in geometrical relations (at element level), and corresponding component are included stress/strain reduced vectors. Methods for converting vectors between reduced and full format are provided.

Definition at line 56 of file stressstrainbasevector.h.

Constructor & Destructor Documentation

oofem::StressStrainBaseVector::StressStrainBaseVector ( MaterialMode  m)

Constructor. Creates zero value stress/strain vector for given material mode.

Definition at line 45 of file stressstrainbasevector.C.

References oofem::StructuralMaterial::giveSizeOfVoigtSymVector(), mode, oofem::FloatArray::resize(), and oofem::FloatArray::zero().

oofem::StressStrainBaseVector::StressStrainBaseVector ( const FloatArray src,
MaterialMode  m 
)

Constructor. Creates stress/strain vector, values taken from given vector, mode is parameter.

Definition at line 52 of file stressstrainbasevector.C.

References oofem::__MaterialModeToString(), oofem::FloatArray::giveSize(), oofem::StructuralMaterial::giveSizeOfVoigtSymVector(), mode, and OOFEM_ERROR.

oofem::StressStrainBaseVector::~StressStrainBaseVector ( )
inline

Destructor.

Definition at line 68 of file stressstrainbasevector.h.

Member Function Documentation

virtual void oofem::StressStrainBaseVector::computePrincipalValDir ( FloatArray answer,
FloatMatrix dir 
) const
pure virtual

Computes principal values and directions of receiver vector.

Parameters
answerComputed principal values (sorted).
dirPrincipal directions (stored column wise).

Implemented in oofem::StressVector, and oofem::StrainVector.

virtual void oofem::StressStrainBaseVector::computePrincipalValues ( FloatArray answer) const
pure virtual

Member function that computes principal values of receiver (strain vector).

Parameters
answerComputed principal values (sorted).

Implemented in oofem::StressVector, and oofem::StrainVector.

double oofem::StressStrainBaseVector::computeVolumetricPart ( ) const

Returns the volumetric part of the vector.

Definition at line 187 of file stressstrainbasevector.C.

References oofem::FloatArray::at(), giveStressStrainMode(), and OOFEM_ERROR.

void oofem::StressStrainBaseVector::convertFromFullForm ( const FloatArray reducedform,
MaterialMode  mode 
)
void oofem::StressStrainBaseVector::convertToFullForm ( FloatArray fullform) const
virtual void oofem::StressStrainBaseVector::giveTranformationMtrx ( FloatMatrix answer,
const FloatMatrix base,
int  transpose = 0 
) const
protectedpure virtual

Computes 3d transformation matrix from standard vector transformation matrix.

Parameters
answertransformation matrix for strain vector
base(3,3) matrix, where on each column are stored unit direction vectors of local coordinate axes to which we do transformation.
transposeIf transpose == 1 then transpose base matrix before transforming

Implemented in oofem::StressVector, and oofem::StrainVector.

Referenced by transformTo().

void oofem::StressStrainBaseVector::letStressStrainModeBe ( const MaterialMode  newMode)

Changes the material mode of receiver.

Parameters
newModeNew mode.

Definition at line 155 of file stressstrainbasevector.C.

References oofem::StructuralMaterial::giveSizeOfVoigtSymVector(), mode, oofem::FloatArray::resize(), and oofem::FloatArray::zero().

Referenced by oofem::StrainVector::applyDeviatoricElasticStiffness().

StressStrainBaseVector & oofem::StressStrainBaseVector::operator= ( const StressStrainBaseVector src)

Assignment operator.

Defines the assignment between two Stress Strain Base Vectors. The Assignment between FloatArray and StressStrainBaseVector is also possible, in this case the FloatArray assignment operator is used, where the operand is converted to FloatArray (mode is lost). The assignment from FloatArray to StressStrainBaseVector is not defined (needs material mode).

Definition at line 62 of file stressstrainbasevector.C.

References mode, and oofem::FloatArray::values.

contextIOResultType oofem::StressStrainBaseVector::restoreYourself ( DataStream stream)
contextIOResultType oofem::StressStrainBaseVector::storeYourself ( DataStream stream)
void oofem::StressStrainBaseVector::transformTo ( StressStrainBaseVector answer,
const FloatMatrix base,
int  transpose = 0 
) const

Transforms receiver vector into another coordinate system.

Parameters
answertransformed strain vector
baseTransformation matrix. There are on each column stored unit vectors of coordinate system (so called base vectors) to which we do transformation. These vectors must be expressed in the same coordinate system as source strainVector.
answerTransformed 3d strain.
baseNew base to express vector in.
transposeIf transpose == 1 then transpose base matrix before transforming.

Definition at line 163 of file stressstrainbasevector.C.

References oofem::FloatArray::beProductOf(), convertToFullForm(), giveStressStrainMode(), and giveTranformationMtrx().

Member Data Documentation


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

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:41 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011