MAST
Multidisciplinary-design Adaptation and Sensitivity Toolkit (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-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__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:
47  const MAST::GeomElem& elem,
49 
50  virtual ~StructuralElement2D();
51 
56  virtual unsigned int n_direct_strain_components() {
57  return 3;
58  }
59 
63  virtual unsigned int n_von_karman_strain_components() {
64  return 2;
65  }
66 
71  virtual bool internal_residual(bool request_jacobian,
72  RealVectorX& f,
73  RealMatrixX& jac);
74 
80  bool request_jacobian,
81  RealVectorX& f,
82  RealMatrixX& jac);
86  virtual bool
88 
94  virtual void
96  const unsigned int s,
98  bool request_jacobian,
99  RealVectorX& f,
100  RealMatrixX& jac);
101 
106  virtual bool prestress_residual (bool request_jacobian,
107  RealVectorX& f,
108  RealMatrixX& jac);
109 
114  virtual bool prestress_residual_sensitivity (const MAST::FunctionBase& p,
115  bool request_jacobian,
116  RealVectorX& f,
117  RealMatrixX& jac);
118 
123  virtual bool if_incompatible_modes() const {
124  return false;
125  }
126 
130  virtual bool calculate_stress(bool request_derivative,
131  const MAST::FunctionBase* p,
133 
138  virtual void
141  const unsigned int s,
142  const MAST::FieldFunction<RealVectorX>& vel_f);
143 
144 
145  virtual void
148 
149  virtual void
151  RealMatrixX& m);
152 
153  protected:
154 
155 
159  virtual bool
160  surface_traction_residual(bool request_jacobian,
161  RealVectorX& f,
162  RealMatrixX& jac,
163  const unsigned int side,
165 
166 
171  virtual bool
173  bool request_jacobian,
174  RealVectorX& f,
175  RealMatrixX& jac,
176  const unsigned int side,
178 
179 
184  virtual bool
185  surface_traction_residual_shifted_boundary(bool request_jacobian,
186  RealVectorX& f,
187  RealMatrixX& jac,
188  const unsigned int side,
190 
195  virtual bool
197  bool request_jacobian,
198  RealVectorX& f,
199  RealMatrixX& jac,
200  const unsigned int side,
202 
203 
207  bool surface_pressure_residual(bool request_jacobian,
208  RealVectorX &f,
209  RealMatrixX &jac,
210  const unsigned int side,
212 
216  virtual bool
218  bool request_jacobian,
219  RealVectorX& f,
220  RealMatrixX& jac,
221  const unsigned int side,
223 
224 
228  virtual bool thermal_residual(bool request_jacobian,
229  RealVectorX& f,
230  RealMatrixX& jac,
232 
237  virtual bool thermal_residual_sensitivity(const MAST::FunctionBase& p,
238  bool request_jacobian,
239  RealVectorX& f,
240  RealMatrixX& jac,
242 
248  virtual void
250  const unsigned int s,
253  bool request_jacobian,
254  RealVectorX& f,
255  RealMatrixX& jac);
256 
264  virtual bool piston_theory_residual(bool request_jacobian,
265  RealVectorX &f,
266  RealMatrixX& jac_xdot,
267  RealMatrixX& jac,
269 
277  virtual bool
279  bool request_jacobian,
280  RealVectorX &f,
281  RealMatrixX& jac_xdot,
282  RealMatrixX& jac,
284 
291  virtual bool piston_theory_residual(bool request_jacobian,
292  RealVectorX &f,
293  RealMatrixX& jac_xdot,
294  RealMatrixX& jac,
295  const unsigned int side,
297 
298 
305  virtual bool
307  bool request_jacobian,
308  RealVectorX &f,
309  RealMatrixX& jac_xdot,
310  RealMatrixX& jac,
311  const unsigned int side,
313 
314 
319  virtual bool
321  (bool request_jacobian,
322  ComplexVectorX& f,
323  ComplexMatrixX& jac,
324  const unsigned int side,
326 
327  libmesh_error(); // to be implemented
328  }
329 
330 
331 
336  virtual bool
339  bool request_jacobian,
340  ComplexVectorX& f,
341  ComplexMatrixX& jac,
342  const unsigned int side,
344 
345  libmesh_error(); // to be implemented
346  }
347 
348 
355  virtual void
356  initialize_von_karman_strain_operator(const unsigned int qp,
357  const MAST::FEBase& fe,
358  RealVectorX& vk_strain,
359  RealMatrixX& vk_dwdxi_mat,
360  MAST::FEMOperatorMatrix& Bmat_vk);
361 
367  virtual void
369  const MAST::FEBase& fe,
370  RealMatrixX& vk_dwdxi_mat_sens);
371 
372 
373  virtual void
374  initialize_green_lagrange_strain_operator(const unsigned int qp,
375  const MAST::FEBase& fe,
376  const RealVectorX& local_disp,
377  RealVectorX& epsilon,
378  RealMatrixX& mat_x,
379  RealMatrixX& mat_y,
380  MAST::FEMOperatorMatrix& Bmat_lin,
381  MAST::FEMOperatorMatrix& Bmat_nl_x,
382  MAST::FEMOperatorMatrix& Bmat_nl_y,
383  MAST::FEMOperatorMatrix& Bmat_nl_u,
384  MAST::FEMOperatorMatrix& Bmat_nl_v);
385 
386 
387  virtual void
388  initialize_strain_operator_gradient(const unsigned int qp,
389  const MAST::FEBase& fe,
390  const RealVectorX& local_disp,
391  RealMatrixX& epsilon_grad,
392  std::vector<MAST::FEMOperatorMatrix>& dBmat_lin);
393 
399  void _compute_stress(MAST::FEBase& fe, unsigned int qp,
400  RealVectorX& stress,
401  RealMatrixX* dstress_dX);
402 
403 
405  MAST::FEBase& fe, unsigned int qp,
406  RealVectorX& stress);
407 
415  unsigned int qp,
416  RealMatrixX& stress_grad,
417  std::vector<RealMatrixX>* dstress_grad_dX);
418 
420  MAST::FEBase& fe,
421  unsigned int qp,
422  RealMatrixX& stress_grad);
423 
428  void _surface_normal_voigt_notation(const RealVectorX& normal,
429  RealMatrixX& normal_mat);
430 
431 
437  virtual void
438  _internal_residual_operation(bool if_vk,
439  const unsigned int n2,
440  const unsigned int qp,
441  const MAST::FEBase& fe,
442  const std::vector<Real>& JxW,
443  bool request_jacobian,
444  RealVectorX& local_f,
445  RealMatrixX& local_jac,
446  RealVectorX& local_disp,
447  RealVectorX& strain_mem,
449  FEMOperatorMatrix& Bmat_lin,
450  FEMOperatorMatrix& Bmat_nl_x,
451  FEMOperatorMatrix& Bmat_nl_y,
452  FEMOperatorMatrix& Bmat_nl_u,
453  FEMOperatorMatrix& Bmat_nl_v,
454  MAST::FEMOperatorMatrix& Bmat_bend,
455  MAST::FEMOperatorMatrix& Bmat_vk,
456  RealMatrixX& mat_x,
457  RealMatrixX& mat_y,
458  RealMatrixX& stress,
459  RealMatrixX& vk_dwdxi_mat,
460  RealMatrixX& material_A_mat,
461  RealMatrixX& material_B_mat,
462  RealMatrixX& material_D_mat,
463  RealVectorX& vec1_n1,
464  RealVectorX& vec2_n1,
465  RealVectorX& vec3_n2,
466  RealVectorX& vec4_2,
467  RealVectorX& vec5_2,
468  RealVectorX& vec6_n2,
469  RealMatrixX& mat1_n1n2,
470  RealMatrixX& mat2_n2n2,
471  RealMatrixX& mat3,
472  RealMatrixX& mat4_2n2,
473  RealMatrixX& mat5_3n2);
474 
475 
480  RealVectorX& vec) const;
481 
486  RealVectorX& vec) const;
487 
488  };
489 }
490 
491 
492 
493 #endif // __mast__structural_element_2d__
virtual bool calculate_stress(bool request_derivative, const MAST::FunctionBase *p, MAST::StressStrainOutputBase &output)
Calculates the stress tensor.
virtual bool surface_traction_residual_shifted_boundary_sensitivity(const MAST::FunctionBase &p, bool request_jacobian, RealVectorX &f, RealMatrixX &jac, const unsigned int side, MAST::BoundaryConditionBase &bc)
Calculates the sensitivity of force vector and Jacobian due to surface traction and sensitiity due to...
void _convert_prestress_B_mat_to_vector(const RealMatrixX &mat, RealVectorX &vec) const
converts the prestress stress tensor to a vector representation
void _surface_normal_voigt_notation(const RealVectorX &normal, RealMatrixX &normal_mat)
creates a matrix that can be multiplied with the Voigt notation of stress to compute the surface norm...
Data structure provides the mechanism to store stress and strain output from a structural analysis...
virtual bool surface_traction_residual_sensitivity(const MAST::FunctionBase &p, bool request_jacobian, RealVectorX &f, RealMatrixX &jac, const unsigned int side, MAST::BoundaryConditionBase &bc)
Calculates the sensitivity of element vector and matrix quantities for surface traction boundary cond...
virtual unsigned int n_direct_strain_components()
row dimension of the direct strain matrix, also used for the bending operator row dimension ...
virtual void initialize_strain_operator_gradient(const unsigned int qp, const MAST::FEBase &fe, const RealVectorX &local_disp, RealMatrixX &epsilon_grad, std::vector< MAST::FEMOperatorMatrix > &dBmat_lin)
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.
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...
Matrix< Complex, Dynamic, 1 > ComplexVectorX
virtual bool internal_residual_jac_dot_state_sensitivity(RealMatrixX &jac)
calculates d[J]/d{x} .
void _compute_stress(MAST::FEBase &fe, unsigned int qp, RealVectorX &stress, RealMatrixX *dstress_dX)
Computes the stress at the specified quadrature point of the FE data structure.
virtual bool surface_traction_residual_shifted_boundary(bool request_jacobian, RealVectorX &f, RealMatrixX &jac, const unsigned int side, MAST::BoundaryConditionBase &bc)
Calculates the sensitivity of force vector and Jacobian due to surface traction and sensitiity due to...
void _compute_stress_sensitivity(const MAST::FunctionBase &f, MAST::FEBase &fe, unsigned int qp, RealVectorX &stress)
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.
Bending strain operator for 1D element.
virtual bool if_incompatible_modes() const
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
StructuralElement2D(MAST::SystemInitialization &sys, const MAST::GeomElem &elem, const MAST::ElementPropertyCardBase &p)
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.
const MAST::GeomElem & elem() const
Definition: elem_base.h:109
virtual bool surface_traction_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac, const unsigned int side, MAST::BoundaryConditionBase &bc)
Calculates the force vector and Jacobian due to surface traction.
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...
void _convert_prestress_A_mat_to_vector(const RealMatrixX &mat, RealVectorX &vec) const
converts the prestress stress tensor to a vector representation
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.
void _compute_stress_gradient(MAST::FEBase &fe, unsigned int qp, RealMatrixX &stress_grad, std::vector< RealMatrixX > *dstress_grad_dX)
computes the gradient of stress in Voigt notation in stress_grad where the three columns are the deri...
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 _compute_stress_gradient_sensitivity(const MAST::FunctionBase &f, MAST::FEBase &fe, unsigned int qp, RealMatrixX &stress_grad)
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