OpenBeam
C++ library for static analysis of mechanical structures
Public Member Functions | List of all members
openbeam::CStructureProblem Class Reference

#include <CStructureProblem.h>

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

Public Member Functions

void clear () override
 
void addLoadAtBeam (const size_t element_index, CLoadOnBeam::Ptr load)
 
template<typename LoadClass , typename... _Args>
void createLoadAtBeam (const size_t element_index, _Args &&... __args)
 
const std::multimap< size_t, CLoadOnBeam::Ptr > & loadsOnBeams () const
 
Structure solving
void updateAll () override
 Update all internal lists after changing the structure.
 
void mesh (CStructureProblem &out_fem, MeshOutputInfo &mo, const MeshParams &params)
 
- Public Member Functions inherited from openbeam::CFiniteElementProblem
bool loadFromStream (std::istream &is, const mrpt::optional_ref< vector_string_t > &errMsg=std::nullopt, const mrpt::optional_ref< vector_string_t > &warnMsg=std::nullopt)
 
bool loadFromFile (const std::string &file, const mrpt::optional_ref< vector_string_t > &errMsg=std::nullopt, const mrpt::optional_ref< vector_string_t > &warnMsg=std::nullopt)
 
bool saveAsImageSVG (const std::string &file, const DrawStructureOptions &options, const StaticSolveProblemInfo *solver_info=nullptr, const MeshOutputInfo *meshing_info=nullptr, ImageSaveOutputInfo *out_img_info=nullptr) const
 
bool saveAsImagePNG (const std::string &file, const DrawStructureOptions &options, const StaticSolveProblemInfo *solver_info=nullptr, const MeshOutputInfo *meshing_info=nullptr, ImageSaveOutputInfo *out_img_info=nullptr) const
 
bool saveAsImage (const std::string &file, const bool is_svg, const DrawStructureOptions &options, const StaticSolveProblemInfo *solver_info=nullptr, const MeshOutputInfo *meshing_info=nullptr, ImageSaveOutputInfo *out_img_info=nullptr) const
 
bool renderToCairoContext (void *_cairo_context, const RenderInitData &ri, const DrawStructureOptions &options, const StaticSolveProblemInfo *solver_info, const MeshOutputInfo *meshing_info) const
 
mrpt::opengl::CSetOfObjects::Ptr getVisualization (const DrawStructureOptions &options, const StaticSolveProblemInfo &solver_info, const MeshOutputInfo *meshing_info=nullptr, const StressInfo *stressInfo=nullptr) const
 
size_t insertElement (CElement::Ptr el)
 
template<typename ElementClass , typename... _Args>
size_t createElement (_Args &&... __args)
 
CElement::ConstPtr getElement (size_t i) const
 
const CElement::Ptr & getElement (size_t i)
 
size_t getNumberOfElements () const
 
void insertConstraint (const size_t dof_index, const num_t value=0)
 
const constraint_list_t & getAllConstraints () const
 
void setLoadAtDOF (const size_t dof_index, const num_t f)
 
void addLoadAtDOF (const size_t dof_index, const num_t f)
 
const load_list_t & getOverallLoadsOnDOFs () const
 
void setNumberOfNodes (size_t N)
 
size_t getNumberOfNodes () const
 
node_index_t insertNode (const TRotationTrans3D &p)
 
void setNodePose (size_t idx, const TRotationTrans3D &p)
 
void setNodePose (size_t idx, const num_t x, const num_t y, const num_t z)
 
TRotationTrans3DgetNodePose (size_t i)
 
const TRotationTrans3DgetNodePose (size_t i) const
 
void getNodeDeformedPosition (size_t i, Vector3 &out_final_point, const StaticSolveProblemInfo &solver_info, const num_t exageration_factor=1) const
 
num_t getMaximumDeformedDisplacement (const StaticSolveProblemInfo &solver_info) const
 
void getBoundingBox (num_t &min_x, num_t &max_x, num_t &min_y, num_t &max_y, bool deformed=false, const StaticSolveProblemInfo *solver_info=nullptr, num_t deformed_scale_factor=1.0) const
 
void assembleProblem (BuildProblemInfo &out_info)
 
void solveStatic (StaticSolveProblemInfo &out_info, const StaticSolverOptions &opts=StaticSolverOptions())
 
void postProcCalcStress (StressInfo &out_stress, const StaticSolveProblemInfo &solver_info)
 
std::string getNodeLabel (const size_t idx) const
 "N%i" or custom label
 
const std::vector< NodeDoF > & getProblemDoFs ()
 
std::string getProblemDoFsDescription ()
 
size_t getDOFIndex (const size_t nNode, const DoF_index n) const
 

Additional Inherited Members

- Public Types inherited from openbeam::CFiniteElementProblem
using constraint_list_t = std::map< size_t, num_t >
 
using load_list_t = std::map< size_t, num_t >
 
- Static Public Member Functions inherited from openbeam::CFiniteElementProblem
static std::vector< size_t > complementaryDoFs (const std::vector< size_t > &ds, const size_t nTotalDOFs)
 
- Protected Types inherited from openbeam::CFiniteElementProblem
using TNodeConnections = std::map< element_index_t, TNodeElementConnection >
 
- Protected Member Functions inherited from openbeam::CFiniteElementProblem
bool internal_loadFromYaml (const mrpt::containers::yaml &f, const mrpt::optional_ref< vector_string_t > &errMsg, const mrpt::optional_ref< vector_string_t > &warnMsg)
 
void internal_parser1_Parameters (const mrpt::containers::yaml &f, EvaluationContext &ctx) const
 
void internal_parser2_BeamSections (const mrpt::containers::yaml &f, EvaluationContext &ctx) const
 
void internal_parser3_nodes (const mrpt::containers::yaml &f, EvaluationContext &ctx)
 
void internal_parser4_elements (const mrpt::containers::yaml &f, EvaluationContext &ctx)
 
void internal_parser5_constraints (const mrpt::containers::yaml &f, EvaluationContext &ctx)
 
void internal_parser6_node_loads (const mrpt::containers::yaml &f, EvaluationContext &ctx)
 
void internal_parser7_element_loads (const mrpt::containers::yaml &f, EvaluationContext &ctx)
 
void updateListDoFs ()
 
void updateNodeConnections ()
 
void updateElementsOrientation ()
 
void updateNodesMainOrientation ()
 
void internal_getVisualization_nodeLoads (mrpt::opengl::CSetOfObjects &gl, const DrawStructureOptions &options, const StaticSolveProblemInfo &solver_info, const MeshOutputInfo *meshing_info, num_t DEFORMED_SCALE_FACTOR) const
 
void internal_getVisualization_constraints (mrpt::opengl::CSetOfObjects &gl, const DrawStructureOptions &options, const StaticSolveProblemInfo &solver_info, const MeshOutputInfo *meshing_info, num_t DEFORMED_SCALE_FACTOR) const
 
void internal_getVisualization_distributedLoads (const CStructureProblem &str, mrpt::opengl::CSetOfObjects &gl, const DrawStructureOptions &options, const StaticSolveProblemInfo &solver_info, const MeshOutputInfo *meshing_info, num_t DEFORMED_SCALE_FACTOR) const
 
void internal_getVisualization_stressDiagrams (mrpt::opengl::CSetOfObjects &gl, const DrawStructureOptions &options, const StaticSolveProblemInfo &solverInfo, const MeshOutputInfo *meshingInfo, num_t DEFORMED_SCALE_FACTOR, const StressInfo &stressInfo) const
 
- Protected Attributes inherited from openbeam::CFiniteElementProblem
std::vector< NodeDoFm_problem_DoFs
 
std::vector< TProblemDOFIndicesForNodem_problem_DoFs_inverse_list
 
std::vector< TNodeConnectionsm_node_connections
 
std::vector< TRotation3Dm_nodeMainDirection
 
std::deque< node_used_tm_node_defined
 
std::deque< TRotationTrans3Dm_node_poses
 
std::vector< std::string > m_node_labels
 node custom label
 
std::deque< CElement::Ptr > m_elements
 
constraint_list_t m_DoF_constraints
 
load_list_t m_loads_at_each_dof
 
load_list_t m_loads_at_each_dof_equivs
 
std::map< size_t, ElementStress > m_extra_stress_for_each_element
 

Detailed Description

A complete structure problem: it extends a finite-element problem by providing automatic division of large beams into sequence of small elements, etc.

Member Function Documentation

◆ addLoadAtBeam()

void openbeam::CStructureProblem::addLoadAtBeam ( const size_t  element_index,
CLoadOnBeam::Ptr  load 
)

Adds a new load to an element. The object must be created with "new", and not deleted by the user (it'll be done automatically by this class).

See also
CFiniteElementProblem, CFiniteElementProblem::addLoadAtDOF

◆ clear()

void openbeam::CStructureProblem::clear ( )
overridevirtual

Delete all elements, nodes and constraints in this structure, completely emptying it.

Reimplemented from openbeam::CFiniteElementProblem.

◆ createLoadAtBeam()

template<typename LoadClass , typename... _Args>
void openbeam::CStructureProblem::createLoadAtBeam ( const size_t  element_index,
_Args &&...  __args 
)
inline

Insert a new element in the problem

Returns
The element index

◆ mesh()

void openbeam::CStructureProblem::mesh ( CStructureProblem out_fem,
MeshOutputInfo mo,
const MeshParams params 
)

Mesh the structure into a set of small elements.


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