MAST3
Multidisciplinary-design Adaptation and Sensitivity Toolkit (MAST)
mindlin_strain_operator.hpp
Go to the documentation of this file.
1 /*
2 * MAST: Multidisciplinary-design Adaptation and Sensitivity Toolkit
3 * Copyright (C) 2013-2020 Manav Bhatia and MAST authors
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 #ifndef __mast_mindlin_strain_operator_h__
21 #define __mast_mindlin_strain_operator_h__
22 
23 // MAST includes
25 #include <mast/base/exceptions.hpp>
27 
28 
29 namespace MAST {
30 namespace Physics {
31 namespace Elasticity {
32 namespace MindlinPlate {
33 
34 
35 template <typename NodalScalarType, typename VarScalarType, typename FEVarType>
36 inline void
37 inplane_strain(const FEVarType& fe_var,
38  const uint_t qp,
39  const VarScalarType z,
40  typename Eigen::Matrix<VarScalarType, 3, 1> &epsilon,
42 
43  epsilon.setZero();
44 
45  const typename FEVarType::fe_shape_deriv_t
46  &fe = fe_var.get_fe_shape_data();
47 
48  // make sure all matrices are the right size
49  Assert1(epsilon.size() == 3,
50  epsilon.size(),
51  "Strain vector dimension for inplane strain of Mindlin plate should be 3");
52  Assert1(Bmat.m() == 3,
53  Bmat.m(),
54  "Strain vector dimension for inplane strain of Mindlin plate should be 3");
55  Assert2(Bmat.n() == 3*fe.n_basis(),
56  Bmat.n(), 3*fe.n_basis(),
57  "Incompatible Operator size.");
58 
59 
60  // linear strain operator
61  Bmat.set_shape_function(0, 2, z, fe.dphi_dx(qp, 0)); // epsilon_xx = z * dthetay/dx
62  Bmat.set_shape_function(2, 1, -z, fe.dphi_dx(qp, 0)); // gamma_xy = -z * dthetax/dx + ...
63 
64  // linear strain operator
65  Bmat.set_shape_function(1, 1, -z, fe.dphi_dx(qp, 1)); // epsilon_yy = -z * dthetax/dy
66  Bmat.set_shape_function(2, 2, z, fe.dphi_dx(qp, 1)); // gamma_xy = z * dthetay/dy
67 
68  epsilon(0) = z * fe_var.du_dx(qp, 2, 0); // z * dthetay/dx
69  epsilon(1) = -z * fe_var.du_dx(qp, 1, 1); // -z * dthetax/dy
70  epsilon(2) = z * (fe_var.du_dx(qp, 2, 1) - fe_var.du_dx(qp, 1, 0)); // z * (dty/dy - dtx/dx)
71 }
72 
73 
74 
75 template <typename NodalScalarType, typename VarScalarType, typename FEVarType>
76 inline void
77 transverse_shear_strain(const FEVarType& fe_var,
78  const uint_t qp,
79  typename Eigen::Matrix<VarScalarType, 2, 1> &epsilon,
81 
82  epsilon.setZero();
83 
84  const typename FEVarType::fe_shape_deriv_t
85  &fe = fe_var.get_fe_shape_data();
86 
87  // make sure all matrices are the right size
88  Assert1(epsilon.size() == 2,
89  epsilon.size(),
90  "Strain vector dimension for transverse shear strain of Mindlin plate should be 2");
91  Assert1(Bmat.m() == 2,
92  Bmat.m(),
93  "Strain vector dimension for transverse shear strain of Mindlin plate should be 2");
94  Assert2(Bmat.n() == 3*fe.n_basis(),
95  Bmat.n(), 3*fe.n_basis(),
96  "Incompatible Operator size.");
97 
98  Bmat.set_shape_function(0, 0, fe.dphi_dx(qp, 0)); // gamma-xz: dw/dx
99  Bmat.set_shape_function(1, 0, fe.dphi_dx(qp, 1)); // gamma-yz : dw/dy
100 
101  Bmat.set_shape_function(0, 2, 1., fe.phi(qp)); // gamma-xz: thetay
102  Bmat.set_shape_function(1, 1, -1., fe.phi(qp)); // gamma-yz : thetax
103 
104  epsilon(0) = fe_var.du_dx(qp, 0, 0) + fe_var.u(qp, 2); // gamma-xz = dw/dx + ty
105  epsilon(1) = fe_var.du_dx(qp, 0, 1) - fe_var.u(qp, 1); // gamma-yz = dw/dy - tx
106 }
107 
108 } // namespace MindlinPlate
109 } // namespace Elasticity
110 } // namespace Physics
111 } // namespace MAST
112 
113 
114 #endif // __mast_mindlin_strain_operator_h__
#define Assert1(cond, v1, msg)
Definition: exceptions.hpp:143
void inplane_strain(const FEVarType &fe_var, const uint_t qp, const VarScalarType z, typename Eigen::Matrix< VarScalarType, 3, 1 > &epsilon, MAST::Numerics::FEMOperatorMatrix< NodalScalarType > &Bmat)
void set_shape_function(uint_t interpolated_var, uint_t discrete_var, const VecType &shape_func)
sets the shape function values for the block corresponding to interpolated_var and discrete_var...
unsigned int uint_t
#define Assert2(cond, v1, v2, msg)
Definition: exceptions.hpp:152
void transverse_shear_strain(const FEVarType &fe_var, const uint_t qp, typename Eigen::Matrix< VarScalarType, 2, 1 > &epsilon, MAST::Numerics::FEMOperatorMatrix< NodalScalarType > &Bmat)