File size: 1,017 Bytes
bc2cdff | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | % Computation of the Dirichlet-to-Neumann map as a matrix acting
% in trigonometric basis. Omega is the unit disc.
%
% We actually precompute the Neumann-to-Dirichlet map using FEM,
% and then find DN map by inverting the ND map and adding
% appropriate mapping of constant functions.
%
% We compute in addition the DN map related to the constant
% conductivity 1 (analytically)
% and save both DN matrices to file data/ex2DN.mat.
%
% Routine ND_comp.m must be run before this file.
%
% Samuli Siltanen June 2012
% Load precomputed data
load data/ND NtoD Nvec Ntrig
% Invert the ND matrix to get DN matrix in trigonometric basis apart
% from constant functions.
DN = inv(NtoD);
% Add appropriate zero row and zero column
DN = [DN(:,1:Ntrig),zeros(2*Ntrig,1),DN(:,Ntrig+1:end)];
DN = [DN(1:Ntrig,:);zeros(1,2*Ntrig+1);DN(Ntrig+1:end,:)];
% Compute DN map of unit conductivity (analytically)
DN1 = abs(diag([-Ntrig:Ntrig]));
% Save result to file
save data/ex2DN DN DN1 Ntrig
|