OpenBeam
C++ library for static analysis of mechanical structures
CBaseElementBeam.h
1 /* +---------------------------------------------------------------------------+
2  | OpenBeam - C++ Finite Element Analysis library |
3  | |
4  | Copyright (C) 2010-2021 Jose Luis Blanco Claraco |
5  | University of Malaga |
6  | |
7  | OpenBeam is free software: you can redistribute it and/or modify |
8  | it under the terms of the GNU General Public License as published by |
9  | the Free Software Foundation, either version 3 of the License, or |
10  | (at your option) any later version. |
11  | |
12  | OpenBeam is distributed in the hope that it will be useful, |
13  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
14  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15  | GNU General Public License for more details. |
16  | |
17  | You should have received a copy of the GNU General Public License |
18  | along with OpenBeam. If not, see <http://www.gnu.org/licenses/>. |
19  | |
20  +---------------------------------------------------------------------------+
21  */
22 
23 #pragma once
24 
25 #include "CElement.h"
26 #include "types.h"
27 
28 namespace openbeam
29 {
31 class CBaseElementBeam : public CElement
32 {
33  public:
34  using Ptr = std::shared_ptr<CBaseElementBeam>;
35  using ConstPtr = std::shared_ptr<const CBaseElementBeam>;
36 
37  CBaseElementBeam(const bool pinned_end0, const bool pinned_end1);
39  const size_t from_node_id,
40  const size_t to_node_id,
41  const bool pinned_end0,
42  const bool pinned_end1);
43 
44  num_t E = UNINITIALIZED_VALUE;
45  num_t A = UNINITIALIZED_VALUE;
46  num_t Iz = UNINITIALIZED_VALUE;
47  num_t G = 0;
48  num_t J = 0;
49 
52  {
53  E = o.E;
54  A = o.A;
55  Iz = o.Iz;
56  G = o.G;
57  J = o.J;
58  }
59 
60  std::string asString() const override;
61 
65  void drawSVG(
66  void* _cairo_context,
67  const DrawStructureOptions& options,
68  const RenderInitData& ri,
69  const DrawElementExtraParams& draw_el_params,
70  const MeshOutputInfo* meshing_info) const override;
71  mrpt::viz::CSetOfObjects::Ptr getVisualization(
72  const DrawStructureOptions& o,
73  const DrawElementExtraParams& draw_el_params,
74  const MeshOutputInfo* meshing_info) const override;
75 
77  void do_mesh(
78  const size_t my_idx,
79  CStructureProblem& out_fem,
80  MeshOutputInfo& out_info,
81  const MeshParams& params) override;
82 
87  void loadParamsFromSet(const mrpt::containers::yaml& p, const EvaluationContext& ctx) override;
88 
89  private:
90  bool m_pinned_end0,
91  m_pinned_end1;
94 };
95 } // namespace openbeam
Definition: CBaseElementBeam.h:32
num_t A
Section (m^2)
Definition: CBaseElementBeam.h:45
void copyCommonBeamParamsFrom(const CBaseElementBeam &o)
Definition: CBaseElementBeam.h:51
num_t J
Polar moment of inertia (m^4)
Definition: CBaseElementBeam.h:48
num_t G
Shear modulus of elasticity (N/m^2)
Definition: CBaseElementBeam.h:47
num_t E
Young modulus (N/m^2)
Definition: CBaseElementBeam.h:44
num_t Iz
Section inertia moment (m^4)
Definition: CBaseElementBeam.h:46
void do_mesh(const size_t my_idx, CStructureProblem &out_fem, MeshOutputInfo &out_info, const MeshParams &params) override
void drawSVG(void *_cairo_context, const DrawStructureOptions &options, const RenderInitData &ri, const DrawElementExtraParams &draw_el_params, const MeshOutputInfo *meshing_info) const override
void loadParamsFromSet(const mrpt::containers::yaml &p, const EvaluationContext &ctx) override
Definition: CElement.h:49
Definition: CStructureProblem.h:36
Definition: DrawStructureOptions.h:102
Definition: DrawStructureOptions.h:34
Definition: types.h:160
Definition: CFiniteElementProblem.h:152
Definition: CFiniteElementProblem.h:142
Definition: DrawStructureOptions.h:114