68 real(kind=
rp),
intent(in) :: x(:), y(:), z(:)
69 integer,
intent(in) :: time_order
70 real(kind=
rp),
intent(in),
optional :: u(:), v(:), w(:)
71 real(kind=
rp),
intent(in),
optional :: diameter(:)
72 real(kind=
rp),
intent(in),
optional :: density(:)
76 if (
size(y) .ne.
size(x) .or.
size(z) .ne.
size(x))
then
77 call neko_error(
"particle coordinate arrays must have the same size")
83 this%n_global = this%n
84 this%time_order = time_order
85 this%lag_len = time_order - 1
87 if (
present(diameter) .neqv.
present(density))
then
88 call neko_error(
"particle diameter and density must both be provided")
90 this%inertia =
present(diameter)
91 call this%x%init(this%n)
92 call this%y%init(this%n)
93 call this%z%init(this%n)
94 call this%u%init(this%n)
95 call this%v%init(this%n)
96 call this%w%init(this%n)
97 call this%acc_x%init(this%n)
98 call this%acc_y%init(this%n)
99 call this%acc_z%init(this%n)
100 allocate(this%ids(this%n))
101 call this%u_lag%init(this%n)
102 call this%v_lag%init(this%n)
103 call this%w_lag%init(this%n)
104 call this%u_laglag%init(this%n)
105 call this%v_laglag%init(this%n)
106 call this%w_laglag%init(this%n)
107 call this%acc_xlag%init(this%n)
108 call this%acc_ylag%init(this%n)
109 call this%acc_zlag%init(this%n)
110 call this%acc_xlaglag%init(this%n)
111 call this%acc_ylaglag%init(this%n)
112 call this%acc_zlaglag%init(this%n)
113 call this%d%init(this%n)
114 call this%rho%init(this%n)
118 if (
present(u) .and.
present(v) .and.
present(w))
then
127 if (
present(diameter))
then
132 if (
present(density))
then
176 integer,
intent(in) :: memdir
178 call this%x%copy_from(memdir, .false.)
179 call this%y%copy_from(memdir, .false.)
180 call this%z%copy_from(memdir, .false.)
181 call this%u%copy_from(memdir, .false.)
182 call this%v%copy_from(memdir, .false.)
183 call this%w%copy_from(memdir, .true.)
184 call this%acc_x%copy_from(memdir, .false.)
185 call this%acc_y%copy_from(memdir, .false.)
186 call this%acc_z%copy_from(memdir, .true.)
187 call this%u_lag%copy_from(memdir, .false.)
188 call this%v_lag%copy_from(memdir, .false.)
189 call this%w_lag%copy_from(memdir, .true.)
190 call this%u_laglag%copy_from(memdir, .false.)
191 call this%v_laglag%copy_from(memdir, .false.)
192 call this%w_laglag%copy_from(memdir, .true.)
193 call this%acc_xlag%copy_from(memdir, .false.)
194 call this%acc_ylag%copy_from(memdir, .false.)
195 call this%acc_zlag%copy_from(memdir, .true.)
196 call this%acc_xlaglag%copy_from(memdir, .false.)
197 call this%acc_ylaglag%copy_from(memdir, .false.)
198 call this%acc_zlaglag%copy_from(memdir, .true.)
199 call this%d%copy_from(memdir, .false.)
200 call this%rho%copy_from(memdir, .true.)
Defines a collection of Lagrangian particles.
subroutine particles_init(this, x, y, z, time_order, u, v, w, diameter, density)
subroutine particles_device_sync(this, memdir)
Synchronise the host and device data for particles.
subroutine particles_free(this)
Particle positions, velocities, properties, and time-history data.