G+Smo  24.08.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsGaussRule.h
Go to the documentation of this file.
1 
14 #pragma once
15 
16 #include <gsAssembler/gsQuadRule.h>
17 
18 namespace gismo
19 {
20 
26 template<class T>
27 class gsGaussRule GISMO_FINAL : public gsQuadRule<T>
28 {
29 public:
30 
31  typedef memory::unique_ptr<gsGaussRule> uPtr;
32 
35 
38  const unsigned digits = 0 )
39  {
40  gsGaussRule::setNodes(numNodes, digits);
41  }
42 
44  static uPtr make(gsVector<index_t> const & numNodes,
45  const unsigned digits = 0 )
46  { return uPtr( new gsGaussRule(numNodes,digits) ); }
47 
49  gsGaussRule(index_t numNodes, const unsigned digits = 0 )
50  {
51  this->setNodes(numNodes, digits);
52  }
53 
56  gsGaussRule(const gsBasis<T> & basis, const T quA, const index_t quB, short_t fixDir = -1);
57  //const unsigned digits = std::numeric_limits<T>::digits10 );
58 
62  gsGaussRule(const gsBasis<T> & basis, const gsOptionList & options, short_t fixDir = -1);
63  //const unsigned digits = std::numeric_limits<T>::digits10 );
64 
65  ~gsGaussRule() { }
66 
67 public:
68  // see gsQuadRule.h for documentation
69  void setNodes( gsVector<index_t> const & numNodes,
70  unsigned digits = 0 );
71 
72  using gsQuadRule<T>::setNodes; // unhide base
73 
74 private:
75 
76  void init(const gsBasis<T> & basis, const T quA, const index_t quB, short_t fixDir);
77 
83  static void computeReference(index_t n, gsVector<T> & x, gsVector<T> & w,
84  unsigned digits = 0 );
85 
93  static bool lookupReference (index_t n, gsVector<T> & x, gsVector<T> & w);
94 
95 }; // class gsGaussRule
96 
97 
98 } // namespace gismo
99 
100 
101 #ifndef GISMO_BUILD_LIB
102 #include GISMO_HPP_HEADER(gsGaussRule.hpp)
103 #endif
Provides a base class for a quadrature rule.
Class representing a reference quadrature rule.
Definition: gsQuadRule.h:28
#define short_t
Definition: gsConfig.h:35
#define index_t
Definition: gsConfig.h:32
void setNodes(gsVector< index_t > const &numNodes, unsigned digits=0)
Initialize quadrature rule with numNodes number of quadrature points per integration variable...
Definition: gsGaussRule.hpp:95
gsGaussRule()
Default empty constructor.
Definition: gsGaussRule.h:34
gsGaussRule(index_t numNodes, const unsigned digits=0)
Initialize a 1D Gauss quadrature rule with numNodes.
Definition: gsGaussRule.h:49
static bool lookupReference(index_t n, gsVector< T > &x, gsVector< T > &w)
Look up function for the Gauss quadrature rule in the interval [-1,1].
Definition: gsGaussRule.hpp:218
Class which holds a list of parameters/options, and provides easy access to them. ...
Definition: gsOptionList.h:32
index_t numNodes() const
Number of nodes in the currently kept rule.
Definition: gsQuadRule.h:106
Class that represents the (tensor) Gauss-Legendre quadrature rule.
Definition: gsGaussRule.h:27
gsGaussRule(gsVector< index_t > const &numNodes, const unsigned digits=0)
Initialize a tensor-product Gauss quadrature rule with numNodes (direction-wise)
Definition: gsGaussRule.h:37
A basis represents a family of scalar basis functions defined over a common parameter domain...
Definition: gsBasis.h:78
static void computeReference(index_t n, gsVector< T > &x, gsVector< T > &w, unsigned digits=0)
Computes the Gauss quadrature rule with n nodes in the interval [-1,1].
Definition: gsGaussRule.hpp:122
static uPtr make(gsVector< index_t > const &numNodes, const unsigned digits=0)
Make function returning a smart pointer.
Definition: gsGaussRule.h:44