libMesh
fe_type.C
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2017 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"
20 #include "libmesh/quadrature_clough.h"
21 #include "libmesh/quadrature_gauss.h"
22 
23 namespace libMesh
24 {
25 
26 // ---------------------------------------
27 // FEType class members
28 
29 UniquePtr<QBase>
31  const int extraorder) const
32 {
33 
34  // Clough elements have at least piecewise cubic functions
35  if (family == CLOUGH)
36  {
37  // this seems ridiculous but for some reason gcc 3.3.5 wants
38  // this when using complex numbers (spetersen 04/20/06)
39  const unsigned int seven = 7;
40 
41  return UniquePtr<QBase>
42  (new QClough(dim,
43  static_cast<Order>
44  (std::max(static_cast<unsigned int>
45  (this->default_quadrature_order()), seven + extraorder))));
46  }
47 
48  if (family == SUBDIVISION)
49  return UniquePtr<QBase>
50  (new QGauss(dim, static_cast<Order>(1 + extraorder)));
51 
52  return UniquePtr<QBase>
53  (new QGauss(dim, static_cast<Order>(this->default_quadrature_order()
54  + extraorder)));
55 }
56 
57 } // namespace libMesh
FEFamily family
The type of finite element.
Definition: fe_type.h:203
unsigned int dim
The libMesh namespace provides an interface to certain functionality in the library.
long double max(long double a, double b)
std::unique_ptr< T > UniquePtr
Definition: auto_ptr.h:46
Order default_quadrature_order() const
Definition: fe_type.h:332
UniquePtr< QBase > default_quadrature_rule(const unsigned int dim, const int extraorder=0) const
Definition: fe_type.C:30
This class implements specific orders of Gauss quadrature.