Changeset e083829 for src/main/aggr.F90
- Timestamp:
- 03/05/11 13:48:20 (2 years ago)
- Branches:
- master, external
- Children:
- e8c8f58
- Parents:
- ea465d3
- git-author:
- Oleg Batrashev <ogbash@…> (03/05/11 13:48:20)
- git-committer:
- Oleg Batrashev <ogbash@…> (03/05/11 13:48:20)
- File:
-
- 1 edited
-
src/main/aggr.F90 (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/main/aggr.F90
rea465d3 re083829 92 92 #endif 93 93 94 type(SpMtx) :: AC !< coarse matrix95 type(SpMtx) :: Restrict !< Restriction matrix (for operation)96 94 type(SumOfInversedSubMtx) :: B_RCS !< B matrix for the Robust Coarse Spaces 97 95 !type(SpMtx) :: Rest_cmb !< Restriction matrix (for coarse matrix build) … … 124 122 integer,pointer :: aggrnum(:) 125 123 integer :: nagr 126 ! Parallel coarse level127 !type(CoarseData) :: CP%cdat --128 124 129 125 ! Init DOUG … … 157 153 endif 158 154 155 CP = CoarsePreconditioner_New() 159 156 ! Testing coarse matrix and aggregation through it: 160 157 if (numprocs>1) then 158 CP%type = COARSE_PRECONDITIONER_TYPE_SMOOTH 161 159 allocate(aggrnum(D%mesh%nlf)) 162 160 nagr = P%fAggr%inner%nagr … … 170 168 call SpMtx_unscale(D%A) 171 169 172 call IntRestBuild(D%A,P%fAggr%inner, Restrict,D%A_ghost)173 CS = CoarseSpace_Init( Restrict)170 call IntRestBuild(D%A,P%fAggr%inner,CP%R,D%A_ghost) 171 CS = CoarseSpace_Init(CP%R) 174 172 call CoarseData_Copy(CP%cdat,CP%cdat_vec) 175 call CoarseSpace_Expand(CS, Restrict,D%mesh,CP%cdat)176 call CoarseMtxBuild(D%A,CP%cdat%LAC, Restrict,D%mesh%ninner,D%A_ghost)177 call KeepGivenRowIndeces( Restrict, (/(i,i=1,P%fAggr%inner%nagr)/))173 call CoarseSpace_Expand(CS,CP%R,D%mesh,CP%cdat) 174 call CoarseMtxBuild(D%A,CP%cdat%LAC,CP%R,D%mesh%ninner,D%A_ghost) 175 call KeepGivenRowIndeces(CP%R, (/(i,i=1,P%fAggr%inner%nagr)/)) 178 176 179 177 if (sctls%verbose>3.and.CP%cdat%LAC%nnz<400) then 180 write(stream,*)' Restrict(local) is:=================='181 call SpMtx_printRaw(A= Restrict)178 write(stream,*)'CP%R (local) is:==================' 179 call SpMtx_printRaw(A=CP%R) 182 180 write(stream,*)'A coarse (local) is:==================' 183 181 call SpMtx_printRaw(A=CP%cdat%LAC) … … 186 184 else 187 185 ! non-parallel 188 call IntRestBuild(D%A,P%fAggr%inner, Restrict)186 call IntRestBuild(D%A,P%fAggr%inner,CP%R) 189 187 190 188 if (sctls%coarse_method<=1) then ! if not specified or ==1 191 call CoarseMtxBuild(D%A,AC,Restrict,D%mesh%ninner) 189 CP%type = COARSE_PRECONDITIONER_TYPE_SMOOTH 190 call CoarseMtxBuild(D%A,CP%AC,CP%R,D%mesh%ninner) 192 191 193 192 else if (sctls%coarse_method==2) then 194 ! use the Robust Coarse Spaces algorithm 195 B_RCS = CoarseProjectionMtxsBuild(D%A,Restrict,P%fAggr%inner%nagr) 193 ! use the Robust Coarse Spaces algorithm 194 CP%type = COARSE_PRECONDITIONER_TYPE_ROBUST 195 196 B_RCS = CoarseProjectionMtxsBuild(D%A,CP%R,P%fAggr%inner%nagr) 196 197 allocate(rhs_1(D%A%nrows)) 197 198 allocate(g(D%A%ncols)) … … 204 205 end if 205 206 206 call RobustRestrictMtxBuild(B_RCS,g, Restrict)207 call CoarseMtxBuild(D%A, AC,Restrict,D%mesh%ninner)207 call RobustRestrictMtxBuild(B_RCS,g,CP%R) 208 call CoarseMtxBuild(D%A,CP%AC,CP%R,D%mesh%ninner) 208 209 209 210 else … … 212 213 endif 213 214 214 if (sctls%verbose>3.and. AC%nnz<400) then215 if (sctls%verbose>3.and.CP%AC%nnz<400) then 215 216 write(stream,*)'A coarse is:==================' 216 call SpMtx_printRaw(A= AC)217 call SpMtx_printRaw(A=CP%AC) 217 218 endif 218 219 endif … … 220 221 ! coarse aggregates 221 222 if (numprocs==1) then 222 call Partitionings_CreateCoarse(P,D, AC)223 call Partitionings_CreateCoarse(P,D,CP%AC) 223 224 !call Aggrs_readFile_coarse(P%cAggr, "aggregates.txt") 224 225 … … 283 284 ! Preconditioned conjugate gradient 284 285 t1 = MPI_WTIME() 285 if (sctls%levels==2) then 286 write(stream,*)'calling pcg_weigs with coarse matrix' 287 call pcg_weigs(A=D%A,b=D%rhs,x=xl,Msh=D%mesh,finePrec=FP,coarsePrec=CP,it=it,cond_num=cond_num, & 288 A_interf_=D%A_ghost, & 289 CoarseMtx_=AC,Restrict=Restrict, & 286 write(stream,*)'calling pcg_weigs' 287 call pcg_weigs(A=D%A,b=D%rhs,x=xl,Msh=D%mesh,& 288 finePrec=FP,coarsePrec=CP,& 289 it=it,cond_num=cond_num, A_interf_=D%A_ghost, & 290 290 refactor_=.true.) 291 else292 write(stream,*)'calling pcg_weigs'293 call pcg_weigs(D%A, D%rhs, xl, D%mesh,FP,CP,it,cond_num, &294 A_interf_=D%A_ghost, refactor_=.true.)295 endif296 291 t=MPI_WTIME()-t1 297 292 write(stream,*) 'time spent in pcg():',t
Note: See TracChangeset
for help on using the changeset viewer.
