28 #include "libmesh/mesh_base.h" 29 #include "libmesh/boundary_info.h" 34 _use_local_elem (false),
36 _local_elem (nullptr) {
121 libmesh_assert_equal_to(y_vec.size(), 3);
147 std::unique_ptr<MAST::FEBase>
149 bool init_second_order_derivative,
150 int extra_quadrature_order)
const {
155 fe->set_extra_quadrature_order(extra_quadrature_order);
156 fe->set_evaluate_second_order_derivatives(init_second_order_derivative);
158 fe->init(*
this, init_grads);
164 std::unique_ptr<MAST::FEBase>
167 bool init_second_order_derivative,
168 int extra_quadrature_order)
const {
171 fe->set_extra_quadrature_order(extra_quadrature_order);
172 fe->set_evaluate_second_order_derivatives(init_second_order_derivative);
174 fe->init_for_side(*
this, s, init_grads);
183 (std::multimap<libMesh::boundary_id_type, MAST::BoundaryConditionBase*>& bc,
184 std::map<
unsigned int, std::vector<MAST::BoundaryConditionBase*>>& loads)
const {
188 typedef std::multimap<libMesh::boundary_id_type, MAST::BoundaryConditionBase*> maptype;
189 std::pair<maptype::const_iterator, maptype::const_iterator> range;
193 const libMesh::BoundaryInfo&
196 std::vector<libMesh::boundary_id_type> bids;
198 for (
unsigned int i=0; i<
_ref_elem->n_sides(); i++) {
203 for (
unsigned int j=0; j<bids.size(); j++) {
205 range = bc.equal_range(bids[j]);
207 maptype::const_iterator it = range.first;
208 for ( ; it != range.second; it++) loads[i].push_back(it->second);
217 (
unsigned int s, std::vector<libMesh::boundary_id_type>& bc_ids)
const {
247 libMesh::Point& global_pt)
const {
254 for (
unsigned int j=0; j<3; j++)
255 for (
unsigned int k=0; k<3; k++)
256 global_pt(j) +=
_T_mat(j,k)*local_pt(k);
267 libMesh::Point& global_vec)
const {
274 for (
unsigned int j=0; j<3; j++)
275 for (
unsigned int k=0; k<3; k++)
276 global_vec(j) +=
_T_mat(j,k)*local_vec(k);
284 libMesh::Point& local_vec)
const {
291 for (
unsigned int j=0; j<3; j++)
292 for (
unsigned int k=0; k<3; k++)
293 local_vec(j) +=
_T_mat(k,j) * global_vec(k);
305 global_vec =
_T_mat * local_vec;
316 local_vec =
_T_mat.transpose() * global_vec;
347 for (
unsigned int i=1; i<
_ref_elem->n_nodes(); i++) {
348 if (std::fabs(y-
_ref_elem->point(i)(1)) != 0. ||
349 std::fabs(z-
_ref_elem->point(i)(2)) != 0.)
366 for (
unsigned int i=1; i<
_ref_elem->n_nodes(); i++) {
367 if (std::fabs(z-
_ref_elem->point(i)(2)) != 0.)
394 libmesh_assert_equal_to(
_ref_elem->dim(), 1);
414 libmesh_error_msg(
"ERROR: y_vector (for orientation of 1D element) not defined; In " << __PRETTY_FUNCTION__ <<
" in " << __FILE__ <<
" at line " << __LINE__);
420 libMesh::Point v1, v2, v3, p;
422 for (
unsigned int i=0; i<3; i++) v2(i) =
_local_y(i);
424 libmesh_assert_greater(v3.norm(), 0.);
426 v2 = v3.cross(v1); v2 /= v2.norm();
428 _T_mat = RealMatrixX::Zero(3,3);
432 for (
unsigned int i=0; i<
_ref_elem->n_nodes(); i++) {
443 for (
unsigned int i=0; i<3; i++) {
453 for (
unsigned int j=0; j<3; j++)
454 for (
unsigned int k=0; k<3; k++)
466 libmesh_assert_equal_to(
_ref_elem->dim(), 2);
470 libMesh::Point v1, v2, v3, p;
473 v3 = v1.cross(v2); v3 /= v3.norm();
474 v2 = v3.cross(v1); v2 /= v2.norm();
478 for (
unsigned int i=0; i<3; i++)
481 _T_mat = RealMatrixX::Zero(3,3);
485 for (
unsigned int i=0; i<
_ref_elem->n_nodes(); i++) {
496 for (
unsigned int i=0; i<3; i++) {
506 for (
unsigned int j=0; j<3; j++)
507 for (
unsigned int k=0; k<3; k++)
virtual const libMesh::Elem & get_reference_local_elem() const
virtual void get_boundary_ids_on_quadrature_elem_side(unsigned int s, std::vector< libMesh::boundary_id_type > &bc_ids) const
void transform_vector_to_local_coordinate(const libMesh::Point &global_vec, libMesh::Point &local_vec) const
MAST::NonlinearSystem & system()
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...
const MAST::SystemInitialization * _sys_init
system initialization object for this element
virtual const libMesh::Elem & get_reference_elem() const
void _init_local_elem_1d()
initializes the local element
const RealVectorX & domain_surface_normal() const
libMesh::FEType get_fe_type(unsigned int i) const
virtual void clear() libmesh_override
Clear all the data structures associated with the system.
const libMesh::FEType & fetype(unsigned int i) const
const libMesh::Elem * _ref_elem
reference element in the mesh for which the data structure is initialized
RealVectorX _local_y
the y-axis that is used to define the coordinate system for a 1-D element.
void _init_local_elem()
initializes the local element
virtual const libMesh::Elem & get_quadrature_local_elem() const
RealMatrixX _T_mat
Transformation matrix defines T_ij = V_i^t .
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...
void transform_point_to_global_coordinate(const libMesh::Point &local_pt, libMesh::Point &global_pt) const
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...
libMesh::Elem * _local_elem
a local element is created if
unsigned int n_sides_quadrature_elem() const
number of sides on quadrature element.
Matrix< Real, Dynamic, Dynamic > RealMatrixX
RealVectorX _domain_surface_normal
surface normal of the 1D/2D element.
bool _bending
Defines if bending is used in this element or not.
Matrix< Real, Dynamic, 1 > RealVectorX
std::vector< libMesh::Node * > _local_nodes
nodes for local element
const RealMatrixX & T_matrix() const
O.
virtual const libMesh::Elem & get_quadrature_elem() const
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...
void set_bending(bool onoff)
This sets the 1D elements to extension/torsional stiffness only.
void _init_local_elem_2d()
initializes the local element
virtual void init(const libMesh::Elem &elem, const MAST::SystemInitialization &sys_init)
initialize the object for the specified reference elem.
bool use_local_elem() const
Vector and matrix quantities defined on one- and two-dimensional elements that are oriented in two or...
void transform_vector_to_global_coordinate(const libMesh::Point &local_vec, libMesh::Point &global_vec) const