00001 subroutine picard
00002
00003 use global
00004
00005 use mf
00006
00007 use model
00008
00009 implicit none
00010
00011
00012 integer picardIter
00013 integer i,j
00014
00015
00016 integer,pointer :: IM(:,:,:,:)
00017
00018 integer,allocatable :: picardSuccessVec(:)
00019
00020 real(8),allocatable :: myV(:)
00021
00022 real(8),allocatable :: compareVec(:)
00023
00024
00025
00026
00027
00028 real(8),allocatable :: oldVec(:)
00029
00030 real(8) picardTol
00031
00032 real(8) picardNorm
00033
00034
00035 real(8) myP,myD
00036
00037
00038
00039 do i=1,5*5*2
00040
00041
00042
00043
00044 end do
00045
00046
00047
00048
00049
00050 picardTol=1e-5
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070 dof=>myModel%physics(currentPhysics)%dof
00071
00072
00073 allocate(picardSuccessVec(dof))
00074
00075
00076 damping=>myModel%physics(currentPhysics)%damping
00077
00078
00079
00080
00081 pVec=>myModel%pVec
00082
00083 do picardIter=1,maxPicardIter
00084
00085 print*,'#########################'
00086 print*,'picard Iter:',picardIter
00087
00088 picardSuccessVec=0
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099 do i=1,dof
00100
00101 print*,'-----------'
00102
00103 print*,'dof:',i
00104 print*,' '
00105
00106 currentDof=i
00107
00108
00109 do myP=1,size(pVec)
00110
00111 currentPhysics=pVEc(myP)
00112
00113 dVec=>myModel%physics(currentPhysics)%dVec
00114
00115 do myD=1,size(dVec)
00116
00117 currentDomain=dVec(myD)
00118
00119 IM=>myModel%physics(currentPhysics)%domain(currentDomain)%dofMatrix
00120
00121 IM(:,:,:,flag)=0
00122 IM(:,:,i,flag)=1
00123
00124 end do
00125
00126 end do
00127
00128
00129 call currentSet
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141 allocate(oldVec(globalCurrentSetLength))
00142
00143 oldVec=y(setVec)
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176 call Newton
00177
00178
00179
00180
00181
00182 picardNorm=dsqrt(dot_product(y(setVec)-oldVec,y(setVec)-oldVec)/globalcurrentSetLength)
00183
00184 print*,'picardNorm=',picardNorm
00185
00186 if (picardNorm.le.picardTol) then
00187
00188
00189 picardSuccessVec(i)=1
00190
00191 end if
00192
00193
00194
00195
00196
00197 y(setVec)=damping(i)*y(setVec)+oldVec*(1.d0-damping(i))
00198
00199 deallocate(oldVec)
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217 end do
00218
00219 call postProcessor
00220
00221
00222
00223
00224
00225
00226
00227
00228 if (minval(picardSuccessVec).eq.1) then
00229
00230 print*,'picard converged at iter:',picardIter
00231 exit
00232
00233 end if
00234
00235
00236
00237
00238 end do
00239
00240
00241
00242
00243 end subroutine picard