OpenBeam
C++ library for static analysis of mechanical structures
CStructureProblem.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 "CFiniteElementProblem.h"
26 #include "loads.h"
27 
28 namespace openbeam
29 {
36 {
37  public:
39  virtual ~CStructureProblem();
40 
43  void clear() override;
44 
49  void addLoadAtBeam(const size_t element_index, CLoadOnBeam::Ptr load);
50 
53  template <typename LoadClass, typename... _Args>
54  void createLoadAtBeam(const size_t element_index, _Args&&... __args)
55  {
57  element_index,
58  std::make_shared<LoadClass>(std::forward<_Args>(__args)...));
59  }
60 
61  // ----------------------------------------------------------------------------
65  void updateAll() override;
67 
71  const MeshParams& params);
72 
74  // ----------------------------------------------------------------------------
75 
76  const std::multimap<size_t, CLoadOnBeam::Ptr>& loadsOnBeams() const
77  {
78  return m_loads_on_beams;
79  }
80 
81  private:
84  std::multimap<size_t, CLoadOnBeam::Ptr> m_loads_on_beams;
85 
91  void internalComputeStressAndEquivalentLoads() override;
92 };
93 } // namespace openbeam
Definition: CFiniteElementProblem.h:196
Definition: CStructureProblem.h:36
void updateAll() override
Update all internal lists after changing the structure.
void addLoadAtBeam(const size_t element_index, CLoadOnBeam::Ptr load)
void mesh(CStructureProblem &out_fem, MeshOutputInfo &mo, const MeshParams &params)
void createLoadAtBeam(const size_t element_index, _Args &&... __args)
Definition: CStructureProblem.h:54
Definition: CFiniteElementProblem.h:138
Definition: CFiniteElementProblem.h:128