MAST
Multidisciplinary-design Adaptation and Sensitivity Toolkit (MAST)
geom_elem.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 
21 #ifndef __mast_geom_elem_h__
22 #define __mast_geom_elem_h__
23 
24 // MAST includes
25 #include "base/mast_data_types.h"
26 
27 // libMesh includes
28 #include "libmesh/elem.h"
29 #include "libmesh/fe_type.h"
30 
31 
32 namespace MAST {
33 
34  // Forward declerations
35  class FEBase;
36  class BoundaryConditionBase;
37  class SystemInitialization;
38 
59  class GeomElem {
60 
61  public:
62  GeomElem();
63 
64  virtual ~GeomElem();
65 
69  virtual const libMesh::Elem&
70  get_reference_elem() const;
71 
75  virtual const libMesh::Elem& get_reference_local_elem() const;
76 
80  virtual const libMesh::Elem& get_quadrature_elem() const;
81 
85  virtual const libMesh::Elem& get_quadrature_local_elem() const;
86 
90  unsigned int dim() const;
91 
95  unsigned int n_sides_quadrature_elem() const;
96 
101  libMesh::FEType get_fe_type(unsigned int i) const;
102 
110  void set_local_y_vector(const RealVectorX& y_vec);
111 
118  void set_bending(bool onoff);
119 
123  virtual void init(const libMesh::Elem& elem,
124  const MAST::SystemInitialization& sys_init);
125 
131  virtual std::unique_ptr<MAST::FEBase>
132  init_fe(bool init_grads,
133  bool init_second_order_derivative,
134  int extra_quadrature_order = 0) const;
135 
136 
142  virtual std::unique_ptr<MAST::FEBase>
143  init_side_fe(unsigned int s,
144  bool init_grads,
145  bool init_second_order_derivative,
146  int extra_quadrature_order = 0) const;
147 
148 
156  virtual void
158  (std::multimap<libMesh::boundary_id_type, MAST::BoundaryConditionBase*>& bc,
159  std::map<unsigned int, std::vector<MAST::BoundaryConditionBase*>>& loads) const;
160 
164  virtual void
166  (unsigned int s, std::vector<libMesh::boundary_id_type>& bc_ids) const;
167 
177  bool use_local_elem() const;
178 
179 
180  const RealVectorX&
181  domain_surface_normal() const;
182 
183  void
184  transform_point_to_global_coordinate(const libMesh::Point& local_pt,
185  libMesh::Point& global_pt) const;
186 
187  void
188  transform_vector_to_global_coordinate(const libMesh::Point& local_vec,
189  libMesh::Point& global_vec) const;
190 
191  void
192  transform_vector_to_local_coordinate(const libMesh::Point& global_vec,
193  libMesh::Point& local_vec) const;
194 
195  void
197  RealVectorX& global_vec) const;
198 
199  void
201  RealVectorX& local_vec) const;
202 
208  const RealMatrixX& T_matrix() const;
209 
210  protected:
211 
212 
216  void _init_local_elem();
217 
221  void _init_local_elem_1d();
222 
226  void _init_local_elem_2d();
227 
232 
234 
239  const libMesh::Elem* _ref_elem;
240 
244  libMesh::Elem* _local_elem;
245 
251 
256 
260  std::vector<libMesh::Node*> _local_nodes;
261 
270 
275  bool _bending = true;
276  };
277 }
278 
279 #endif // __mast_geom_elem_h__
virtual const libMesh::Elem & get_reference_local_elem() const
Definition: geom_elem.cpp:63
virtual void get_boundary_ids_on_quadrature_elem_side(unsigned int s, std::vector< libMesh::boundary_id_type > &bc_ids) const
Definition: geom_elem.cpp:217
void transform_vector_to_local_coordinate(const libMesh::Point &global_vec, libMesh::Point &local_vec) const
Definition: geom_elem.cpp:283
bool _use_local_elem
Definition: geom_elem.h:233
virtual void external_side_loads_for_quadrature_elem(std::multimap< libMesh::boundary_id_type, MAST::BoundaryConditionBase *> &bc, std::map< unsigned int, std::vector< MAST::BoundaryConditionBase *>> &loads) const
From the given list of boundary loads, this identifies the sides of the quadrature element and the lo...
Definition: geom_elem.cpp:183
const MAST::SystemInitialization * _sys_init
system initialization object for this element
Definition: geom_elem.h:231
virtual const libMesh::Elem & get_reference_elem() const
Definition: geom_elem.cpp:54
void _init_local_elem_1d()
initializes the local element
Definition: geom_elem.cpp:388
const RealVectorX & domain_surface_normal() const
Definition: geom_elem.cpp:227
libMesh::FEType get_fe_type(unsigned int i) const
Definition: geom_elem.cpp:110
const libMesh::Elem * _ref_elem
reference element in the mesh for which the data structure is initialized
Definition: geom_elem.h:239
RealVectorX _local_y
the y-axis that is used to define the coordinate system for a 1-D element.
Definition: geom_elem.h:250
void _init_local_elem()
initializes the local element
Definition: geom_elem.cpp:331
virtual const libMesh::Elem & get_quadrature_local_elem() const
Definition: geom_elem.cpp:81
RealMatrixX _T_mat
Transformation matrix defines T_ij = V_i^t .
Definition: geom_elem.h:269
void set_local_y_vector(const RealVectorX &y_vec)
for 1D elements the transformed coordinate system attached to the element defines the local x-axis al...
Definition: geom_elem.cpp:119
void transform_point_to_global_coordinate(const libMesh::Point &local_pt, libMesh::Point &global_pt) const
Definition: geom_elem.cpp:246
virtual std::unique_ptr< MAST::FEBase > init_fe(bool init_grads, bool init_second_order_derivative, int extra_quadrature_order=0) const
initializes the finite element shape function and quadrature object with the order of quadrature rule...
Definition: geom_elem.cpp:148
libMesh::Elem * _local_elem
a local element is created if
Definition: geom_elem.h:244
unsigned int n_sides_quadrature_elem() const
number of sides on quadrature element.
Definition: geom_elem.cpp:101
Matrix< Real, Dynamic, Dynamic > RealMatrixX
RealVectorX _domain_surface_normal
surface normal of the 1D/2D element.
Definition: geom_elem.h:255
bool _bending
Defines if bending is used in this element or not.
Definition: geom_elem.h:275
Matrix< Real, Dynamic, 1 > RealVectorX
std::vector< libMesh::Node * > _local_nodes
nodes for local element
Definition: geom_elem.h:260
const RealMatrixX & T_matrix() const
O.
Definition: geom_elem.cpp:236
This class acts as a wrapper around libMesh::Elem for the purpose of providing a uniform interface fo...
Definition: geom_elem.h:59
unsigned int dim() const
Definition: geom_elem.cpp:91
virtual const libMesh::Elem & get_quadrature_elem() const
Definition: geom_elem.cpp:72
virtual std::unique_ptr< MAST::FEBase > init_side_fe(unsigned int s, bool init_grads, bool init_second_order_derivative, int extra_quadrature_order=0) const
initializes the finite element shape function and quadrature object for the side with the order of qu...
Definition: geom_elem.cpp:165
void set_bending(bool onoff)
This sets the 1D elements to extension/torsional stiffness only.
Definition: geom_elem.cpp:128
void _init_local_elem_2d()
initializes the local element
Definition: geom_elem.cpp:461
virtual void init(const libMesh::Elem &elem, const MAST::SystemInitialization &sys_init)
initialize the object for the specified reference elem.
Definition: geom_elem.cpp:134
virtual ~GeomElem()
Definition: geom_elem.cpp:41
bool use_local_elem() const
Vector and matrix quantities defined on one- and two-dimensional elements that are oriented in two or...
Definition: geom_elem.cpp:322
void transform_vector_to_global_coordinate(const libMesh::Point &local_vec, libMesh::Point &global_vec) const
Definition: geom_elem.cpp:266