libMesh
quadrature_gm_2D.C
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2019 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18 
19 
20 // Local includes
21 #include "libmesh/quadrature_gm.h"
22 #include "libmesh/enum_to_string.h"
23 
24 namespace libMesh
25 {
26 
27 void QGrundmann_Moller::init_2D(const ElemType, unsigned int)
28 {
29  // Nearly all GM rules contain negative weights, so if you are not
30  // allowing rules with negative weights, we cannot continue!
32  libmesh_error_msg("You requested a Grundmann-Moller rule but\n" \
33  << "are not allowing rules with negative weights!\n" \
34  << "Either select a different quadrature class or\n" \
35  << "set allow_rules_with_negative_weights==true.");
36 
37  switch (_type)
38  {
39  case TRI3:
40  case TRISHELL3:
41  case TRI3SUBDIVISION:
42  case TRI6:
43  {
44  switch(get_order())
45  {
46 
47  default:
48  {
49  // Untested above _order=23 but should work...
50  gm_rule(get_order()/2, /*dim=*/2);
51  return;
52  }
53  } // end switch (order)
54  } // end case TRI3, TRI6
55 
56  default:
57  libmesh_error_msg("ERROR: Unsupported element type: " << Utility::enum_to_string(_type));
58  } // end switch (_type)
59 }
60 
61 } // namespace libMesh
libMesh
The libMesh namespace provides an interface to certain functionality in the library.
Definition: factoryfunction.C:55
libMesh::QGrundmann_Moller::gm_rule
void gm_rule(unsigned int s, unsigned int dim)
This routine is called from init_2D() and init_3D().
Definition: quadrature_gm.C:52
libMesh::QBase::_type
ElemType _type
The type of element for which the current values have been computed.
Definition: quadrature.h:351
libMesh::TRI3
Definition: enum_elem_type.h:39
libMesh::Utility::enum_to_string
std::string enum_to_string(const T e)
libMesh::TRI6
Definition: enum_elem_type.h:40
libMesh::QGrundmann_Moller::init_2D
virtual void init_2D(const ElemType, unsigned int) override
Initializes the 2D quadrature rule by filling the points and weights vectors with the appropriate val...
Definition: quadrature_gm_2D.C:27
libMesh::QBase::allow_rules_with_negative_weights
bool allow_rules_with_negative_weights
Flag (default true) controlling the use of quadrature rules with negative weights.
Definition: quadrature.h:254
libMesh::TRI3SUBDIVISION
Definition: enum_elem_type.h:69
libMesh::QBase::get_order
Order get_order() const
Definition: quadrature.h:211
libMesh::TRISHELL3
Definition: enum_elem_type.h:71
libMesh::ElemType
ElemType
Defines an enum for geometric element types.
Definition: enum_elem_type.h:33