%
% @file pde1dp_cmpl.m
%
% @brief
%
% @copyright
% Copyright (©) 2021 EPFL (Ecole Polytechnique Fédérale de Lausanne)
% SPC (Swiss Plasma Center)
%
% SPClibs is free software: you can redistribute it and/or modify it under
% the terms of the GNU Lesser General Public License as published by the Free
% Software Foundation, either version 3 of the License, or (at your option)
% any later version.
%
% SPClibs is distributed in the hope that it will be useful, but WITHOUT ANY
% WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
% FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
%
% You should have received a copy of the GNU Lesser General Public License
% along with this program. If not, see .
%
% @author
% (in alphabetical order)
% @author Trach-Minh Tran
%
file='pde1dp_cmpl.h5';
xgrid=hdf5read(file,'/xgrid');
nx = size(xgrid)-1;
rhs=h5Complex(file, '/rhs');
sol=h5Complex(file, '/sol');
%mat=h5Complex(file, '/mat');
x=hdf5read(file,'/x');
solana=h5Complex(file,'/solana');
solcal=h5Complex(file,'/solcal');
err=hdf5read(file, '/err');
figure
subplot(211)
plot(x, real(solana),x,imag(solana),x,real(solcal),'o',x, ...
imag(solcal), '*')
legend('Exact Real', 'Exact Imag', 'Calc. Real', 'Calc. Imag')
xlabel('X'); ylabel('SOL');
subplot(212)
plot(x, err, 'o-');
xlabel('X'); ylabel('|Error|')
grid on