% ************************************************************** % lbem2 : Sets up matrices for BEM for Laplace's Equation % ************************************************************** % BEM-LAP-MAT project % Matlab/Freemat codes % Copyright 2008- Stephen Kirkup % John Tyndall Nuclear Research Institute % School of Computing Engineering and Physical Sciences % University of Central Lancashire - www.uclan.ac.uk % Westlakes Campus % Samuel Lindow Building % West Lakes Science and Technology Park % Whitehaven % Cumbria CA24 3JY % United Kingdom % smkirkup@uclan.ac.uk % % This open source code can be found at % boundary-element-method.com/freematlab/lbem2.m % % Issued under the GNU General Public License 2007, see gpl.txt % % Part of the the author's open source BEM packages. % All codes and manuals can be downloaded from % www.boundary-element-method.com % % ************************************************************** % function [L,M,Mt,N] = lbem2(m,p,vecp,n,vertpts,elemvert,p_on,needL,needM,needMt,needN) % Sets up the matrices required in the boundary element method % for m (observation) points p with a vector (derivative) direction of % vecp at the points p. The boundary is made up of n elements; vertpts lists the coordinates % of the edges of the elements and elemvert lists the pairs of vertices % that define each element. p_on idicates whether the point p(i) lies on the ith panel. % needL,needM,needMt,needN indicate which matrices are needed by being set to true. function [L,M,Mt,N] =lbem2(m,p,vecp,n,vertpts,elemvert,p_on,needL,needM,needMt,needN) [qa,qb]=vertices(n,vertpts,elemvert); for (i=1:m) for (j=1:n) [L(i,j),M(i,j),Mt(i,j),N(i,j)]=l2lc(p(i,:),vecp(i,:),qa(j,:),qb(j,:),p_on&i==j,needL,needM,needMt,needN); end end