You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
637 B

2 years ago
function quadpts = gauss2Dbdspts(bds,pts)
%gauss2Dbds Returns tensor product quadature pts and wts over the rectangle
%defined by bds with gaussian quadrature of order pts
% Inputs:
% funct integrand function given as @(x,y)...
% bds [xmin xmax, ymin, ymax] boundaries of rectangular domain
% pts Order of Gaussian quadrature to be used (same in both dirs)
%
% Outputs:
% I value of integral
[x, wx] = GaussLegendreQuad1D(pts,bds(1),bds(2));
[y, wy] = GaussLegendreQuad1D(pts,bds(3),bds(4));
[s,t]=meshgrid(x,y);
ss=s(:); tt=t(:);
w2=wx'*wy;
quadpts= [ss,tt,w2(:)];
end