MAST
bending_operator.cpp
Go to the documentation of this file.
1 /*
2  * MAST: Multidisciplinary-design Adaptation and Sensitivity Toolkit
3  * Copyright (C) 2013-2019 Manav Bhatia
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
20 // C++ includes
21 #include <vector>
22 
23 // MAST includes
30 
31 
32 
34 _structural_elem(elem),
35 _elem(_structural_elem.elem())
36 { }
37 
38 
39 
41 { }
42 
43 
44 
45 std::unique_ptr<MAST::BendingOperator1D>
48  const std::vector<libMesh::Point>& pts) {
49 
50  std::unique_ptr<MAST::BendingOperator1D> rval;
51 
52  switch (type) {
53  case MAST::BERNOULLI:
54  rval.reset(new MAST::BernoulliBendingOperator(elem, pts));
55  break;
56 
57  case MAST::TIMOSHENKO:
58  rval.reset(new MAST::TimoshenkoBendingOperator(elem));
59  break;
60 
61  case MAST::NO_BENDING:
62  // nothing to be done
63  break;
64 
65  default:
66  libmesh_error(); // should not get here
67  break;
68  }
69 
70  return rval;
71 }
72 
73 
74 std::unique_ptr<MAST::BendingOperator2D>
77  const std::vector<libMesh::Point>& pts) {
78 
79  std::unique_ptr<MAST::BendingOperator2D> rval;
80 
81  switch (type) {
82 
83  case MAST::DKT:
84  rval.reset(new MAST::DKTBendingOperator(elem, pts));
85  break;
86 
87  case MAST::MINDLIN:
88  rval.reset(new MAST::MindlinBendingOperator(elem));
89  break;
90 
91  case MAST::NO_BENDING:
92  // nothing to be done
93  break;
94 
95  default:
96  libmesh_error(); // should not get here
97  break;
98  }
99 
100  return rval;
101 }
std::unique_ptr< MAST::BendingOperator1D > build_bending_operator_1D(MAST::BendingOperatorType type, MAST::StructuralElementBase &elem, const std::vector< libMesh::Point > &pts)
builds a bending operator and returns it in a smart-pointer
std::unique_ptr< MAST::BendingOperator2D > build_bending_operator_2D(MAST::BendingOperatorType type, MAST::StructuralElementBase &elem, const std::vector< libMesh::Point > &pts)
BendingOperator(MAST::StructuralElementBase &elem)
BendingOperatorType