function [lm,mesh] = One_Correction_Step_Nonsymmetric_Grid_Adap(mesh0,mesh,eta,theta,lmb1,A1,M1,Base,...
                     coeff,mass,coeff_mix,...
                     coord3,coord4,Eigen_Low,Eigen_Up,u_D,u_N)
        
%==========================================================================        
%  Do the one correction step for the nonsymetric eigenvalue problem with
%  the multi space way
%  Mesh: the current mesh for the finite element discretization
%  lmb1: the current eigenvalue approximation
%  A1,M1: the background stiff and mass matrices
%  Base0: the background base function
%  xv1: the current right hand eigenfunction on Base1
%  xv2: the current left hand eigenfunction on Base2
%  coeff: the coeffieient function for the stiff matrix
%  mass: the coefficient function for the mass matrix 
%  coeff_mix: the coefficient function for the mixed matrix
%  corrd3, corrd4: the quadrature information for building matrices
%  Eigen_Low, Eigen_Up: the interval for the eigenvalue solution with the
%  Arnoldi method
%  u_D, u_N: the boundary condition for the Dirichlet or Neumann type ssss
%============hehu Xie======================================
%   2012-10-09
%==========================================================================
fprintf('Do the correction step for the nonsymetric eigenvalue problem!\n');
%-------------get the number of the eigenvalues----------------------------
Num_Eig = length(lmb1);
%---------------Refine the mesh and the solution---------------------------
[mesh,eta] = bisection_Adap_Multi(mesh,eta,theta,Base);
xv1 = mesh.solu(:,1:Num_Eig);
xv2 = mesh.solu(:,Num_Eig+1:end);
%-----------To do the correction first time--------------------------------
%-----------Solve the boundary value problem-------------------------------
Mix = mix_matrix(Base,Base,coord3,coord4,mesh,coeff_mix);
A = stiff_matrix(Base,Base,coord3,coord4,mesh,coeff);
%--------------------------------------------------------------------------
M = mass_matrix(Base,Base,coord3,coord4,mesh,mass);
RHS = M*xv1*diag(lmb1);
AA = Mix' + A;
[AA,RHS] = Poission_BoundaryTreatment(mesh,Base,u_D,AA,RHS);
xv1 = AA\RHS;
%---------correction for the adjoint eigenvalue problem--------------------
RHS = M*xv2*diag(lmb1);
AA = AA';
[AA,RHS] = Poission_BoundaryTreatment(mesh,Base,u_D,AA,RHS);
xv2 = AA\RHS;
%-----------Solve the adjoint system---------------------------------------
%---------to do the correction second time-------------------------------
%-----------A12-----------------------
A_Multi = stiff_matrix_Multi(Base,Base,coord3,coord4,mesh0,mesh,coeff);
M_Multi = mass_matrix_Multi(Base,Base,coord3,coord4,mesh0,mesh,mass);
[B1,B2] = mix_matrix_Multi_Elliptic(Base,Base,coord3,coord4,mesh0,mesh,coeff_mix);
%--------------------------------------
b1n = xv1' * (A_Multi' + B2);
%-----------A21-----------------------
b2n = (A_Multi + B1) * xv1;
%-----------A22-----------------------
ann = xv1' * (A + Mix) * xv1;
%------------Build the stiff matrix for the iegenvalue problem-------------
D = [A1,b1n';b2n',ann];
%-------build the mass matirx: symmetric-----------------------------------
b1n = xv1'*M_Multi';
Mass = [M1,b1n';b1n,xv1'*M*xv1];
[D,Mass] = Poission_BoundaryTreatment(mesh0,Base,u_D,D,Mass);
% %---eigenvalue-----------------------------------------------------------
tic;
[xvv1,lm,iresult]=sptarn(D,Mass,Eigen_Low,Eigen_Up);
lm  = lm(1:Num_Eig);
xvv1 = xvv1(:,1:Num_Eig);
toc
'right problem'
lm
%------------Produce the solution of the multi-level solution xvv1---------
xv1 = Get_Solution_Multilevel(Base,mesh0,xvv1(1:end-Num_Eig,:),...
        Base,mesh,xvv1(end-Num_Eig+1:end,:),xv1);  
%--------------------------------------------------------------------------
[v_max,index] = max(abs(xv1(:,1)));
v_max = xv1(index,1);
xv1 = xv1(:,1)/v_max; 
%--------------------------------------------------------------------------
%------------For the adjoint eigenvalue problem----------------------------
%--------------------------------------------------------------------------
A1 = A1';
%-----------A12-----------------------
b1n = xv2'*(A_Multi' - B1');
%-----------A21-----------------------
b2n = (A_Multi - B2')*xv2;
%-----------A22-----------------------
ann = xv2' * (A - Mix') * xv2;
%------------Build the stiff matrix for the iegenvalue problem-------------
D = [A1,b2n;b1n,ann];
%-------build the mass matirx: symmetric-----------------------------------
b1n = xv2'*M_Multi';
Mass = [M1,b1n';b1n,xv2'*M*xv2];
[D,Mass] = Poission_BoundaryTreatment(mesh0,Base,u_D,D,Mass);
% %---eigenvalue-----------------------------------------------------------
tic;
[xvv2,lm,iresult]=sptarn(D,Mass,Eigen_Low,Eigen_Up);
xvv2 = xvv2(:,1:Num_Eig);
toc
'left problem'
lm
A1 = A1';
%------------Produce the solution of the multi-level solution xvv1---------
xv2 = Get_Solution_Multilevel(Base,mesh0,xvv2(1:end-Num_Eig,:),...
        Base,mesh,xvv2(end-Num_Eig+1:end,:),xv2);
%--------------------------------------------------------------------------    
[v_max,index] = max(abs(xv2(:,1)));
v_max = xv2(index,1);
xv2 = xv2(:,1)/v_max;  
mesh.solu = [xv1(:,1),xv2(:,1)];    