16 procedure:: pre_update
19 integer:: verbose=0, axis=3
21 real:: position=-0.5, scale=0.1, ee0=5.3, ee1=0.5, time=0.1
27 SUBROUTINE init (self, link)
29 class(
link_t),
pointer :: link
32 logical,
save:: first_time=.true.
33 namelist /newton_params/ on, axis, position, scale, ee0, ee1, time
35 call trace%begin (
'newton_t%init')
40 read (io_unit%input, newton_params, iostat=iostat)
41 write (io_unit%output, newton_params)
45 associate(task => link%task)
49 if (.not.
allocated(task%heating_per_unit_volume)) &
50 allocate (task%heating_per_unit_volume(task%gn(1),task%gn(2),task%gn(3)))
59 SUBROUTINE pre_update (self)
62 class(mesh_t),
pointer:: m1, m2, m3
63 real,
dimension(:,:,:),
pointer:: d, e
67 d => self%patch%mem(:,:,:,self%patch%idx%d,self%patch%it,1)
68 e => self%patch%mem(:,:,:,self%patch%idx%e,self%patch%it,1)
70 m1 => self%patch%mesh(1)
71 m2 => self%patch%mesh(2)
72 m3 => self%patch%mesh(3)
77 s = m1%p + m1%r(ix)-position
81 self%patch%heating_per_unit_volume(ix,iy,iz) = &
82 self%patch%heating_per_unit_volume(ix,iy,iz) + &
83 (ee-e(ix,iy,iz)/d(ix,iy,iz))*d(ix,iy,iz)*r
90 s = m3%p + m3%r(iz)-position
91 f = exp(-s/scale)/time
97 s = m2%p + m2%r(iy)-position
103 self%patch%heating_per_unit_volume(ix,iy,iz) = &
104 self%patch%heating_per_unit_volume(ix,iy,iz) + &
105 (ee-e(ix,iy,iz)/d(ix,iy,iz))*d(ix,iy,iz)*r
111 END SUBROUTINE pre_update
The gpath_t layer now essentially only handles restarts.
Add Newton cooling to any solver.
Template module for mesh.
Module with list handling for generic class task_t objects.