MAST
bernoulli_bending_operator.h
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 
21 #ifndef mast_bernoulli_bending_operator_h
22 #define mast_bernoulli_bending_operator_h
23 
24 // MAST includes
27 #include "mesh/fe_base.h"
28 #include "mesh/geom_elem.h"
29 
30 // libMesh includes
31 #include "libmesh/point.h"
32 #include "libmesh/elem.h"
33 
34 
35 namespace MAST {
38 
39  public:
41  const std::vector<libMesh::Point>& qpts):
42  MAST::BendingOperator1D(elem),
43  _length(_elem.get_reference_elem().volume()),
44  _qpts(qpts)
45  { }
46 
50  virtual bool include_transverse_shear_energy() const {
51  return false;
52  }
53 
60  virtual void
62  const unsigned int qp,
64  MAST::FEMOperatorMatrix& Bmat_w);
65 
70  void
72  const unsigned int qp,
73  const Real y,
74  const Real z,
75  MAST::FEMOperatorMatrix& Bmat_bend_v,
76  MAST::FEMOperatorMatrix& Bmat_bend_w);
77 
78  protected:
79 
84 
89  const std::vector<libMesh::Point> _qpts;
90  };
91 }
92 
93 
94 inline void
97  const unsigned int qp,
99  MAST::FEMOperatorMatrix& Bmat_w) {
100 
101  this->initialize_bending_strain_operator_for_yz(fe, qp, 1., 1.,
102  Bmat_v,
103  Bmat_w);
104 }
105 
106 
107 
108 inline void
111  const unsigned int qp,
112  const Real y,
113  const Real z,
114  MAST::FEMOperatorMatrix& Bmat_v,
115  MAST::FEMOperatorMatrix& Bmat_w) {
116 
117  const Real xi = _qpts[qp](0);
118 
119  // shape function values
120  // N1 = (length/8.0) * (4.0/length - 6.0/length*xi + 0.0 + 2.0/length*pow(xi,3));
121  // N2 = (length/8.0) * (4.0/length + 6.0/length*xi + 0.0 - 2.0/length*pow(xi,3));
122  // N3 = (length/8.0) * ( 1.0 - xi - pow(xi,2) + pow(xi,3)); // needs a -1.0 factor for theta_y
123  // N4 = (length/8.0) * (-1.0 - xi + pow(xi,2) + pow(xi,3)); // needs a -1.0 factor for theta_y
124 
125  // shape function derivative
126  // N1 = (1.0/4.0) * (0.0 - 6.0/length + 0.0 + 6.0/length*pow(xi,2));
127  // N2 = (1.0/4.0) * (0.0 + 6.0/length + 0.0 - 6.0/length*pow(xi,2));
128  // N3 = (1.0/4.0) * (0.0 - 1.0 - 2.0*xi + 3.0*pow(xi,2)); // needs a -1.0 factor for theta_y
129  // N4 = (1.0/4.0) * (0.0 - 1.0 + 2.0*xi + 3.0*pow(xi,2)); // needs a -1.0 factor for theta_y
130 
131  RealVectorX N = RealVectorX::Zero(2);
132 
133  // second order shape function derivative
134  N(0) = (0.5/_length) * ( 0.0 + 12.0/_length*xi);
135  N(1) = (0.5/_length) * ( 0.0 - 12.0/_length*xi);
136  N *= -y;
137  Bmat_v.set_shape_function(0, 1, N); // v-disp
138 
139  N(0) = (0.5/_length) * ( 0.0 + 12.0/_length*xi);
140  N(1) = (0.5/_length) * ( 0.0 - 12.0/_length*xi);
141  N *= -z;
142  Bmat_w.set_shape_function(0, 2, N); // w-disp
143 
144  N(0) = (0.5/_length) * (- 2.0 + 6.0*xi);
145  N(1) = (0.5/_length) * ( 2.0 + 6.0*xi);
146  N *= -y;
147  Bmat_v.set_shape_function(0, 5, N); // theta-z
148 
149  N(0) = (0.5/_length) * (- 2.0 + 6.0*xi); // needs a -1.0 factor for theta_y
150  N(1) = (0.5/_length) * ( 2.0 + 6.0*xi); // needs a -1.0 factor for theta_y
151  N *= z;
152  Bmat_w.set_shape_function(0, 4, N); // theta-y
153 }
154 
155 
156 #endif
void set_shape_function(unsigned int interpolated_var, unsigned int discrete_var, const RealVectorX &shape_func)
sets the shape function values for the block corresponding to interpolated_var and discrete_var...
virtual void initialize_bending_strain_operator(const MAST::FEBase &fe, const unsigned int qp, MAST::FEMOperatorMatrix &Bmat_v, MAST::FEMOperatorMatrix &Bmat_w)
initialze the bending strain operator for Bernoulli element, withouth the y,z-location.
libMesh::Real Real
Bending strain operator for 1D element.
BernoulliBendingOperator(MAST::StructuralElementBase &elem, const std::vector< libMesh::Point > &qpts)
Matrix< Real, Dynamic, 1 > RealVectorX
virtual bool include_transverse_shear_energy() const
returns true if this bending operator supports a transverse shear component
const std::vector< libMesh::Point > _qpts
this element needs the locations of the points for which the FE is initialized
const MAST::GeomElem & _elem
element for which bending operator is created
void initialize_bending_strain_operator_for_yz(const MAST::FEBase &fe, const unsigned int qp, const Real y, const Real z, MAST::FEMOperatorMatrix &Bmat_bend_v, MAST::FEMOperatorMatrix &Bmat_bend_w)
initializes the bending strain operator for the specified quadrature point and y,z-location.