My Project
Public Member Functions | Public Attributes | List of all members
MeshSTL Class Reference

Contains mesh data and has function to calculate and retrieve mesh properties. More...

#include <MeshSTL.h>

Public Member Functions

 MeshSTL (std::string fileName, Material mat)
 
void solveBendingMoments ()
 
void solveTorsion ()
 BBB Calculates the shear stress distribution under torsional load.
 
void solveShearX ()
 Calculates the shear stress distribution under shear force along x-axis.
 
void solveShearY ()
 Calculates the shear stress distribution under shear force along y-axis.
 
void applyShearFactor (MatrixXd &S, std::string)
 
void setMaterial (Material)
 
void calculateMeshProperties ()
 
void transformCoordinates ()
 
void calculateSecondAreaMoments ()
 
void calculateAnglePrincipalAxes ()
 
double getAnglePrincipalAxes ()
 
void calculateLineCenterNodes ()
 
void solveEquations (SparseMatrix< double > &A, MatrixXd &b, MatrixXd &C)
 
void constrainDOF (SparseMatrix< double > &K, MatrixXd &R, int nNumber)
 
void constrainNodeNearCenter (SparseMatrix< double > &K, MatrixXd &R)
 
Node getNodeAt (int n)
 
ElementgetElementAt (int e)
 
int getNumNodes ()
 
int getNumElements ()
 
void SetSmoothNodalTau ()
 

Public Attributes

EIGEN_MAKE_ALIGNED_OPERATOR_NEW double Ax
 < Neccessary for std::vector of objects with Eigen members. More...
 
double Ay
 Area centre for mesh in Y-direction.
 
double totalArea
 Total area of the mesh.
 
double areaStiffness
 Sum of all Ai * Ei.
 
double Ix
 Second area moment for mesh in X-direction.
 
double Iy
 Second area moment for mesh in Y-direction.
 
double Ixy
 Second area moment for mesh in XY-direction.
 
double Imax
 Maximum second area moment for mesh along principal axis.
 
double anglePrincipalAxes
 Stores the angle of the principal axes in degrees.
 
double anglePrincipalAxesRad
 Stores the angle of the principal axes in radians.
 
std::vector< Element * > elements
 List of all elements in mesh.
 
std::vector< Nodenodes
 List of all nodes in mesh.
 
MatrixXd sigmaAxial
 Stores nodal stress from axial force.
 
MatrixXd sigmaOfX
 Stores all nodal stresses from moment about x-axis.
 
MatrixXd sigmaOfY
 Stores all nodal stresses from moment about y-axis. More...
 
std::string shearType
 
MatrixXd tauXZtorsion
 Stores nodal \( \tau_{xz} \) from torsional load.
 
MatrixXd tauYZtorsion
 Stores nodal \( \tau_{yz} \) from torsional load.
 
MatrixXd tauRtorsion
 Stores nodal \( \tau_{R} \) from torsional load.
 
MatrixXd tauXZshearX
 Stores nodal \( \tau_{xz} \) from shear load in x-direction.
 
MatrixXd tauYZshearX
 Stores nodal \( \tau_{yz} \) from shear load in x-direction.
 
MatrixXd tauRshearX
 Stores nodal \( \tau_{R} \) from shear load in x-direction.
 
MatrixXd tauXZshearY
 Stores nodal \( \tau_{xz} \) from shear load in y-direction.
 
MatrixXd tauYZshearY
 Stores nodal \( \tau_{yz} \) from shear load in y-direction.
 
MatrixXd tauRshearY
 Stores nodal \( \tau_{R} \) from shear load in y-direction.
 
MatrixXd torsion_displacement
 
MatrixXd torsion_load
 
MatrixXd shearX_load
 
MatrixXd shearX_displacement
 
MatrixXd shearY_load
 
MatrixXd shearY_displacement
 
MatrixXd printTemp1
 Used in testing to store desired value for printing.
 
MatrixXd printTemp2
 Used in testing to store desired value for printing.
 

Detailed Description

Contains mesh data and has function to calculate and retrieve mesh properties.

Constructor & Destructor Documentation

MeshSTL::MeshSTL ( std::string  fileName,
Material  mat 
)

Constructor computes the area, areacentre and the stiffness matrix

Parameters
elementsList of all elements
nodesList of all nodes

Member Function Documentation

void MeshSTL::calculateAnglePrincipalAxes ( )

Calculates the angle of one of the inertial axis.
\( t = \frac{-2I_{xy}}{I_x - I_y} \)
\( \alpha = \frac{1}{2}\arctan(t)\frac{180}{\pi} \)

Returns
Angle of one inertial axis.
void MeshSTL::calculateMeshProperties ( )

Function run by constructor. It runs through all elements calculating element areas and element centres for each element.
It also calculates total area of mesh, and area centre of the mesh using
\( A_x = \sum{( \frac{dx_e*a_e}{A}) } \) and \( A_y = \sum{ (\frac{dy_e*a_e}{A}) } \)

void MeshSTL::calculateSecondAreaMoments ( )

Loops through all elements calculating the distance between mesh- and element area centres, and calculates the second moment of inertia for the mesh's x-, y- and xy-axis.

void MeshSTL::setMaterial ( Material  mat)

Adds the same material to all the elements in the mesh

void MeshSTL::solveBendingMoments ( )

Calculates the resulting stresses from unit bending moments
\( \sigma = dy / I_x \) \( \sigma = dx / I_y \)

void MeshSTL::solveEquations ( SparseMatrix< double > &  A,
MatrixXd &  b,
MatrixXd &  C 
)

Solves the eq
\( Kr = R \),
where K is the stiffness matrix, and r and R are vectors with displacements and loads in each node.

void MeshSTL::transformCoordinates ( )

Transforms coordinates for computation purposes.
\( x' = x-A_xcos(\alpha) + y-A_ysin(\alpha) \)
\( x' = y-A_ycos(\alpha) - x-A_xsin(\alpha) \)

Member Data Documentation

EIGEN_MAKE_ALIGNED_OPERATOR_NEW double MeshSTL::Ax

< Neccessary for std::vector of objects with Eigen members.

Area centre for mesh in X-direction

MatrixXd MeshSTL::sigmaOfY

Stores all nodal stresses from moment about y-axis.

AAA Calculates the shear stress distribution under torsional load.


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