fe_type.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 // Local includes
19 #include "libmesh/fe_type.h"
22 #include "libmesh/auto_ptr.h" // libmesh_make_unique
23 
24 namespace libMesh
25 {
26 
27 // ---------------------------------------
28 // FEType class members
29 
30 std::unique_ptr<QBase>
31 FEType::default_quadrature_rule (const unsigned int dim,
32  const int extraorder) const
33 {
34  // Clough elements have at least piecewise cubic functions
35  if (family == CLOUGH)
36  {
37  Order o = static_cast<Order>(std::max(static_cast<unsigned int>(this->default_quadrature_order()),
38  static_cast<unsigned int>(7 + extraorder)));
39  return libmesh_make_unique<QClough>(dim, o);
40  }
41 
42  if (family == SUBDIVISION)
43  return libmesh_make_unique<QGauss>(dim, static_cast<Order>(1 + extraorder));
44 
45  return libmesh_make_unique<QGauss>(dim, static_cast<Order>(this->default_quadrature_order() + extraorder));
46 }
47 
48 } // namespace libMesh
FEFamily family
Definition: fe_type.h:204
Order default_quadrature_order() const
Definition: fe_type.h:333
long double max(long double a, double b)
std::unique_ptr< QBase > default_quadrature_rule(const unsigned int dim, const int extraorder=0) const
Definition: fe_type.C:31