Electric arcs example
Local variables to be added
The following local variables need to be defined for the examples in this section:
integer iel, mode
integer iesp , idimve
double precision tinit, hinit, coefe(ngazem)
integer, allocatable, dimension(:) :: lstelt
double precision, dimension(:), pointer :: cvar_scalt, cvar_ycoel
double precision, dimension(:), pointer :: cvar_potr, cvar_poti, cvar_potva
Allocation
Before user initialization, work arrays lstelt must be allocated, like in basic example.
Initialization
Some controls are made during initialization:
if ( ippmod(ieljou).ge.1 ) then
write(nfecra,9010)
elseif (ippmod(ielarc).ge.1) then
if (ntcabs.eq.1) then
write(nfecra,9011)
endif
return
endif
Classical initialization:
allocate(lstelt(ncel))
write(nfecra,9001)
if ( isuite.eq.0 ) then
if ( ippmod(ielarc).ge.1 ) then
mode = -1
tinit = t0
coefe(1) = 1.d0
if ( ngazg .gt. 1 ) then
do iesp = 2, ngazg
coefe(iesp) = 0.d0
enddo
endif
call elthht(mode,ngazg,coefe,hinit,tinit)
else
mode = -1
tinit = t0
endif
call field_get_val_s(ivarfl(isca(iscalt)), cvar_scalt)
do iel = 1, ncel
cvar_scalt(iel) = hinit
enddo
if ( ngazg .gt. 1 ) then
call field_get_val_s(ivarfl(isca(iycoel(1))), cvar_ycoel)
do iel = 1, ncel
cvar_ycoel(iel) = 1.d0
enddo
do iesp = 2, ngazg-1
call field_get_val_s(ivarfl(isca(iycoel(iesp))), cvar_ycoel)
do iel = 1, ncel
cvar_ycoel(iel) = 0.d0
enddo
enddo
endif
call field_get_val_s(ivarfl(isca(ipotr)), cvar_potr)
do iel = 1, ncel
cvar_potr(iel) = 0.d0
enddo
if ( ippmod(ieljou).eq.2 .or. ippmod(ieljou).eq.4 ) then
call field_get_val_s(ivarfl(isca(ipoti)), cvar_poti)
do iel = 1, ncel
cvar_poti(iel) = 0.d0
enddo
endif
if ( ippmod(ielarc).ge.2 ) then
do idimve = 1, ndimve
call field_get_val_s(ivarfl(isca(ipotva(idimve))), cvar_potva)
do iel = 1, ncel
cvar_potva(iel) = 0.d0
enddo
enddo
endif
endif
Finalization
At the end of the subroutine, it is recommended to deallocate the work array lstelt, like in basic example.