Functionality related to computing quadrature nodes and weights. More...
Classes | |
class | ClenshawCurtis |
Quadrature handler for Clenshaw-Curtis quadrature. More... | |
class | GaussLegendre |
Quadrature handler for Gauss-Legendre quadrature. More... | |
class | GaussLobatto |
Quadrature handler for Gauss-Lobatto quadrature. More... | |
class | GaussRadau |
Quadrature handler for Gauss-Radau quadrature. More... | |
class | IQuadrature |
Interface for quadrature handlers. More... | |
class | Polynomial |
Representation of a polynomial including differentiation, integration and root finding. More... | |
class | Uniform |
Quadrature handler for uniform distributed nodes. More... | |
Enumerations | |
enum | QuadratureType : int { QuadratureType::GaussLegendre = 0, QuadratureType::GaussLobatto = 1, QuadratureType::GaussRadau = 2, QuadratureType::ClenshawCurtis = 3, QuadratureType::Uniform = 4, QuadratureType::UNDEFINED = -1 } |
Quadrature type descriptors. More... | |
Functions | |
template<typename scalar > | |
static Polynomial< scalar > | build_polynomial (const size_t node, const vector< scalar > &nodes) |
template<typename scalar > | |
static Matrix< scalar > | compute_q_matrix (const vector< scalar > &from, const vector< scalar > &to) |
Compute quadrature matrix \( Q \) between two sets of nodes. More... | |
template<typename scalar > | |
static Matrix< scalar > | compute_q_matrix (const vector< scalar > &nodes) |
Compute quadrature matrix \( Q \) for one set of nodes. More... | |
template<typename scalar > | |
static Matrix< scalar > | compute_q_matrix (const Matrix< scalar > &s_mat) |
Compute quadrature matrix \( Q \) from a given node-to-node quadrature matrix \( S \). More... | |
template<typename scalar > | |
static Matrix< scalar > | compute_s_matrix (const Matrix< scalar > &q_mat) |
Compute node-to-node quadrature matrix \( S \) from a given quadrature matrix \( Q \). More... | |
template<typename scalar > | |
static Matrix< scalar > | compute_s_matrix (const vector< scalar > &from, const vector< scalar > &to) |
Compute node-to-node quadrature matrix \( S \) from two given sets of nodes. More... | |
template<typename scalar > | |
static vector< scalar > | compute_q_vec (const vector< scalar > &nodes) |
Compute vector \( q \) for integration from \( 0 \) to \( 1 \) for given set of nodes. More... | |
template<typename precision = pfasst::time_precision> | |
shared_ptr< IQuadrature< precision > > | quadrature_factory (const size_t nnodes, const QuadratureType qtype) |
Instantiates quadrature handler for given number of nodes and type descriptor. More... | |
template<typename precision = pfasst::time_precision> | |
vector< precision > | compute_nodes (size_t nnodes, QuadratureType qtype) |
Compute quadrature nodes for given quadrature type descriptor. More... | |
template<typename precision = time_precision> | |
Matrix< precision > | compute_interp (vector< precision > dst, vector< precision > src) |
Functionality related to computing quadrature nodes and weights.
|
strong |
Quadrature type descriptors.
Enumerator | |
---|---|
GaussLegendre |
Gauss-Legendre quadrature |
GaussLobatto |
Gauss-Lobatto quadrature |
GaussRadau |
Gauss-Radau quadrature |
ClenshawCurtis |
Clenshaw-Curtis quadrature |
Uniform |
Uniform quadrature. |
UNDEFINED |
Definition at line 32 of file interface.hpp.
|
static |
Definition at line 43 of file interface.hpp.
Referenced by compute_q_matrix(), and compute_q_vec().
Matrix<precision> pfasst::quadrature::compute_interp | ( | vector< precision > | dst, |
vector< precision > | src | ||
) |
precision | numerical type of the interpolation (e.g. double ) |
Definition at line 95 of file quadrature.hpp.
vector<precision> pfasst::quadrature::compute_nodes | ( | size_t | nnodes, |
QuadratureType | qtype | ||
) |
Compute quadrature nodes for given quadrature type descriptor.
precision | numerical type of the nodes (e.g. double ) |
[in] | nnodes | number of quadrature nodes to compute |
[in] | qtype | type descriptor of the quadrature nodes |
Definition at line 84 of file quadrature.hpp.
|
static |
Compute quadrature matrix \( Q \) between two sets of nodes.
Computing the quadrature matrix \( Q \) for polynomial-based integration from one set of quadrature nodes (from
) to another set of quadrature nodes (to
).
scalar | precision of quadrature (i.e. double ) |
[in] | from | first set of quadrature nodes |
[in] | to | second set of quadrature nodes |
to.size()
rows and from.size()
columsDefinition at line 80 of file interface.hpp.
References build_polynomial(), pfasst::quadrature::Polynomial< CoeffT >::evaluate(), and pfasst::quadrature::Polynomial< CoeffT >::integrate().
Referenced by pfasst::quadrature::IQuadrature< precision >::compute_weights().
|
static |
Compute quadrature matrix \( Q \) for one set of nodes.
scalar | precision of quadrature (i.e. double ) |
[in] | nodes | quadrature nodes to compute \( Q \) matrix for |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 113 of file interface.hpp.
|
static |
Compute quadrature matrix \( Q \) from a given node-to-node quadrature matrix \( S \).
scalar | precision of quadrature (i.e. double ) |
[in] | s_mat | \( S \) matrix to compute \( Q \) from |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 131 of file interface.hpp.
Referenced by compute_s_matrix().
|
static |
Compute vector \( q \) for integration from \( 0 \) to \( 1 \) for given set of nodes.
This equals to the last row of the quadrature matrix \( Q \) for the given set of nodes.
scalar | precision of quadrature (i.e. double ) |
[in] | nodes | quadrature nodes to compute \( Q \) matrix for |
Definition at line 200 of file interface.hpp.
References build_polynomial(), pfasst::quadrature::Polynomial< CoeffT >::evaluate(), and pfasst::quadrature::Polynomial< CoeffT >::integrate().
Referenced by pfasst::quadrature::IQuadrature< precision >::compute_weights().
|
static |
Compute node-to-node quadrature matrix \( S \) from a given quadrature matrix \( Q \).
The \( S \) matrix provides a node-to-node quadrature where the \( i \)-th row of \( S \) represents a quadrature from the \( i-1 \)-th node to the \( i \)-th node.
The procedure is simply subtracting the \( i-1 \)-th row of \( Q \) from the \( i \)-th row of \( Q \).
scalar | precision of quadrature (i.e. double ) |
[in] | q_mat | \( Q \) matrix to compute \( S \) of |
Definition at line 158 of file interface.hpp.
Referenced by pfasst::quadrature::IQuadrature< precision >::compute_weights().
|
static |
Compute node-to-node quadrature matrix \( S \) from two given sets of nodes.
scalar | precision of quadrature (i.e. double ) |
[in] | from | first set of quadrature nodes |
[in] | to | second set of quadrature nodes |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 181 of file interface.hpp.
References compute_q_matrix().
shared_ptr<IQuadrature<precision> > pfasst::quadrature::quadrature_factory | ( | const size_t | nnodes, |
const QuadratureType | qtype | ||
) |
Instantiates quadrature handler for given number of nodes and type descriptor.
precision | numerical type of the nodes (e.g. double ) |
[in] | nnodes | number of quadrature nodes |
[in] | qtype | type descriptor of the quadrature |
pfasst::ValueError | if qtype is not a valid quadrature type descriptor |
Definition at line 53 of file quadrature.hpp.
Referenced by pfasst::examples::advection_diffusion::run_mpi_pfasst(), pfasst::examples::scalar::run_scalar_sdc(), pfasst::examples::advection_diffusion::run_serial_mlsdc(), pfasst::examples::advection_diffusion::run_vanilla_sdc(), and pfasst::examples::vdp::run_vdp_sdc().