Changeset 5ae8d36


Ignore:
Timestamp:
12/14/10 21:16:51 (2 years ago)
Author:
Oleg Batrashev <ogbash@…>
Branches:
master, external, fix-prolong, refactor, refactor-subsolvers
Children:
82697a3
Parents:
87d2b17
git-author:
Oleg Batrashev <ogbash@…> (12/14/10 21:16:51)
git-committer:
Oleg Batrashev <ogbash@…> (12/14/10 21:16:51)
Message:

Move some precond code back into if block.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/solvers/pcg.F90

    r87d2b17 r5ae8d36  
    416416    isFirstIter = .false. 
    417417    if (present(refactor_)) isFirstIter = refactor_ 
     418    ol=max(sctls%overlap,sctls%smoothers) 
     419 
    418420    if (sctls%method==0) then 
    419421      sol=rhs 
     
    547549        endif 
    548550 
    549         if (.not.(cdat_vec%active)) then 
    550           if (sctls%smoothers==-1) then 
    551             tmpsol2=0.0_rk 
    552             call exact_sparse_multismoother(tmpsol2,A,rhs) 
    553             call SpMtx_Ax(crhs,Restrict,tmpsol2,dozero=.true.) ! restriction 
    554           else 
    555             call SpMtx_Ax(crhs,Restrict,rhs,dozero=.true.) ! restriction 
    556           endif 
     551        if (sctls%method==1) then 
     552           !call Print_Glob_Vect(sol,M,'sol===',chk_endind=M%ninner) 
     553           sol(1:A%nrows)=sol(1:A%nrows)+tmpsol(1:A%nrows) 
     554        elseif (sctls%method==3) then ! fully multiplicative Schwarz 
     555           sol(1:A%nrows)=sol(1:A%nrows)+tmpsol(1:A%nrows) 
     556           ! calculate the residual: 
     557           call SpMtx_Ax(res,A,sol,dozero=.true.) !  
     558           res=rhs-res 
     559        elseif (sctls%method==2.and.ol>0) then ! fully multiplicative Schwarz 
     560           sol(1:A%nrows)=tmpsol(1:A%nrows) 
     561           ! calculate the residual: 
     562           call SpMtx_Ax(res,A,sol,dozero=.true.) !  
     563           res=rhs-res 
    557564        endif 
    558565      endif !} 
    559566 
    560       ol=max(sctls%overlap,sctls%smoothers) 
    561       if (sctls%method==1) then 
    562 !call Print_Glob_Vect(sol,M,'sol===',chk_endind=M%ninner) 
    563         sol(1:A%nrows)=sol(1:A%nrows)+tmpsol(1:A%nrows) 
    564       elseif (sctls%method==3) then ! fully multiplicative Schwarz 
    565         sol(1:A%nrows)=sol(1:A%nrows)+tmpsol(1:A%nrows) 
    566         ! calculate the residual: 
    567         call SpMtx_Ax(res,A,sol,dozero=.true.) !  
    568         res=rhs-res 
    569       elseif (sctls%method==2.and.ol>0) then ! fully multiplicative Schwarz 
    570         sol(1:A%nrows)=tmpsol(1:A%nrows) 
    571         ! calculate the residual: 
    572         call SpMtx_Ax(res,A,sol,dozero=.true.) !  
    573         res=rhs-res 
    574       endif 
    575567      if (sctls%method>1) then ! For multiplicative Schwarz method...: 
    576568        refactor_=.false. 
Note: See TracChangeset for help on using the changeset viewer.