I have been looking for a numerical quadrature that might be possible to pre-assign specific nodes.
For instance, I need to numerically calculate the integral of $f(x)$ in the interval $[a,b]$ but the point $y \in [a,b]$ must be a node of such quadrature. Of course that $\int_a^b f(x) = \int_a^x f(x) + \int_x^b f(x)$, and I could apply any quadrature rule to both integrals (Trapezoidal rule, Boole's rule, Gauss-Kronrod...) but if I have more that one point I will need to split the integral into several other integrals and computationally, my code will be bigger than calculating just an entire mesh.
Is there any way to adapt any quadrature to pass through specific nodes? Is there a quadrature or some way to be able to calculate a list of nodes and weights passing into specific nodes?
A Gaussian-like method will work. Gaussian chooses the abscissa (points) to be the zeros of specific polynomials to get higher accuracy (or, to be specific, exactness for a larger set of polynomials). However you can choose arbitrary points, sacrificing the higher-order exactness.
Let's call the weights $\left\{w_i\right\}$ and the abscissa $\left\{y_i\right\}$. The recipe is to integrate polynomials over $[a,b]$ up to order $N$ which gives you a matrix
$$ \begin{bmatrix} 1 & 1 & 1 & \cdots \\ y_0 & y_1 & y_2 & \cdots \\ y_0^2 & y_1^2 & y_2^2 & \cdots \\ \vdots & \vdots & \vdots & \ddots \end{bmatrix} \begin{bmatrix} w_0 \\ w_1 \\ w_2 \\ \vdots \end{bmatrix} =\begin{bmatrix} b-a \\ \frac{1}{2}\left(b^2-a^2\right) \\ \frac{1}{3}\left(b^3-a^3\right) \\ \vdots \end{bmatrix} $$ which you can solve for the weights $\left\{w_i\right\}$. The error will be proportional to the $N^{th}$ derivative of $f(x)$ evaluated somewhere in $[a,b]$.
You could also shift so that you are over the interval $[-1,1]$ and use the Legendre polynomials as integrands, which simplifies the matrix a bit.