Skip to content
Snippets Groups Projects
Commit ff3405ea authored by Dave Whipp's avatar Dave Whipp
Browse files

Added code to update ematnump on cloud

parent 71dff04f
No related branches found
No related tags found
No related merge requests found
......@@ -126,7 +126,7 @@ if (nremove.gt.0.and.iproc.eq.0) write (8,*) 'Removing ',nremove,' particles'
npswap=cl%np
if (npswap.ne.0) then
allocate (memswap(14,npswap),stat=err) ; if (err.ne.0) call stop_run ('error in alloc memswap in main$')
allocate (imemswap(2,npswap),stat=err) ; if (err.ne.0) call stop_run ('error in alloc imemswap in main$')
allocate (imemswap(3,npswap),stat=err) ; if (err.ne.0) call stop_run ('error in alloc imemswap in main$')
memswap(1,:)=cl%x
memswap(2,:)=cl%y
memswap(3,:)=cl%z
......@@ -143,6 +143,7 @@ if (npswap.ne.0) then
memswap(14,:)=cl%e2dp
imemswap(1,:)=cl%tag
imemswap(2,:)=cl%matnum
imemswap(3,:)=cl%ematnump
endif
deallocate (cl%x)
......@@ -161,6 +162,7 @@ deallocate (cl%lsf0)
deallocate (cl%e2dp)
deallocate (cl%tag)
deallocate (cl%matnum)
deallocate (cl%ematnump)
npnew=cl%np+ninject-nremove
npnew=max(npnew,npswap)
......@@ -181,6 +183,7 @@ allocate (cl%lsf0(npnew),stat=err) ; if (err.ne.0) call stop_run ('error in allo
allocate (cl%e2dp(npnew),stat=err) ; if (err.ne.0) call stop_run ('error in alloc cl%e2dp in main$')
allocate (cl%tag(npnew),stat=err) ; if (err.ne.0) call stop_run ('error in alloc cl%tag in main$')
allocate (cl%matnum(npnew),stat=err) ; if (err.ne.0) call stop_run ('error in alloc cl%matnum in main$')
allocate (cl%ematnump(npnew),stat=err) ; if (err.ne.0) call stop_run ('error in alloc cl%ematnump in main$')
if (npswap.ne.0) then
cl%x(1:npswap)=memswap(1,:)
......@@ -199,6 +202,7 @@ if (npswap.ne.0) then
cl%e2dp(1:npswap)=memswap(14,:)
cl%tag(1:npswap)=imemswap(1,:)
cl%matnum(1:npswap)=imemswap(2,:)
cl%ematnump(1:npswap)=imemswap(3,:)
deallocate (memswap)
deallocate (imemswap)
else
......@@ -209,6 +213,7 @@ else
cl%e2dp=0.d0
cl%tag=1
cl%matnum=0
cl%ematnump=0
endif
! first build location array
......@@ -530,6 +535,7 @@ do i=1,np
cl%e2dp(i-nremovep)=cl%e2dp(i)
cl%tag(i-nremovep)=cl%tag(i)
cl%matnum(i-nremovep)=cl%matnum(i)
cl%ematnump(i-nremovep)=cl%ematnump(i)
endif
enddo
......@@ -556,6 +562,7 @@ do i=1,ninject
cl%ntag=cl%ntag+1
cl%tag(np)=cl%ntag
cl%matnum(np)=0
cl%ematnump(np)=0
enddo
! Assign material number to injected cloud particles using LSFs or elemental
......@@ -622,6 +629,7 @@ if (cl%np.eq.0) then
cl%e2dp(i)=0.d0
cl%tag(i)=i
cl%matnum(i)=0
cl%ematnump(i)=0
enddo
cl%ntag=np
endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment