OpenBeam
C++ library for static analysis of mechanical structures
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
openbeam::CElement Class Referenceabstract

#include <CElement.h>

Inheritance diagram for openbeam::CElement:
Inheritance graph
[legend]
Collaboration diagram for openbeam::CElement:
Collaboration graph
[legend]

Public Types

using Ptr = std::shared_ptr< CElement >
 
using ConstPtr = std::shared_ptr< const CElement >
 

Public Member Functions

unsigned char getNumberEdges () const
 
virtual std::string asString () const
 
virtual void getLocalStiffnessMatrices (std::vector< TStiffnessSubmatrix > &outSubMats) const =0
 
virtual void getLocalDoFs (std::vector< used_DoFs_t > &dofs) const =0
 
void getGlobalDoFs (std::vector< used_DoFs_t > &dofs) const
 
virtual void getGlobalStiffnessMatrices (std::vector< TStiffnessSubmatrix > &outSubMats) const
 
void setGlobalOrientation (const TRotation3D &new_orientation)
 
const TRotation3DgetGlobalOrientation () const
 
virtual void updateOrientationFromNodePositions ()
 
void setDesignRotationAroundLinearAxis (num_t ang)
 
void setParent (CFiniteElementProblem *parent)
 
virtual void loadParamsFromSet (const mrpt::containers::yaml &p, const EvaluationContext &ctx)=0
 
void loadParamsFromSet (const mrpt::containers::yaml &p)
 
CFiniteElementProblemgetParent () const
 
virtual void drawSVG (void *_cairo_context, const DrawStructureOptions &options, const RenderInitData &ri, const DrawElementExtraParams &draw_el_params, const MeshOutputInfo *meshing_info) const =0
 
virtual mrpt::opengl::CSetOfObjects::Ptr getVisualization (const DrawStructureOptions &options, const DrawElementExtraParams &draw_el_params, const MeshOutputInfo *meshing_info) const =0
 
virtual void do_mesh (const size_t my_idx, CStructureProblem &out_fem, MeshOutputInfo &out_info, const MeshParams &params)=0
 

Static Public Member Functions

static Ptr createElementByName (const std::string &sName)
 

Public Attributes

std::vector< size_t > conected_nodes_ids
 

Protected Member Functions

 CElement (unsigned char nEdges)
 
 CElement (unsigned char nEdges, const size_t from_node_id, const size_t to_node_id)
 

Protected Attributes

const unsigned char m_nEdges
 
CFiniteElementProblemm_parent
 
num_t m_design_rotation_around_linear_axis
 For linear elements, the rotation around +X(local)
 
TRotation3D m_global_orientation
 Orientation of the element wrt global coords.
 

Detailed Description

Virtual base for any finite element.

Constructor & Destructor Documentation

◆ CElement()

openbeam::CElement::CElement ( unsigned char  nEdges,
const size_t  from_node_id,
const size_t  to_node_id 
)
protected

Special case that initializes the first two conected_nodes_ids

Member Function Documentation

◆ createElementByName()

static Ptr openbeam::CElement::createElementByName ( const std::string &  sName)
static

Class factory from element name, or nullptr for an unknown element: Element names:

◆ do_mesh()

virtual void openbeam::CElement::do_mesh ( const size_t  my_idx,
CStructureProblem out_fem,
MeshOutputInfo out_info,
const MeshParams params 
)
pure virtual

◆ drawSVG()

virtual void openbeam::CElement::drawSVG ( void *  _cairo_context,
const DrawStructureOptions options,
const RenderInitData ri,
const DrawElementExtraParams draw_el_params,
const MeshOutputInfo meshing_info 
) const
pure virtual

Draws the element to a SVG Cairo context (a pointer to a Cairo::RefPtr<Cairo::Context> casted to void*), according to the passed options

Implemented in openbeam::CElementTorsionSpring, openbeam::CElementSpringXY, openbeam::CElementSpringDXDYRZ, openbeam::CElementSpring, and openbeam::CBaseElementBeam.

◆ getGlobalDoFs()

void openbeam::CElement::getGlobalDoFs ( std::vector< used_DoFs_t > &  dofs) const

Return the local DoFs transformed with the current element pose in m_global_orientation

◆ getGlobalStiffnessMatrices()

virtual void openbeam::CElement::getGlobalStiffnessMatrices ( std::vector< TStiffnessSubmatrix > &  outSubMats) const
virtual

This method first calls getLocalStiffnessMatrices then rotates each matrix according to the current element orientation Can be redefined in derived classes for efficiency

◆ getLocalDoFs()

virtual void openbeam::CElement::getLocalDoFs ( std::vector< used_DoFs_t > &  dofs) const
pure virtual

◆ getLocalStiffnessMatrices()

virtual void openbeam::CElement::getLocalStiffnessMatrices ( std::vector< TStiffnessSubmatrix > &  outSubMats) const
pure virtual

Return the stiffness submatrices (for element local coordinates) between each pair of edges in this element, for the current element state. From all (in,out) edge pairs, only return those with in<=out (the other half is the corresponding transpose).

Implemented in openbeam::CElementTorsionSpring, openbeam::CElementSpringXY, openbeam::CElementSpringDXDYRZ, openbeam::CElementSpring, openbeam::CElementBeam_2D_RR, openbeam::CElementBeam_2D_RD, openbeam::CElementBeam_2D_RA, openbeam::CElementBeam_2D_AR, and openbeam::CElementBeam_2D_AA.

◆ getNumberEdges()

unsigned char openbeam::CElement::getNumberEdges ( ) const
inline

Must return the number of "ports" or "edges" of this element. This is the same than the length of conected_nodes_ids and the vectors returned by getLocalStiffnessMatrices

◆ getParent()

CFiniteElementProblem* openbeam::CElement::getParent ( ) const
inline

Get the parent FEM problem object

◆ loadParamsFromSet() [1/2]

void openbeam::CElement::loadParamsFromSet ( const mrpt::containers::yaml &  p)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ loadParamsFromSet() [2/2]

virtual void openbeam::CElement::loadParamsFromSet ( const mrpt::containers::yaml &  p,
const EvaluationContext ctx 
)
pure virtual

Parse a set of parameters by (casi insensitive) name and set the element values from them. Each element must document the supported parameters and their meaning.

Implemented in openbeam::CElementTorsionSpring, openbeam::CElementSpringXY, openbeam::CElementSpringDXDYRZ, openbeam::CElementSpring, and openbeam::CBaseElementBeam.

◆ setDesignRotationAroundLinearAxis()

void openbeam::CElement::setDesignRotationAroundLinearAxis ( num_t  ang)
inline

For linear elements from i->j, there's a rotation which is undefined if they're fixed between any two points. This parameter model that rotation. It's used during updateOrientationFromNodePositions

◆ updateOrientationFromNodePositions()

virtual void openbeam::CElement::updateOrientationFromNodePositions ( )
virtual

Updates m_global_orientation from the global poses of conected_nodes_ids and the value m_design_rotation_around_linear_axis

Member Data Documentation

◆ conected_nodes_ids

std::vector<size_t> openbeam::CElement::conected_nodes_ids

The list of connected nodes at each "port" or "face" It's set to the correct size at constructions automatically.


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