function [lm,xv1,xv2,mesh,lm_dir] = One_Correction_Step_Nonsymmetric_Grid_Complex(mesh0,mesh,lmb1,A1,M1,Base,...
                     xv1,xv2,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---------------------------
xv = [xv1,xv2];
[mesh,xv] = refinement_multi(mesh,xv,Base);
xv1 = xv(:,1:Num_Eig);
xv2 = xv(:,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 = A + Mix';
[AA,RHS] = Poission_BoundaryTreatment(mesh,Base,u_D,AA,RHS);
xv1 = AA\RHS;
if nargout == 5
    [AA,M] = Poission_BoundaryTreatment(mesh,Base,u_D,AA,M);
    [xv_dir,lm_dir,iresult] = sptarn(AA,M,Eigen_Low,Eigen_Up);
    lm_dir
end
%---------correction for the adjoint eigenvalue problem--------------------
%-----------Solve the adjoint system---------------------------------------
RHS = M*xv2;  
AA = A + Mix;
[AA,RHS] = Poission_BoundaryTreatment(mesh,Base,u_D,AA,RHS);
xv2 = AA\RHS;
%---------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 = xv2' * (A_Multi' + B1');
%-----------A21-----------------------
b2n = (A_Multi + B2') * xv1;
%-----------A22-----------------------
ann = xv2' * (A + Mix') * xv1;
%------------Build the stiff matrix for the iegenvalue problem-------------
D = [A1,b2n;b1n,ann];
%-------build the mass matirx: symmetric-----------------------------------
b1n = xv2'*M_Multi';
b2n = M_Multi*xv1;
Mass = [M1,b2n;b1n,xv2'*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); 
xv1 = xv1*diag(1./diag(xv1'*M*xv1));
%--------------------------------------------------------------------------
%------------For the adjoint eigenvalue problem----------------------------
%--------------------------------------------------------------------------
D = D';
Mass = Mass';
[D,Mass] = Poission_BoundaryTreatment(mesh0,Base,u_D,D,Mass);
% %---eigenvalue-----------------------------------------------------------
tic;
[xvv2,lm_left,iresult]=sptarn(D,Mass,Eigen_Low,Eigen_Up);
xvv2 = xvv2(:,1:Num_Eig);
toc
'left problem'
lm_left
%------------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);
xv2 = xv2*diag(1./diag(xv2'*M*xv2));
%lm = diag((xv2'*(A+Mix')*xv1)./(xv2'*M*xv1));