IPPL API Reference
Independent Parallel Particle Layer C++ API
Loading...
Searching...
No Matches
GaussJacobiQuadrature.h
1// Class GaussJacobiQuadrature
2// The GaussJacobiQuadrature class. This is a class representing a Gauss-Jacobi quadrature
3// The algoirthm in computeNodesAndWeights is based on the LehrFEM++ library.
4// https://craffael.github.io/lehrfempp/gauss__quadrature_8cc_source.html
5
6#ifndef IPPL_GAUSSJACOBIQUADRATURE_H
7#define IPPL_GAUSSJACOBIQUADRATURE_H
8
9#include "FEM/Quadrature/Quadrature.h"
10
11namespace ippl {
12
13 enum InitialGuessType {
14 Chebyshev,
15 LehrFEM,
16 };
17
26 template <typename T, unsigned NumNodes1D, typename ElementType>
27 class GaussJacobiQuadrature : public Quadrature<T, NumNodes1D, ElementType> {
28 public:
29 // a higher precision floating point number type used for the computation
30 // of the quadrature nodes and weights
31 using scalar_t = double; // might be equivalant to double, depending on compiler
32
42 GaussJacobiQuadrature(const ElementType& ref_element, const T& alpha, const T& beta,
43 const size_t& max_newton_itersations = 10,
44 const size_t& min_newton_iterations = 1);
45
50 void computeNodesAndWeights() override;
51
59 scalar_t getChebyshevNodes(const size_t& i) const; // FIXME maybe move somewhere else?
60
61 private:
71 scalar_t getLehrFEMInitialGuess(
72 const size_t& i, const Vector<scalar_t, NumNodes1D>& integration_nodes) const;
73
74 const T alpha_m;
75 const T beta_m;
76
77 const size_t max_newton_iterations_m;
78 const size_t min_newton_iterations_m;
79 };
80
89 template <typename T, unsigned NumNodes1D, typename ElementType>
90 class GaussLegendreQuadrature : public GaussJacobiQuadrature<T, NumNodes1D, ElementType> {
91 public:
99 GaussLegendreQuadrature(const ElementType& ref_element,
100 const size_t& max_newton_itersations = 10,
101 const size_t& min_newton_iterations = 1)
102 : GaussJacobiQuadrature<T, NumNodes1D, ElementType>(
103 ref_element, 0.0, 0.0, max_newton_itersations, min_newton_iterations) {}
104 };
105
114 template <typename T, unsigned NumNodes1D, typename ElementType>
115 class ChebyshevGaussQuadrature : public GaussJacobiQuadrature<T, NumNodes1D, ElementType> {
116 public:
124 ChebyshevGaussQuadrature(const ElementType& ref_element,
125 const size_t& max_newton_itersations = 10,
126 const size_t& min_newton_iterations = 1)
127 : GaussJacobiQuadrature<T, NumNodes1D, ElementType>(
128 ref_element, -0.5, -0.5, max_newton_itersations, min_newton_iterations) {}
129 };
130
131} // namespace ippl
132
133#include "FEM/Quadrature/GaussJacobiQuadrature.hpp"
134
135#endif
This is class represents the Chebyshev-Gauss quadrature rule. It is a special case of the Gauss-Jacob...
Definition GaussJacobiQuadrature.h:115
ChebyshevGaussQuadrature(const ElementType &ref_element, const size_t &max_newton_itersations=10, const size_t &min_newton_iterations=1)
Construct a new Chebyshev Gauss Quadrature rule object.
Definition GaussJacobiQuadrature.h:124
This is class represents the Gauss-Jacobi quadrature rule on a reference element.
Definition GaussJacobiQuadrature.h:27
scalar_t getChebyshevNodes(const size_t &i) const
Returns the i-th Chebyshev node, used as initial guess for the Newton iterations.
Definition GaussJacobiQuadrature.hpp:34
void computeNodesAndWeights() override
Definition GaussJacobiQuadrature.hpp:91
This is class represents the Gauss-Legendre quadrature rule. It is a special case of the Gauss-Jacobi...
Definition GaussJacobiQuadrature.h:90
GaussLegendreQuadrature(const ElementType &ref_element, const size_t &max_newton_itersations=10, const size_t &min_newton_iterations=1)
Construct a new Gauss Legendre Quadrature rule object.
Definition GaussJacobiQuadrature.h:99
This is the base class for all quadrature rules.
Definition Quadrature.h:35
Definition Vector.h:23
Definition Archive.h:20