Hi,
Your question is certainly a reasonable one. The boundary matrix format in those files is unquestionably difficult to decode.
I suggest an alternate approach instead of trying to decipher those example files. This example boundary file below will define a zero Neumann boundary condition on all edges of a model-- a square or something much more complicated.
function [ q, g, h, r ] = boundaryFileZeroNeumann( p, e, u, time )
N = 1
ne = size(e,2);
q = zeros(N^2, ne);
g = zeros(N, ne);
h = zeros(N^2, 2*ne);
r = zeros(N,2*ne);
end
The line N = 1 says that you have a single PDE (i.e. a scalar PDE) in your system. If you have more than one, you need to change this line. You can pass this function to assempde or the other high-level PDE Toolbox functions by defining
b = @boundaryFileZeroNeumann;
This function is a very simple boundary file example. You can easily generalize this to an arbitrary combination of Dirichlet and Neumann conditions. Take a look at this documentation page if you are interested in doing that.
Bill
Best Answer