chrono::fea::ChElementBeamANCF Class Reference

## Description

ANCF beam element with 3 nodes.

This class implements a continuum-based elastic force formulation.

The node numbering, as follows: v ^ | A o--—+--—o--—+--—o B -> u /C w where C is the third and central node.

#include <ChElementBeamANCF.h>

Inheritance diagram for chrono::fea::ChElementBeamANCF:
Collaboration diagram for chrono::fea::ChElementBeamANCF:

## Public Types

enum  StrainFormulation { CMPoisson, CMNoPoisson }
Poisson effect selection. More...

## Public Member Functions

virtual int GetNnodes () override
Get the number of nodes used by this element.

virtual int GetNdofs () override
Get the number of coordinates in the field used by the referenced nodes.

virtual int GetNodeNdofs (int n) override
Get the number of coordinates from the n-th node used by this element.

void SetNodes (std::shared_ptr< ChNodeFEAxyzDD > nodeA, std::shared_ptr< ChNodeFEAxyzDD > nodeB, std::shared_ptr< ChNodeFEAxyzDD > nodeC)
Specify the nodes of this element.

void SetDimensions (double lenX, double beam_h, double beam_w)
Specify the element dimensions.

void SetMaterial (std::shared_ptr< ChMaterialBeamANCF > beam_mat)
Specify the element material.

virtual std::shared_ptr< ChNodeFEAbaseGetNodeN (int n) override
Access the n-th node of this element.

std::shared_ptr< ChNodeFEAxyzDDGetNodeA () const
Get a handle to the first node of this element.

std::shared_ptr< ChNodeFEAxyzDDGetNodeB () const
Get a handle to the second node of this element.

std::shared_ptr< ChNodeFEAxyzDDGetNodeC () const
Get a handle to the third node of this element.

std::shared_ptr< ChMaterialBeamANCFGetMaterial () const
Return the material.

void SetGravityOn (bool val)
Turn gravity on/off.

Set the structural damping.

double GetLengthX () const
Get the element length in the X direction.

double GetThicknessY ()
Get the total thickness of the shell element.

double GetThicknessZ ()
Get the total thickness of the shell element.

void ShapeFunctions (ChMatrix<> &N, double x, double y, double z)
Fills the N shape function matrix. More...

void ShapeFunctionsDerivativeX (ChMatrix<> &Nx, double x, double y, double z)
Fills the Nx shape function derivative matrix with respect to X. More...

void ShapeFunctionsDerivativeY (ChMatrix<> &Ny, double x, double y, double z)
Fills the Ny shape function derivative matrix with respect to Y. More...

void ShapeFunctionsDerivativeZ (ChMatrix<> &Nz, double x, double y, double z)
Fills the Nz shape function derivative matrix with respect to Z. More...

ChVector EvaluateBeamSectionStrains ()
Return a vector with three strain components. More...

virtual void GetStateBlock (ChMatrixDynamic<> &mD) override
Fills the D vector (column matrix) with the current field values at the nodes of the element, with proper ordering. More...

virtual void ComputeKRMmatricesGlobal (ChMatrix<> &H, double Kfactor, double Rfactor=0, double Mfactor=0) override
Sets H as the stiffness matrix K, scaled by Kfactor. More...

virtual void ComputeMmatrixGlobal (ChMatrix<> &M) override
Returns the global mass matrix. More...

virtual void ComputeNodalMass () override
Add contribution of element inertia to total nodal masses. More...

virtual void ComputeInternalForces (ChMatrixDynamic<> &Fi) override
Computes the internal forces. More...

virtual void SetupInitial (ChSystem *system) override
Initial setup. More...

virtual void Update () override
Update the state of this element.

virtual void EvaluateSectionStrain (const double, chrono::ChVector< double > &) override

virtual void EvaluateSectionForceTorque (const double, chrono::ChVector< double > &, chrono::ChVector< double > &) override

virtual void EvaluateSectionDisplacement (const double eta, ChVector<> &u_displ, ChVector<> &u_rotaz) override
Gets the xyz displacement of a point on the beam line, and the rotation RxRyRz of section plane, at abscissa 'eta'. More...

virtual void EvaluateSectionFrame (const double eta, ChVector<> &point, ChQuaternion<> &rot) override
Gets the absolute xyz position of a point on the beam line, and the absolute rotation of section plane, at abscissa 'eta'. More...

void ComputeInternalJacobians (double Kfactor, double Rfactor)
Compute Jacobians of the internal forces. More...

void ComputeMassMatrix ()
Compute the mass matrix of the element. More...

void ComputeGravityForce (const ChVector<> &g_acc)
Compute the gravitational forces.

double Calc_detJ0 (double x, double y, double z)

double Calc_detJ0 (double x, double y, double z, ChMatrixNM< double, 1, 9 > &Nx, ChMatrixNM< double, 1, 9 > &Ny, ChMatrixNM< double, 1, 9 > &Nz, ChMatrixNM< double, 1, 3 > &Nx_d0, ChMatrixNM< double, 1, 3 > &Ny_d0, ChMatrixNM< double, 1, 3 > &Nz_d0)

void CalcCoordMatrix (ChMatrixNM< double, 9, 3 > &d)

void CalcCoordDerivMatrix (ChMatrixNM< double, 27, 1 > &dt)

void SetStrainFormulation (StrainFormulation model)
Set the strain formulation.

StrainFormulation GetStrainFormulation () const
Get the strain formulation.

Gets the number of DOFs affected by this element (position part).

Gets the number of DOFs affected by this element (velocity part).

virtual void LoadableGetStateBlock_x (int block_offset, ChState &mD) override
Gets all the DOFs packed in a single vector (position part).

virtual void LoadableGetStateBlock_w (int block_offset, ChStateDelta &mD) override
Gets all the DOFs packed in a single vector (velocity part).

virtual void LoadableStateIncrement (const unsigned int off_x, ChState &x_new, const ChState &x, const unsigned int off_v, const ChStateDelta &Dv) override
Increment all DOFs using a delta.

virtual int Get_field_ncoords () override
Number of coordinates in the interpolated field, ex=3 for a tetrahedron finite element or a cable, = 1 for a thermal problem, etc. More...

virtual int GetSubBlocks () override
Tell the number of DOFs blocks (ex. =1 for a body, =4 for a tetrahedron, etc.)

virtual unsigned int GetSubBlockOffset (int nblock) override
Get the offset of the i-th sub-block of DOFs in global vector.

virtual unsigned int GetSubBlockSize (int nblock) override
Get the size of the i-th sub-block of DOFs in global vector.

void EvaluateSectionVelNorm (double U, ChVector<> &Result)

virtual void LoadableGetVariables (std::vector< ChVariables * > &mvars) override
Get the pointers to the contained ChVariables, appending to the mvars vector.

virtual void ComputeNF (const double U, ChVectorDynamic<> &Qi, double &detJ, const ChVectorDynamic<> &F, ChVectorDynamic<> *state_x, ChVectorDynamic<> *state_w) override
Evaluate N'*F , where N is some type of shape function evaluated at U,V coordinates of the surface, each ranging in -1..+1 F is a load, N'*F is the resulting generalized load Returns also det[J] with J=[dx/du,..], that might be useful in gauss quadrature. More...

virtual void ComputeNF (const double U, const double V, const double W, ChVectorDynamic<> &Qi, double &detJ, const ChVectorDynamic<> &F, ChVectorDynamic<> *state_x, ChVectorDynamic<> *state_w) override
Evaluate N'*F , where N is some type of shape function evaluated at U,V,W coordinates of the volume, each ranging in -1..+1 F is a load, N'*F is the resulting generalized load Returns also det[J] with J=[dx/du,..], that might be useful in gauss quadrature. More...

virtual double GetDensity () override
This is needed so that it can be accessed by ChLoaderVolumeGravity. More...

ChVector ComputeTangent (const double U)
Gets the tangent to the centerline at the parametric coordinate U. More...

Public Member Functions inherited from chrono::fea::ChElementBeam
virtual void EvaluateSectionForceTorque (const double eta, ChVector<> &Fforce, ChVector<> &Mtorque)=0
Gets the force (traction x, shear y, shear z) and the torque (torsion on x, bending on y, on bending on z) at a section along the beam line, at abscissa 'eta'. More...

virtual void EvaluateSectionStrain (const double eta, ChVector<> &StrainV)=0
Gets the axial and bending strain of the ANCF "cable" element.

double GetMass ()
The full mass of the beam, (with const. section, density, etc.)

double GetRestLength ()
The rest length of the bar.

void SetRestLength (double ml)
Set the rest length of the bar (usually this should be automatically done when SetupInitial is called on beams element, given the current state, but one might need to override this, ex for precompressed beams etc). More...

Public Member Functions inherited from chrono::fea::ChElementGeneric
ChKblockGenericKstiffness ()
Access the proxy to stiffness, for sparse solver.

virtual void EleIntLoadResidual_F (ChVectorDynamic<> &R, const double c) override
(This is a default (a bit unoptimal) book keeping so that in children classes you can avoid implementing this EleIntLoadResidual_F function, unless you need faster code)

virtual void EleIntLoadResidual_Mv (ChVectorDynamic<> &R, const ChVectorDynamic<> &w, const double c) override
(This is a default (VERY UNOPTIMAL) book keeping so that in children classes you can avoid implementing this EleIntLoadResidual_Mv function, unless you need faster code.)

virtual void InjectKRMmatrices (ChSystemDescriptor &mdescriptor) override
Tell to a system descriptor that there are item(s) of type ChKblock in this object (for further passing it to a solver)

virtual void KRMmatricesLoad (double Kfactor, double Rfactor, double Mfactor) override
Adds the current stiffness K and damping R and mass M matrices in encapsulated ChKblock item(s), if any. More...

virtual void VariablesFbLoadInternalForces (double factor=1.) override
Adds the internal forces, expressed as nodal forces, into the encapsulated ChVariables, in the 'fb' part: qf+=forces*factor (This is a default (a bit unoptimal) book keeping so that in children classes you can avoid implementing this VariablesFbLoadInternalForces function, unless you need faster code)

virtual void VariablesFbIncrementMq () override
Adds M*q (internal masses multiplied current 'qb') to Fb, ex. More...

Public Member Functions inherited from chrono::fea::ChElementBase
virtual void EleDoIntegration ()
This is optionally implemented if there is some internal state that requires integration. More...

Public Member Functions inherited from chrono::ChLoadableUVW
virtual bool IsTetrahedronIntegrationNeeded ()
If true, use quadrature over u,v,w in [0..1] range as tetrahedron volumetric coords, with z=1-u-v-w otherwise use quadrature over u,v,w in [-1..+1] as box isoparametric coords. More...

## Friends

class MyMassBeam

class MyGravityBeam

class MyForceBeam

class MyForceBeam_Nu

class MyJacobianBeam

class MyJacobianBeam_Nu

Protected Attributes inherited from chrono::fea::ChElementBeam
double mass

double length

Protected Attributes inherited from chrono::fea::ChElementGeneric
ChKblockGeneric Kmatr

## Member Function Documentation

 void chrono::fea::ChElementBeamANCF::ComputeInternalForces ( ChMatrixDynamic<> & Fi )
overridevirtual

Computes the internal forces.

(E.g. the actual position of nodes is not in relaxed reference position) and set values in the Fi vector.

Implements chrono::fea::ChElementBase.

 void chrono::fea::ChElementBeamANCF::ComputeInternalJacobians ( double Kfactor, double Rfactor )

Compute Jacobians of the internal forces.

This function calculates a linear combination of the stiffness (K) and damping (R) matrices, J = Kfactor * K + Rfactor * R for given coefficients Kfactor and Rfactor. This Jacobian will be further combined with the global mass matrix M and included in the global stiffness matrix H in the function ComputeKRMmatricesGlobal().

 void chrono::fea::ChElementBeamANCF::ComputeKRMmatricesGlobal ( ChMatrix<> & H, double Kfactor, double Rfactor = 0, double Mfactor = 0 )
overridevirtual

Sets H as the stiffness matrix K, scaled by Kfactor.

Optionally, also superimposes global damping matrix R, scaled by Rfactor, and mass matrix M, scaled by Mfactor. Matrices are expressed in global reference. Corotational elements can take the local Kl & Rl matrices and rotate them. CHLDREN CLASSES MUST IMPLEMENT THIS!!!

Implements chrono::fea::ChElementBase.

 void chrono::fea::ChElementBeamANCF::ComputeMassMatrix ( )

Compute the mass matrix of the element.

Note: in this 'basic' implementation, constant section and constant material are assumed

 void chrono::fea::ChElementBeamANCF::ComputeMmatrixGlobal ( ChMatrix<> & M )
overridevirtual

Returns the global mass matrix.

This is the default implementation, POTENTIALLY VERY INEFFICIENT. Children classes may need to override this with a more efficient version.

Reimplemented from chrono::fea::ChElementGeneric.

 void chrono::fea::ChElementBeamANCF::ComputeNF ( const double U, ChVectorDynamic<> & Qi, double & detJ, const ChVectorDynamic<> & F, ChVectorDynamic<> * state_x, ChVectorDynamic<> * state_w )
overridevirtual

Evaluate N'*F , where N is some type of shape function evaluated at U,V coordinates of the surface, each ranging in -1..+1 F is a load, N'*F is the resulting generalized load Returns also det[J] with J=[dx/du,..], that might be useful in gauss quadrature.

Parameters
 U parametric coordinate in surface Qi Return result of Q = N'*F here detJ Return det[J] here F Input F vector, size is =n. field coords. state_x if != 0, update state (pos. part) to this, then evaluate state_w if != 0, update state (speed part) to this, then evaluate

 void chrono::fea::ChElementBeamANCF::ComputeNF ( const double U, const double V, const double W, ChVectorDynamic<> & Qi, double & detJ, const ChVectorDynamic<> & F, ChVectorDynamic<> * state_x, ChVectorDynamic<> * state_w )
overridevirtual

Evaluate N'*F , where N is some type of shape function evaluated at U,V,W coordinates of the volume, each ranging in -1..+1 F is a load, N'*F is the resulting generalized load Returns also det[J] with J=[dx/du,..], that might be useful in gauss quadrature.

Parameters
 U parametric coordinate in volume V parametric coordinate in volume W parametric coordinate in volume Qi Return result of N'*F here, maybe with offset block_offset detJ Return det[J] here F Input F vector, size is = n.field coords. state_x if != 0, update state (pos. part) to this, then evaluate Q state_w if != 0, update state (speed part) to this, then evaluate Q

 void chrono::fea::ChElementBeamANCF::ComputeNodalMass ( )
overridevirtual

Add contribution of element inertia to total nodal masses.

This class computes and adds corresponding masses to ElementGeneric member m_TotalMass.

Reimplemented from chrono::fea::ChElementBase.

 ChVector chrono::fea::ChElementBeamANCF::ComputeTangent ( const double U )

Gets the tangent to the centerline at the parametric coordinate U.

Each coordinate ranging in -1..+1.

 ChVector chrono::fea::ChElementBeamANCF::EvaluateBeamSectionStrains ( )

Return a vector with three strain components.

Beta

 virtual void chrono::fea::ChElementBeamANCF::EvaluateSectionDisplacement ( const double eta, ChVector<> & u_displ, ChVector<> & u_rotaz )
overridevirtual

Gets the xyz displacement of a point on the beam line, and the rotation RxRyRz of section plane, at abscissa 'eta'.

Note, eta=-1 at node1, eta=+1 at node2. Note, 'displ' is the displ.state of 2 nodes, ex. get it as GetStateBlock() Results are not corotated.

Implements chrono::fea::ChElementBeam.

 virtual void chrono::fea::ChElementBeamANCF::EvaluateSectionFrame ( const double eta, ChVector<> & point, ChQuaternion<> & rot )
overridevirtual

Gets the absolute xyz position of a point on the beam line, and the absolute rotation of section plane, at abscissa 'eta'.

Note, eta=-1 at node1, eta=+1 at node2. Note, 'displ' is the displ.state of 2 nodes, ex. get it as GetStateBlock() Results are corotated (expressed in world reference)

Implements chrono::fea::ChElementBeam.

 virtual int chrono::fea::ChElementBeamANCF::Get_field_ncoords ( )
overridevirtual

Number of coordinates in the interpolated field, ex=3 for a tetrahedron finite element or a cable, = 1 for a thermal problem, etc.

 double chrono::fea::ChElementBeamANCF::GetDensity ( )
overridevirtual

This is needed so that it can be accessed by ChLoaderVolumeGravity.

Density is mass per unit surface.

 void chrono::fea::ChElementBeamANCF::GetStateBlock ( ChMatrixDynamic<> & mD )
overridevirtual

Fills the D vector (column matrix) with the current field values at the nodes of the element, with proper ordering.

If the D vector has not the size of this->GetNdofs(), it will be resized. For corotational elements, field is assumed in local reference! CHLDREN CLASSES MUST IMPLEMENT THIS!!!

Implements chrono::fea::ChElementBase.

 void chrono::fea::ChElementBeamANCF::SetupInitial ( ChSystem * system )
overridevirtual

Initial setup.

This is used mostly to precompute matrices that do not change during the simulation, such as the local stiffness of each element (if any), the mass, etc.

Reimplemented from chrono::fea::ChElementBase.

 void chrono::fea::ChElementBeamANCF::ShapeFunctions ( ChMatrix<> & N, double x, double y, double z )

Fills the N shape function matrix.

NOTE! actually N should be a 3row, 27 column sparse matrix, as N = [s1*eye(3) s2*eye(3) s3*eye(3) s4*eye(3)...]; , but to avoid wasting zero and repeated elements, here it stores only the s1 through s9 values in a 1 row, 9 columns matrix.

 void chrono::fea::ChElementBeamANCF::ShapeFunctionsDerivativeX ( ChMatrix<> & Nx, double x, double y, double z )

Fills the Nx shape function derivative matrix with respect to X.

NOTE! to avoid wasting zero and repeated elements, here it stores only the four values in a 1 row, 9 columns matrix.

 void chrono::fea::ChElementBeamANCF::ShapeFunctionsDerivativeY ( ChMatrix<> & Ny, double x, double y, double z )

Fills the Ny shape function derivative matrix with respect to Y.

NOTE! to avoid wasting zero and repeated elements, here it stores only the four values in a 1 row, 9 columns matrix.

 void chrono::fea::ChElementBeamANCF::ShapeFunctionsDerivativeZ ( ChMatrix<> & Nz, double x, double y, double z )

Fills the Nz shape function derivative matrix with respect to Z.

NOTE! to avoid wasting zero and repeated elements, here it stores only the four values in a 1 row, 9 columns matrix.