MAST
structural_element_2d.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 #ifndef __mast__structural_element_2d__
21 #define __mast__structural_element_2d__
22 
23 // C++ includes
24 #include <memory>
25 
26 
27 // MAST includes
29 
30 
31 
32 
33 namespace MAST {
34 
35  // Forward declerations
36  class BendingOperator2D;
37  class BoundaryCondition;
38  class FEMOperatorMatrix;
39 
40 
41 
44 
45  public:
48  const MAST::GeomElem& elem,
50 
51  virtual ~StructuralElement2D();
52 
57  virtual unsigned int n_direct_strain_components() {
58  return 3;
59  }
60 
64  virtual unsigned int n_von_karman_strain_components() {
65  return 2;
66  }
67 
72  virtual bool internal_residual(bool request_jacobian,
73  RealVectorX& f,
74  RealMatrixX& jac);
75 
81  bool request_jacobian,
82  RealVectorX& f,
83  RealMatrixX& jac);
87  virtual bool
89 
95  virtual void
97  const unsigned int s,
99  bool request_jacobian,
100  RealVectorX& f,
101  RealMatrixX& jac);
102 
107  virtual bool prestress_residual (bool request_jacobian,
108  RealVectorX& f,
109  RealMatrixX& jac);
110 
115  virtual bool prestress_residual_sensitivity (const MAST::FunctionBase& p,
116  bool request_jacobian,
117  RealVectorX& f,
118  RealMatrixX& jac);
119 
124  virtual bool if_incompatible_modes() const {
125  return false;
126  }
127 
131  virtual bool calculate_stress(bool request_derivative,
132  const MAST::FunctionBase* p,
134 
139  virtual void
142  const unsigned int s,
143  const MAST::FieldFunction<RealVectorX>& vel_f);
144 
145 
146  virtual void
149 
150  virtual void
152  RealMatrixX& m);
153 
154  protected:
155 
156 
160  bool surface_pressure_residual(bool request_jacobian,
161  RealVectorX &f,
162  RealMatrixX &jac,
163  const unsigned int side,
165 
169  virtual bool
171  bool request_jacobian,
172  RealVectorX& f,
173  RealMatrixX& jac,
174  const unsigned int side,
176 
177 
181  virtual bool thermal_residual(bool request_jacobian,
182  RealVectorX& f,
183  RealMatrixX& jac,
185 
190  virtual bool thermal_residual_sensitivity(const MAST::FunctionBase& p,
191  bool request_jacobian,
192  RealVectorX& f,
193  RealMatrixX& jac,
195 
201  virtual void
203  const unsigned int s,
206  bool request_jacobian,
207  RealVectorX& f,
208  RealMatrixX& jac);
209 
217  virtual bool piston_theory_residual(bool request_jacobian,
218  RealVectorX &f,
219  RealMatrixX& jac_xdot,
220  RealMatrixX& jac,
222 
230  virtual bool
232  bool request_jacobian,
233  RealVectorX &f,
234  RealMatrixX& jac_xdot,
235  RealMatrixX& jac,
237 
244  virtual bool piston_theory_residual(bool request_jacobian,
245  RealVectorX &f,
246  RealMatrixX& jac_xdot,
247  RealMatrixX& jac,
248  const unsigned int side,
250 
251 
258  virtual bool
260  bool request_jacobian,
261  RealVectorX &f,
262  RealMatrixX& jac_xdot,
263  RealMatrixX& jac,
264  const unsigned int side,
266 
267 
272  virtual bool
274  (bool request_jacobian,
275  ComplexVectorX& f,
276  ComplexMatrixX& jac,
277  const unsigned int side,
279 
280  libmesh_error(); // to be implemented
281  }
282 
283 
284 
289  virtual bool
292  bool request_jacobian,
293  ComplexVectorX& f,
294  ComplexMatrixX& jac,
295  const unsigned int side,
297 
298  libmesh_error(); // to be implemented
299  }
300 
301 
308  virtual void
309  initialize_von_karman_strain_operator(const unsigned int qp,
310  const MAST::FEBase& fe,
311  RealVectorX& vk_strain,
312  RealMatrixX& vk_dwdxi_mat,
313  MAST::FEMOperatorMatrix& Bmat_vk);
314 
320  virtual void
322  const MAST::FEBase& fe,
323  RealMatrixX& vk_dwdxi_mat_sens);
324 
325 
326  virtual void
327  initialize_green_lagrange_strain_operator(const unsigned int qp,
328  const MAST::FEBase& fe,
329  const RealVectorX& local_disp,
330  RealVectorX& epsilon,
331  RealMatrixX& mat_x,
332  RealMatrixX& mat_y,
333  MAST::FEMOperatorMatrix& Bmat_lin,
334  MAST::FEMOperatorMatrix& Bmat_nl_x,
335  MAST::FEMOperatorMatrix& Bmat_nl_y,
336  MAST::FEMOperatorMatrix& Bmat_nl_u,
337  MAST::FEMOperatorMatrix& Bmat_nl_v);
338 
344  virtual void
345  _internal_residual_operation(bool if_vk,
346  const unsigned int n2,
347  const unsigned int qp,
348  const MAST::FEBase& fe,
349  const std::vector<Real>& JxW,
350  bool request_jacobian,
351  RealVectorX& local_f,
352  RealMatrixX& local_jac,
353  RealVectorX& local_disp,
354  RealVectorX& strain_mem,
356  FEMOperatorMatrix& Bmat_lin,
357  FEMOperatorMatrix& Bmat_nl_x,
358  FEMOperatorMatrix& Bmat_nl_y,
359  FEMOperatorMatrix& Bmat_nl_u,
360  FEMOperatorMatrix& Bmat_nl_v,
361  MAST::FEMOperatorMatrix& Bmat_bend,
362  MAST::FEMOperatorMatrix& Bmat_vk,
363  RealMatrixX& mat_x,
364  RealMatrixX& mat_y,
365  RealMatrixX& stress,
366  RealMatrixX& vk_dwdxi_mat,
367  RealMatrixX& material_A_mat,
368  RealMatrixX& material_B_mat,
369  RealMatrixX& material_D_mat,
370  RealVectorX& vec1_n1,
371  RealVectorX& vec2_n1,
372  RealVectorX& vec3_n2,
373  RealVectorX& vec4_2,
374  RealVectorX& vec5_2,
375  RealVectorX& vec6_n2,
376  RealMatrixX& mat1_n1n2,
377  RealMatrixX& mat2_n2n2,
378  RealMatrixX& mat3,
379  RealMatrixX& mat4_2n2,
380  RealMatrixX& mat5_3n2);
381 
382 
387  RealVectorX& vec) const;
388 
393  RealVectorX& vec) const;
394 
395  };
396 }
397 
398 
399 
400 #endif // __mast__structural_element_2d__
virtual bool calculate_stress(bool request_derivative, const MAST::FunctionBase *p, MAST::StressStrainOutputBase &output)
Calculates the stress tensor.
Data structure provides the mechanism to store stress and strain output from a structural analysis...
virtual unsigned int n_direct_strain_components()
row dimension of the direct strain matrix, also used for the bending operator row dimension ...
virtual void _internal_residual_operation(bool if_vk, const unsigned int n2, const unsigned int qp, const MAST::FEBase &fe, const std::vector< Real > &JxW, bool request_jacobian, RealVectorX &local_f, RealMatrixX &local_jac, RealVectorX &local_disp, RealVectorX &strain_mem, MAST::BendingOperator2D *bend, FEMOperatorMatrix &Bmat_lin, FEMOperatorMatrix &Bmat_nl_x, FEMOperatorMatrix &Bmat_nl_y, FEMOperatorMatrix &Bmat_nl_u, FEMOperatorMatrix &Bmat_nl_v, MAST::FEMOperatorMatrix &Bmat_bend, MAST::FEMOperatorMatrix &Bmat_vk, RealMatrixX &mat_x, RealMatrixX &mat_y, RealMatrixX &stress, RealMatrixX &vk_dwdxi_mat, RealMatrixX &material_A_mat, RealMatrixX &material_B_mat, RealMatrixX &material_D_mat, RealVectorX &vec1_n1, RealVectorX &vec2_n1, RealVectorX &vec3_n2, RealVectorX &vec4_2, RealVectorX &vec5_2, RealVectorX &vec6_n2, RealMatrixX &mat1_n1n2, RealMatrixX &mat2_n2n2, RealMatrixX &mat3, RealMatrixX &mat4_2n2, RealMatrixX &mat5_3n2)
performs integration at the quadrature point for the provided matrices.
StructuralElement2D(MAST::SystemInitialization &sys, MAST::AssemblyBase &assembly, const MAST::GeomElem &elem, const MAST::ElementPropertyCardBase &p)
virtual bool prestress_residual_sensitivity(const MAST::FunctionBase &p, bool request_jacobian, RealVectorX &f, RealMatrixX &jac)
Calculates the internal residual vector and Jacobian due to strain energy coming from a prestress...
const MAST::GeomElem & elem() const
Definition: elem_base.h:117
Matrix< Complex, Dynamic, 1 > ComplexVectorX
virtual bool internal_residual_jac_dot_state_sensitivity(RealMatrixX &jac)
calculates d[J]/d{x} .
MAST::AssemblyBase & assembly()
Definition: elem_base.h:103
virtual bool linearized_frequency_domain_surface_pressure_residual(bool request_jacobian, ComplexVectorX &f, ComplexMatrixX &jac, const unsigned int side, MAST::BoundaryConditionBase &bc)
Calculates the force vector and Jacobian due to small perturbation surface pressure.
virtual void thermal_residual_temperature_derivative(const MAST::FEBase &fe_thermal, RealMatrixX &m)
virtual bool internal_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac)
Calculates the internal residual vector and Jacobian due to strain energy.
virtual void calculate_stress_temperature_derivative(MAST::FEBase &fe_thermal, MAST::StressStrainOutputBase &output)
virtual bool piston_theory_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac_xdot, RealMatrixX &jac, MAST::BoundaryConditionBase &bc)
Calculates the force vector and Jacobian due to piston-theory based surface pressure on the entire el...
virtual void thermal_residual_boundary_velocity(const MAST::FunctionBase &p, const unsigned int s, const MAST::FieldFunction< RealVectorX > &vel_f, MAST::BoundaryConditionBase &bc, bool request_jacobian, RealVectorX &f, RealMatrixX &jac)
calculates the term on side s: .
Matrix< Real, Dynamic, Dynamic > RealMatrixX
Matrix< Complex, Dynamic, Dynamic > ComplexMatrixX
virtual bool thermal_residual_sensitivity(const MAST::FunctionBase &p, bool request_jacobian, RealVectorX &f, RealMatrixX &jac, MAST::BoundaryConditionBase &bc)
Calculates the sensitivity of residual vector and the Jacobian due to thermal stresses.
virtual bool if_incompatible_modes() const
Bending strain operator for 1D element.
virtual bool prestress_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac)
Calculates the internal residual vector and Jacobian due to strain energy coming from a prestress...
Matrix< Real, Dynamic, 1 > RealVectorX
virtual void initialize_von_karman_strain_operator(const unsigned int qp, const MAST::FEBase &fe, RealVectorX &vk_strain, RealMatrixX &vk_dwdxi_mat, MAST::FEMOperatorMatrix &Bmat_vk)
initialze the von Karman strain in vK_strain, the operator matrices needed for Jacobian calculation...
virtual void initialize_von_karman_strain_operator_sensitivity(const unsigned int qp, const MAST::FEBase &fe, RealMatrixX &vk_dwdxi_mat_sens)
initialze the sensitivity of von Karman operator matrices needed for Jacobian calculation.
This class acts as a wrapper around libMesh::Elem for the purpose of providing a uniform interface fo...
Definition: geom_elem.h:59
bool surface_pressure_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac, const unsigned int side, MAST::BoundaryConditionBase &bc)
Calculates the force vector and Jacobian due to surface pressure.
virtual bool internal_residual_sensitivity(const MAST::FunctionBase &p, bool request_jacobian, RealVectorX &f, RealMatrixX &jac)
Calculates the sensitivity internal residual vector and Jacobian due to strain energy.
void _convert_prestress_A_mat_to_vector(const RealMatrixX &mat, RealVectorX &vec) const
converts the prestress stress tensor to a vector representation
virtual bool piston_theory_residual_sensitivity(const MAST::FunctionBase &p, bool request_jacobian, RealVectorX &f, RealMatrixX &jac_xdot, RealMatrixX &jac, MAST::BoundaryConditionBase &bc)
Calculates the sensitivity of force vector and Jacobian due to piston-theory based surface pressure o...
virtual bool surface_pressure_residual_sensitivity(const MAST::FunctionBase &p, bool request_jacobian, RealVectorX &f, RealMatrixX &jac, const unsigned int side, MAST::BoundaryConditionBase &bc)
Calculates the force vector and Jacobian due to surface pressure.
virtual bool linearized_frequency_domain_surface_pressure_residual_sensitivity(const MAST::FunctionBase &p, bool request_jacobian, ComplexVectorX &f, ComplexMatrixX &jac, const unsigned int side, MAST::BoundaryConditionBase &bc)
Calculates the sensitivity of force vector and Jacobian due to small is applicable for perturbation s...
virtual void calculate_stress_boundary_velocity(const MAST::FunctionBase &p, MAST::StressStrainOutputBase &output, const unsigned int s, const MAST::FieldFunction< RealVectorX > &vel_f)
Calculates the boundary velocity term contributions to the sensitivity of stress at the specified bou...
virtual void initialize_green_lagrange_strain_operator(const unsigned int qp, const MAST::FEBase &fe, const RealVectorX &local_disp, RealVectorX &epsilon, RealMatrixX &mat_x, RealMatrixX &mat_y, MAST::FEMOperatorMatrix &Bmat_lin, MAST::FEMOperatorMatrix &Bmat_nl_x, MAST::FEMOperatorMatrix &Bmat_nl_y, MAST::FEMOperatorMatrix &Bmat_nl_u, MAST::FEMOperatorMatrix &Bmat_nl_v)
virtual void internal_residual_boundary_velocity(const MAST::FunctionBase &p, const unsigned int s, const MAST::FieldFunction< RealVectorX > &vel_f, bool request_jacobian, RealVectorX &f, RealMatrixX &jac)
calculates the term on side s: .
void _convert_prestress_B_mat_to_vector(const RealMatrixX &mat, RealVectorX &vec) const
converts the prestress stress tensor to a vector representation
virtual bool thermal_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac, MAST::BoundaryConditionBase &bc)
Calculates the residual vector and Jacobian due to thermal stresses.
virtual unsigned int n_von_karman_strain_components()
row dimension of the von Karman strain matrix