@@ -37,47 +37,44 @@ Open boundary system for in- and outflow particles.
3737 It is GPU-compatible (e.g., with CUDA.jl and AMDGPU.jl), but currently **not** supported with Metal.jl.
3838"""
3939struct OpenBoundarySPHSystem{BM, ELTYPE, NDIMS, IC, FS, FSI, ARRAY1D, BC, FC, BZ, RV,
40- RP, RD, B, UCU, C} <: System{NDIMS}
41- boundary_model :: BM
42- initial_condition :: IC
43- fluid_system :: FS
44- fluid_system_index :: FSI
45- smoothing_length :: ELTYPE
46- mass :: ARRAY1D # Array{ELTYPE, 1}: [particle]
47- density :: ARRAY1D # Array{ELTYPE, 1}: [particle]
48- volume :: ARRAY1D # Array{ELTYPE, 1}: [particle]
49- pressure :: ARRAY1D # Array{ELTYPE, 1}: [particle]
50- boundary_candidates :: BC # Array{UInt32, 1}: [particle]
51- fluid_candidates :: FC # Array{UInt32, 1}: [particle]
52- boundary_zone :: BZ
53- reference_velocity :: RV
54- reference_pressure :: RP
55- reference_density :: RD
56- buffer :: B
57- update_callback_used :: UCU
58- cache :: C
40+ RP, RD, B, C} <: System{NDIMS}
41+ boundary_model :: BM
42+ initial_condition :: IC
43+ fluid_system :: FS
44+ fluid_system_index :: FSI
45+ smoothing_length :: ELTYPE
46+ mass :: ARRAY1D # Array{ELTYPE, 1}: [particle]
47+ density :: ARRAY1D # Array{ELTYPE, 1}: [particle]
48+ volume :: ARRAY1D # Array{ELTYPE, 1}: [particle]
49+ pressure :: ARRAY1D # Array{ELTYPE, 1}: [particle]
50+ boundary_candidates :: BC # Array{UInt32, 1}: [particle]
51+ fluid_candidates :: FC # Array{UInt32, 1}: [particle]
52+ boundary_zone :: BZ
53+ reference_velocity :: RV
54+ reference_pressure :: RP
55+ reference_density :: RD
56+ buffer :: B
57+ cache :: C
5958end
6059
6160function OpenBoundarySPHSystem (boundary_model, initial_condition, fluid_system,
6261 fluid_system_index, smoothing_length, mass, density, volume,
6362 pressure, boundary_candidates, fluid_candidates,
6463 boundary_zone, reference_velocity,
65- reference_pressure, reference_density, buffer,
66- update_callback_used, cache)
64+ reference_pressure, reference_density, buffer, cache)
6765 OpenBoundarySPHSystem{typeof (boundary_model), eltype (mass), ndims (initial_condition),
6866 typeof (initial_condition), typeof (fluid_system),
6967 typeof (fluid_system_index), typeof (mass),
7068 typeof (boundary_candidates), typeof (fluid_candidates),
7169 typeof (boundary_zone), typeof (reference_velocity),
7270 typeof (reference_pressure), typeof (reference_density),
73- typeof (buffer), typeof (update_callback_used),
71+ typeof (buffer),
7472 typeof (cache)}(boundary_model, initial_condition, fluid_system,
7573 fluid_system_index, smoothing_length, mass,
7674 density, volume, pressure, boundary_candidates,
7775 fluid_candidates, boundary_zone,
7876 reference_velocity, reference_pressure,
79- reference_density, buffer, update_callback_used,
80- cache)
77+ reference_density, buffer, cache)
8178end
8279
8380function OpenBoundarySPHSystem (boundary_zone:: BoundaryZone ;
@@ -149,8 +146,6 @@ function OpenBoundarySPHSystem(boundary_zone::BoundaryZone;
149146 reference_density, reference_velocity,
150147 reference_pressure)
151148
152- # These will be set later
153- update_callback_used = Ref (false )
154149 fluid_system_index = Ref (0 )
155150
156151 smoothing_length = initial_smoothing_length (fluid_system)
@@ -162,8 +157,7 @@ function OpenBoundarySPHSystem(boundary_zone::BoundaryZone;
162157 fluid_system_index, smoothing_length, mass, density,
163158 volume, pressure, boundary_candidates, fluid_candidates,
164159 boundary_zone, reference_velocity_,
165- reference_pressure_, reference_density_, buffer,
166- update_callback_used, cache)
160+ reference_pressure_, reference_density_, buffer, cache)
167161end
168162
169163function create_cache_open_boundary (boundary_model, initial_condition,
226220 return ELTYPE
227221end
228222
223+ # The `UpdateCallback` is required to update particle positions between time steps
229224@inline requires_update_callback (system:: OpenBoundarySPHSystem ) = true
230- @inline update_callback_used (system:: OpenBoundarySPHSystem ) = system. update_callback_used[]
231-
232- function set_callback_flag! (system:: OpenBoundarySPHSystem , value)
233- system. update_callback_used[] = value
234-
235- return system
236- end
237225
238226function corresponding_fluid_system (system:: OpenBoundarySPHSystem , semi)
239227 return system. fluid_system
0 commit comments