quadrature_gm_2D.C
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2018 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 
23 namespace libMesh
24 {
25 
26 
27 
29  unsigned int p)
30 {
31  // Nearly all GM rules contain negative weights, so if you are not
32  // allowing rules with negative weights, we cannot continue!
34  libmesh_error_msg("You requested a Grundmann-Moller rule but\n" \
35  << "are not allowing rules with negative weights!\n" \
36  << "Either select a different quadrature class or\n" \
37  << "set allow_rules_with_negative_weights==true.");
38 
39  switch (type_in)
40  {
41  case TRI3:
42  case TRI6:
43  {
44  switch(_order + 2*p)
45  {
46 
47  default:
48  {
49  // Untested above _order=23 but should work...
50  gm_rule((_order + 2*p)/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: " << type_in);
58  } // end switch (type_in)
59 }
60 
61 } // namespace libMesh
bool allow_rules_with_negative_weights
Definition: quadrature.h:246
void gm_rule(unsigned int s, unsigned int dim)
Definition: quadrature_gm.C:52
virtual void init_2D(const ElemType _type=INVALID_ELEM, unsigned int p_level=0) override