chrono::fea::ChElementCableANCF Class Reference

Description

Simple beam element with two nodes and ANCF gradient-deficient formulation.

For this 'basic' implementation, constant section and constant material are assumed along the beam coordinate. Torsional stiffness is impossible because of the formulation. Based on the formulation in: "Analysis of Thin Beams and Cables Using the Absolute Nodal Co-ordinate Formulation" J.GERSTMAYR, A.SHABANA Nonlinear Dynamics (2006) 45: 109130 DOI: 10.1007/s11071-006-1856-1 and in: "On the Validation and Applications of a Parallel Flexible Multi-body Dynamics Implementation" D. MELANZ

#include <ChElementCableANCF.h>

Inheritance diagram for chrono::fea::ChElementCableANCF:
Collaboration diagram for chrono::fea::ChElementCableANCF:

Public Member Functions

 ChElementCableANCF ()
 
virtual int GetNnodes () override
 Gets the number of nodes used by this element.
 
virtual int GetNdofs () override
 Gets the number of coordinates in the field used by the referenced nodes. More...
 
virtual int GetNodeNdofs (int n) override
 Get the number of coordinates from the n-th node that are used by this element. More...
 
virtual std::shared_ptr
< ChNodeFEAbase
GetNodeN (int n) override
 Access the nth node.
 
virtual void SetNodes (std::shared_ptr< ChNodeFEAxyzD > nodeA, std::shared_ptr< ChNodeFEAxyzD > nodeB)
 
void SetSection (std::shared_ptr< ChBeamSectionCable > my_material)
 Set the section & material of beam element . More...
 
std::shared_ptr
< ChBeamSectionCable
GetSection ()
 Get the section & material of the element.
 
std::shared_ptr< ChNodeFEAxyzDGetNodeA ()
 Get the first node (beginning)
 
std::shared_ptr< ChNodeFEAxyzDGetNodeB ()
 Get the second node (ending)
 
virtual void ShapeFunctions (ChMatrix<> &N, double xi)
 Fills the N shape function matrix with the values of shape functions at abscyssa 'xi'. More...
 
virtual void ShapeFunctionsDerivatives (ChMatrix<> &Nd, double xi)
 Fills the N shape function derivative matrix with the values of shape function derivatives at abscyssa 'xi'. More...
 
virtual void ShapeFunctionsDerivatives2 (ChMatrix<> &Ndd, double xi)
 
virtual void Update () override
 Update: this is called at least at each time step. 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 ComputeInternalJacobians (double Kfactor, double Rfactor)
 Computes the STIFFNESS MATRIX of the element: K = integral( .... More...
 
virtual void ComputeMassMatrix ()
 Computes the MASS MATRIX of the element Note: in this 'basic' implementation, constant section and constant material are assumed. More...
 
virtual void SetupInitial (ChSystem *system) override
 Setup. More...
 
virtual void ComputeMmatrixGlobal (ChMatrix<> &M) override
 Sets M as the global mass matrix.
 
virtual void ComputeKRMmatricesGlobal (ChMatrix<> &H, double Kfactor, double Rfactor=0, double Mfactor=0) override
 Sets H as the global stiffness matrix K, scaled by Kfactor. More...
 
virtual void ComputeInternalForces (ChMatrixDynamic<> &Fi) override
 Computes the internal forces and set values in the Fi vector. More...
 
void ComputeInternalForces_Impl (const ChVector<> &pA, const ChVector<> &dA, const ChVector<> &pB, const ChVector<> &dB, const ChVector<> &pA_dt, const ChVector<> &dA_dt, const ChVector<> &pB_dt, const ChVector<> &dB_dt, ChMatrixDynamic<> &Fi)
 Worker function for computing the internal forces. More...
 
virtual void EvaluateSectionDisplacement (const double eta, const ChMatrix<> &displ, 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 abscyssa 'eta'. More...
 
virtual void EvaluateSectionFrame (const double eta, const ChMatrix<> &displ, 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 abscyssa 'eta'. More...
 
virtual void EvaluateSectionForceTorque (const double eta, const ChMatrix<> &displ, ChVector<> &Fforce, ChVector<> &Mtorque) override
 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 abscyssa 'eta'. More...
 
virtual void EvaluateSectionStrain (const double eta, const ChMatrix<> &displ, ChVector<> &StrainV) override
 Gets the axial and bending strain of the ANCF element torque (torsion on x, bending on y, on bending on z) at a section along the beam line, at abscyssa 'eta'. More...
 
void SetAlphaDamp (double a)
 Set structural damping.
 
virtual int LoadableGet_ndof_x () override
 Gets the number of DOFs affected by this element (position part)
 
virtual int LoadableGet_ndof_w () override
 Gets the number of DOFs affected by this element (speed 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 (speed 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.
 
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.
 
- Public Member Functions inherited from chrono::fea::ChElementBeam
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 (ususlly 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 ComputeNodalMass ()
 Compute element's nodal masses.
 
- 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...
 

Public Attributes

bool m_use_damping
 Boolean indicating whether internal damping is added.
 
double m_alpha
 Scaling factor for internal damping.
 

Protected Attributes

std::vector< std::shared_ptr
< ChNodeFEAxyzD > > 
nodes
 
std::shared_ptr
< ChBeamSectionCable
section
 
ChMatrixNM< double, 12, 1 > m_GenForceVec0
 
ChMatrixNM< double, 12, 12 > m_JacobianMatrix
 Jacobian matrix (Kfactor*[K] + Rfactor*[R])
 
ChMatrixNM< double, 12, 12 > m_MassMatrix
 mass matrix
 
- Protected Attributes inherited from chrono::fea::ChElementBeam
double mass
 
double length
 
- Protected Attributes inherited from chrono::fea::ChElementGeneric
ChKblockGeneric Kmatr
 

Constructor & Destructor Documentation

chrono::fea::ChElementCableANCF::ChElementCableANCF ( )

< flag to add internal damping and its Jacobian

< scaling factor for internal damping

Member Function Documentation

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

Computes the internal forces and set values in the Fi vector.

(ex. the actual position of nodes is not in relaxed reference position).

Implements chrono::fea::ChElementBase.

void chrono::fea::ChElementCableANCF::ComputeInternalForces_Impl ( const ChVector<> &  pA,
const ChVector<> &  dA,
const ChVector<> &  pB,
const ChVector<> &  dB,
const ChVector<> &  pA_dt,
const ChVector<> &  dA_dt,
const ChVector<> &  pB_dt,
const ChVector<> &  dB_dt,
ChMatrixDynamic<> &  Fi 
)

Worker function for computing the internal forces.

This function takes the nodal coordinates as arguments and is therefore thread-safe. (Typically invoked by ComputeInternalForces. Used explicitly in the FD Jacobian approximation)

1) Integrate (strainD'*strain)

Evaluate (strainD'*strain) at point x

2) Integrate (k_e'*k_e)

Evaluate at point x

virtual void chrono::fea::ChElementCableANCF::ComputeInternalJacobians ( double  Kfactor,
double  Rfactor 
)
virtual

Computes the STIFFNESS MATRIX of the element: K = integral( ....

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

1) Integrate ((strainD'*strainD)+(strain*Sd'*Sd))

Evaluate ((strainD'*strainD)+(strain*Sd'*Sd)) at point x

2) Integrate (k_e'*k_e)

Evaluate at point x

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

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

Optionally, also superimposes global damping matrix R, scaled by Rfactor, and global mass matrix M multiplied by Mfactor.

Implements chrono::fea::ChElementBase.

virtual void chrono::fea::ChElementCableANCF::ComputeMassMatrix ( )
virtual

Computes the MASS MATRIX of the element Note: in this 'basic' implementation, constant section and constant material are assumed.

Integrate Area*rho*(S'*S) where S=[N1*eye(3) N2*eye(3) N3*eye(3) N4*eye(3)]

Evaluate the S'*S at point x

virtual void chrono::fea::ChElementCableANCF::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
Uparametric coordinate in line
QiReturn result of Q = N'*F here
detJReturn det[J] here
FInput F vector, size is =n. field coords.
state_xif != 0, update state (pos. part) to this, then evaluate Q
state_wif != 0, update state (speed part) to this, then evaluate Q

Implements chrono::ChLoadableU.

virtual void chrono::fea::ChElementCableANCF::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
Uparametric coordinate in volume
Vparametric coordinate in volume
Wparametric coordinate in volume
QiReturn result of N'*F here, maybe with offset block_offset
detJReturn det[J] here
FInput F vector, size is = n.field coords.
state_xif != 0, update state (pos. part) to this, then evaluate Q
state_wif != 0, update state (speed part) to this, then evaluate Q

Implements chrono::ChLoadableUVW.

virtual void chrono::fea::ChElementCableANCF::EvaluateSectionDisplacement ( const double  eta,
const ChMatrix<> &  displ,
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 abscyssa '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::ChElementCableANCF::EvaluateSectionForceTorque ( const double  eta,
const ChMatrix<> &  displ,
ChVector<> &  Fforce,
ChVector<> &  Mtorque 
)
overridevirtual

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 abscyssa '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, and are expressed in the reference system of beam. This is not mandatory for the element to work, but it can be useful for plotting, showing results, etc.

Implements chrono::fea::ChElementBeam.

virtual void chrono::fea::ChElementCableANCF::EvaluateSectionFrame ( const double  eta,
const ChMatrix<> &  displ,
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 abscyssa '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 void chrono::fea::ChElementCableANCF::EvaluateSectionStrain ( const double  eta,
const ChMatrix<> &  displ,
ChVector<> &  StrainV 
)
overridevirtual

Gets the axial and bending strain of the ANCF element torque (torsion on x, bending on y, on bending on z) at a section along the beam line, at abscyssa '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, and are expressed in the reference system of beam. This is not mandatory for the element to work, but it can be useful for plotting, showing results, etc.

Implements chrono::fea::ChElementBeam.

virtual int chrono::fea::ChElementCableANCF::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.

Implements chrono::ChLoadable.

virtual int chrono::fea::ChElementCableANCF::GetNdofs ( )
overridevirtual

Gets the number of coordinates in the field used by the referenced nodes.

This is for example the size (n.of rows/columns) of the local stiffness matrix.

Implements chrono::fea::ChElementBase.

virtual int chrono::fea::ChElementCableANCF::GetNodeNdofs ( int  n)
overridevirtual

Get the number of coordinates from the n-th node that are used by this element.

Note that this may be different from the value returned by GetNodeN(n)->Get_ndof_w();

Implements chrono::fea::ChElementBase.

virtual void chrono::fea::ChElementCableANCF::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. {x_a y_a z_a Dx_a Dx_a Dx_a x_b y_b z_b Dx_b Dy_b Dz_b}

Implements chrono::fea::ChElementBase.

void chrono::fea::ChElementCableANCF::SetSection ( std::shared_ptr< ChBeamSectionCable my_material)

Set the section & material of beam element .

It is a shared property, so it can be shared between other beams.

virtual void chrono::fea::ChElementCableANCF::SetupInitial ( ChSystem system)
overridevirtual

Setup.

Precompute mass and matrices that do not change during the simulation, ex. the mass matrix in ANCF is constant

Reimplemented from chrono::fea::ChElementBase.

virtual void chrono::fea::ChElementCableANCF::ShapeFunctions ( ChMatrix<> &  N,
double  xi 
)
virtual

Fills the N shape function matrix with the values of shape functions at abscyssa 'xi'.

Note, xi=0 at node1, xi=+1 at node2. NOTE! actually N should be a 3row, 12 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 s2 s3 s4 values in a 1 row, 4 columns matrix!

virtual void chrono::fea::ChElementCableANCF::ShapeFunctionsDerivatives ( ChMatrix<> &  Nd,
double  xi 
)
virtual

Fills the N shape function derivative matrix with the values of shape function derivatives at abscyssa 'xi'.

Note, xi=0 at node1, xi=+1 at node2. NOTE! to avoid wasting zero and repeated elements, here it stores only the four values in a 1 row, 4 columns matrix!

virtual void chrono::fea::ChElementCableANCF::Update ( )
overridevirtual

Update: this is called at least at each time step.

If the element has to keep updated some auxiliary data, such as the rotation matrices for corotational approach, this is the proper place.

Reimplemented from chrono::fea::ChElementBase.