MAST
Multidisciplinary-design Adaptation and Sensitivity Toolkit (MAST)
element_property_card_1D.cpp
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 // MAST includes
22 #include "mesh/geom_elem.h"
23 
26 
27  // Ensure a valid bending_model is chosen, raise error if not
29  libmesh_error_msg("Invalid bending model for 1D element. Should be either MAST::BERNOULLI, MAST::TIMOSHENKO, MAST::NO_BENDING, OR MAST::DEFAULT_BENDING; " << __PRETTY_FUNCTION__ << " in " << __FILE__ << " at line number " << __LINE__);
30  }
31 
32  // for an EDGE2 element, default bending is Bernoulli. For all other elements
33  // the default is Timoshenko. Otherwise it returns the model set for
34  // this card.
35  switch (elem.get_reference_elem().type()) {
36  case libMesh::EDGE2:
37  // assuming that all variables have the same interpolation
38  if ((elem.get_fe_type(0).family == libMesh::LAGRANGE) &&
39  (elem.get_fe_type(0).order == libMesh::FIRST) &&
41  return MAST::BERNOULLI;
42  else
43  return _bending_model;
44  break;
45 
46  default:
48  return MAST::TIMOSHENKO;
49  else
50  return _bending_model;
51  break;
52  }
53 }
54 
MAST::BendingOperatorType _bending_model
material property card.
virtual const libMesh::Elem & get_reference_elem() const
Definition: geom_elem.cpp:54
libMesh::FEType get_fe_type(unsigned int i) const
Definition: geom_elem.cpp:110
This class acts as a wrapper around libMesh::Elem for the purpose of providing a uniform interface fo...
Definition: geom_elem.h:59
BendingOperatorType
virtual MAST::BendingOperatorType bending_model(const MAST::GeomElem &elem) const
returns the bending model to be used for the 2D element.