MAST
structural_element_1d.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_1d__
21 #define __mast__structural_element_1d__
22 
23 // MAST includes
25 
26 
27 
28 
29 namespace MAST {
30 
31  // Forward declerations
32  class BendingOperator1D;
33  class BoundaryConditionBase;
34  class FEMOperatorMatrix;
35 
36 
39 
40  public:
43  const MAST::GeomElem& elem,
45 
46 
47  virtual ~StructuralElement1D();
48 
49 
54  virtual unsigned int n_direct_strain_components() {
55  return 2;
56  }
57 
61  virtual unsigned int n_von_karman_strain_components() {
62  return 2;
63  }
64 
69  virtual bool internal_residual(bool request_jacobian,
70  RealVectorX& f,
71  RealMatrixX& jac);
72 
78  bool request_jacobian,
79  RealVectorX& f,
80  RealMatrixX& jac);
81 
87  virtual void
89  const unsigned int s,
91  bool request_jacobian,
92  RealVectorX& f,
93  RealMatrixX& jac) {
94  libmesh_assert(false);
95  }
96 
100  virtual bool
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 
133  virtual bool calculate_stress(bool request_derivative,
134  const MAST::FunctionBase* p,
136 
141  virtual void
144  const unsigned int s,
145  const MAST::FieldFunction<RealVectorX>& vel_f) {
146  libmesh_error(); // to be implemented
147  }
148 
149  virtual void
152  libmesh_error(); // to be implemented
153  }
154 
155  virtual void
157  RealMatrixX& m) {
158  libmesh_error(); // to be implemented
159  }
160 
161  protected:
162 
163 
167  bool surface_pressure_residual(bool request_jacobian,
168  RealVectorX &f,
169  RealMatrixX &jac,
170  const unsigned int side,
172 
176  virtual bool
178  bool request_jacobian,
179  RealVectorX& f,
180  RealMatrixX& jac,
181  const unsigned int side,
183 
184 
188  virtual bool thermal_residual(bool request_jacobian,
189  RealVectorX& f,
190  RealMatrixX& jac,
192 
197  virtual bool thermal_residual_sensitivity(const MAST::FunctionBase& p,
198  bool request_jacobian,
199  RealVectorX& f,
200  RealMatrixX& jac,
202 
203 
209  const unsigned int s,
212  bool request_jacobian,
213  RealVectorX& f,
214  RealMatrixX& jac) {
215 
216  libmesh_assert(false); // to be implemented
217  }
218 
226  virtual bool piston_theory_residual(bool request_jacobian,
227  RealVectorX &f,
228  RealMatrixX& jac_xdot,
229  RealMatrixX& jac,
231 
232 
240  virtual bool
242  bool request_jacobian,
243  RealVectorX &f,
244  RealMatrixX& jac_xdot,
245  RealMatrixX& jac,
247 
248 
255  virtual bool piston_theory_residual(bool request_jacobian,
256  RealVectorX &f,
257  RealMatrixX& jac_xdot,
258  RealMatrixX& jac,
259  const unsigned int side,
261 
262  libmesh_error_msg("Invalid Function Call: Piston theory force \
263  is not defined for 1D element side.");
264  }
265 
266 
274  bool request_jacobian,
275  RealVectorX &f,
276  RealMatrixX& jac_xdot,
277  RealMatrixX& jac,
278  const unsigned int side,
280 
281  libmesh_error_msg("Invalid Function Call: Piston theory force sensitivity \
282  is not defined for 1D element side.");
283  }
284 
285 
290  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 
302 
307  virtual bool
310  bool request_jacobian,
311  ComplexVectorX& f,
312  ComplexMatrixX& jac,
313  const unsigned int side,
315 
316  libmesh_error(); // to be implemented
317  }
318 
319 
323  virtual void initialize_direct_strain_operator(const unsigned int qp,
324  const MAST::FEBase& fe,
326 
333  virtual void
334  initialize_von_karman_strain_operator(const unsigned int qp,
335  const MAST::FEBase& fe,
336  RealVectorX& vk_strain,
337  RealMatrixX& vk_dvdxi_mat,
338  RealMatrixX& vk_dwdxi_mat,
339  MAST::FEMOperatorMatrix& Bmat_v_vk,
340  MAST::FEMOperatorMatrix& Bmat_w_vk);
341 
347  void
349  (const unsigned int qp,
350  const MAST::FEBase& fe,
351  RealMatrixX& vk_dvdxi_mat_sens,
352  RealMatrixX& vk_dwdxi_mat_sens);
353 
354 
360  virtual void _internal_residual_operation(bool if_vk,
361  const unsigned int n2,
362  const unsigned int qp,
363  const MAST::FEBase& fe,
364  const std::vector<Real>& JxW,
365  bool request_jacobian,
366  RealVectorX& local_f,
367  RealMatrixX& local_jac,
368  MAST::BendingOperator1D* bend_op,
369  MAST::FEMOperatorMatrix& Bmat_mem,
370  MAST::FEMOperatorMatrix& Bmat_bend_v,
371  MAST::FEMOperatorMatrix& Bmat_bend_w,
372  MAST::FEMOperatorMatrix& Bmat_v_vk,
373  MAST::FEMOperatorMatrix& Bmat_w_vk,
374  RealMatrixX& stress,
375  RealMatrixX& stress_l,
376  RealMatrixX& vk_dvdxi_mat,
377  RealMatrixX& vk_dwdxi_mat,
378  RealMatrixX& material_A_mat,
379  RealMatrixX& material_B_mat,
380  RealMatrixX& material_D_mat,
381  RealVectorX& vec1_n1,
382  RealVectorX& vec2_n1,
383  RealVectorX& vec3_n2,
384  RealVectorX& vec4_2,
385  RealVectorX& vec5_2,
386  RealMatrixX& mat1_n1n2,
387  RealMatrixX& mat2_n2n2,
388  RealMatrixX& mat3,
389  RealMatrixX& mat4_2n2);
390 
391 
392 
397  RealVectorX& vec) const;
398 
403  RealVectorX& vec) const;
404 
405  };
406 }
407 
408 
409 #endif // __mast__structural_element_1d__
virtual void initialize_direct_strain_operator(const unsigned int qp, const MAST::FEBase &fe, MAST::FEMOperatorMatrix &Bmat)
initialize membrane strain operator matrix
virtual unsigned int n_direct_strain_components()
row dimension of the direct strain matrix, also used for the bending operator row dimension ...
Data structure provides the mechanism to store stress and strain output from a structural analysis...
void _convert_prestress_B_mat_to_vector(const RealMatrixX &mat, RealVectorX &vec) const
converts the prestress stress tensor to a vector representation
virtual bool prestress_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac)
Calculates the internal force vector and Jacobian due to strain energy coming from a prestress...
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...
const MAST::GeomElem & elem() const
Definition: elem_base.h:117
Matrix< Complex, Dynamic, 1 > ComplexVectorX
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 bool thermal_residual_sensitivity(const MAST::FunctionBase &p, bool request_jacobian, RealVectorX &f, RealMatrixX &jac, MAST::BoundaryConditionBase &bc)
Calculates the sensitivity of force vector and the Jacobian due to thermal stresses.
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, MAST::BendingOperator1D *bend_op, MAST::FEMOperatorMatrix &Bmat_mem, MAST::FEMOperatorMatrix &Bmat_bend_v, MAST::FEMOperatorMatrix &Bmat_bend_w, MAST::FEMOperatorMatrix &Bmat_v_vk, MAST::FEMOperatorMatrix &Bmat_w_vk, RealMatrixX &stress, RealMatrixX &stress_l, RealMatrixX &vk_dvdxi_mat, 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, RealMatrixX &mat1_n1n2, RealMatrixX &mat2_n2n2, RealMatrixX &mat3, RealMatrixX &mat4_2n2)
performs integration at the quadrature point for the provided matrices.
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 calculate_stress_temperature_derivative(MAST::FEBase &fe_thermal, MAST::StressStrainOutputBase &output)
void initialize_von_karman_strain_operator_sensitivity(const unsigned int qp, const MAST::FEBase &fe, RealMatrixX &vk_dvdxi_mat_sens, RealMatrixX &vk_dwdxi_mat_sens)
initialze the sensitivity of von Karman operator matrices needed for Jacobian calculation.
virtual bool internal_residual_jac_dot_state_sensitivity(RealMatrixX &jac)
calculates d[J]/d{x} .
Matrix< Real, Dynamic, Dynamic > RealMatrixX
Matrix< Complex, Dynamic, Dynamic > ComplexMatrixX
virtual bool piston_theory_residual_sensitivity(const MAST::FunctionBase &p, bool request_jacobian, RealVectorX &f, RealMatrixX &jac_xdot, RealMatrixX &jac, const unsigned int side, MAST::BoundaryConditionBase &bc)
Calculates the force vector and Jacobian due to piston-theory sensitivity based surface pressure on t...
Bending strain operator for 1D element.
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 bool prestress_residual_sensitivity(const MAST::FunctionBase &p, bool request_jacobian, RealVectorX &f, RealMatrixX &jac)
Calculates the internal force vector and Jacobian due to strain energy coming from a prestress...
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...
Matrix< Real, Dynamic, 1 > RealVectorX
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 sensitivity of force vector and Jacobian due to thermal stresses.
virtual void thermal_residual_temperature_derivative(const MAST::FEBase &fe_thermal, RealMatrixX &m)
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: .
This class acts as a wrapper around libMesh::Elem for the purpose of providing a uniform interface fo...
Definition: geom_elem.h:59
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 _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(bool request_jacobian, RealVectorX &f, RealMatrixX &jac_xdot, RealMatrixX &jac, const unsigned int side, MAST::BoundaryConditionBase &bc)
Calculates the force vector and Jacobian due to piston-theory based surface pressure on the side iden...
virtual unsigned int n_von_karman_strain_components()
row dimension of the von Karman strain matrix
virtual bool thermal_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac, MAST::BoundaryConditionBase &bc)
Calculates the force vector and Jacobian due to thermal stresses.
virtual bool if_incompatible_modes() const
virtual bool calculate_stress(bool request_derivative, const MAST::FunctionBase *p, MAST::StressStrainOutputBase &output)
Calculates the stress tensor.
virtual void initialize_von_karman_strain_operator(const unsigned int qp, const MAST::FEBase &fe, RealVectorX &vk_strain, RealMatrixX &vk_dvdxi_mat, RealMatrixX &vk_dwdxi_mat, MAST::FEMOperatorMatrix &Bmat_v_vk, MAST::FEMOperatorMatrix &Bmat_w_vk)
initialze the von Karman strain in vK_strain, the operator matrices needed for Jacobian calculation...
StructuralElement1D(MAST::SystemInitialization &sys, MAST::AssemblyBase &assembly, const MAST::GeomElem &elem, const MAST::ElementPropertyCardBase &p)
virtual bool internal_residual_sensitivity(const MAST::FunctionBase &p, bool request_jacobian, RealVectorX &f, RealMatrixX &jac)
Calculates the sensitivity internal force vector and Jacobian due to strain energy.
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(bool request_jacobian, RealVectorX &f, RealMatrixX &jac)
Calculates the internal force vector and Jacobian due to strain energy.