[phy, cfg] = case_config();
load(cfg.meshMatFile);
mesh.incIndex = findTri(phy.inc, mesh);
mesh.outIndex = findTri(phy.out, mesh);
[mesh.PBCIndex, mesh.origIndex] = findPBCIndex(phy.src, phy.dst, cfg.pbcAngle, mesh);
mesh.PBCphi = cfg.pbcPhi;
xr = dlmread('matlab_x_real.txt');
xi = dlmread('matlab_x_imag.txt');
solver.x = xr + 1i*xi;
solver.dof = numel(solver.x);
% reconstruct vertex fields like C++ post
try
  [~,~,~,nEv] = get_ele_vertices(mesh, solver);
  fid=fopen('matlab_norme_vert.txt','w');
  fprintf(fid,'max=%.6g\nmean=%.6g\nmin=%.6g\nn=%d\n', max(nEv(:)), mean(nEv(:)), min(nEv(:)), numel(nEv));
  fclose(fid);
  dlmwrite('matlab_normE_vert.txt', nEv(:), 'precision', 16);
  fprintf('vertex OK max=%.6g\n', max(nEv(:)));
catch ME
  fprintf('err %s\n', ME.message);
end