@@ -481,7 +481,7 @@ def target_info(self):
481481
482482 target_discr_starts .append (ntargets )
483483
484- targets = actx .empty ((self .ambient_dim , ntargets ), self .coord_dtype )
484+ targets = actx .zeros ((self .ambient_dim , ntargets ), self .coord_dtype )
485485 code_getter .copy_targets_kernel ()(
486486 actx .queue ,
487487 targets = targets [:, :self .ncenters ],
@@ -510,9 +510,7 @@ def target_side_preferences(self):
510510 actx = self ._setup_actx
511511 tgt_info = self .target_info ()
512512
513- target_side_preferences = actx .empty (tgt_info .ntargets , dtype = np .int8 )
514- target_side_preferences [:self .ncenters ] = 0
515-
513+ target_side_preferences = actx .zeros (tgt_info .ntargets , dtype = np .int8 )
516514 for tdstart , (target_discr , qbx_side ) in zip (
517515 tgt_info .target_discr_starts ,
518516 self .target_discrs_and_qbx_sides ):
@@ -549,7 +547,7 @@ def tree(self):
549547 target_radii = actx .zeros (target_info .ntargets , self .coord_dtype )
550548 target_radii [:self .ncenters ] = self .flat_expansion_radii ()
551549
552- refine_weights = actx .empty (nparticles , dtype = np .int32 )
550+ refine_weights = actx .zeros (nparticles , dtype = np .int32 )
553551
554552 # Assign a weight of 1 to all sources, QBX centers, and conventional
555553 # (non-QBX) targets. Assign a weight of 0 to all targets that need
@@ -625,7 +623,7 @@ def qbx_center_to_target_box(self):
625623 tree .box_id_dtype ,
626624 )
627625
628- box_to_target_box = actx .empty (tree .nboxes , tree .box_id_dtype )
626+ box_to_target_box = actx .zeros (tree .nboxes , tree .box_id_dtype )
629627 if self .debug :
630628 box_to_target_box .fill (- 1 )
631629
@@ -634,15 +632,15 @@ def qbx_center_to_target_box(self):
634632 )
635633
636634 sorted_target_ids = self .tree ().sorted_target_ids
637- user_target_from_tree_target = actx .empty_like (sorted_target_ids )
635+ user_target_from_tree_target = actx .np . zeros_like (sorted_target_ids )
638636
639637 user_target_from_tree_target [sorted_target_ids ] = actx .from_numpy (
640638 np .arange (
641639 len (sorted_target_ids ),
642640 dtype = user_target_from_tree_target .dtype )
643641 )
644642
645- qbx_center_to_target_box = actx .empty (self .ncenters , tree .box_id_dtype )
643+ qbx_center_to_target_box = actx .zeros (self .ncenters , tree .box_id_dtype )
646644
647645 if self .debug :
648646 qbx_center_to_target_box .fill (- 1 )
@@ -677,7 +675,7 @@ def qbx_center_to_target_box_source_level(self, source_level):
677675 sep_smaller = traversal .from_sep_smaller_by_level [source_level ]
678676 qbx_center_to_target_box = self .qbx_center_to_target_box ()
679677
680- target_box_to_target_box_source_level = actx .empty (
678+ target_box_to_target_box_source_level = actx .zeros (
681679 len (traversal .target_boxes ), dtype = traversal .tree .box_id_dtype )
682680 target_box_to_target_box_source_level .fill (- 1 )
683681 target_box_to_target_box_source_level [sep_smaller .nonempty_indices ] = (
@@ -709,7 +707,7 @@ def global_qbx_flags(self):
709707 """
710708 actx = self ._setup_actx
711709
712- result = actx .empty (self .ncenters , np .int8 )
710+ result = actx .zeros (self .ncenters , np .int8 )
713711 result .fill (1 )
714712
715713 return actx .freeze (result )
@@ -793,7 +791,7 @@ def user_target_to_center(self):
793791 self .target_association_tolerance ),
794792 debug = self .debug )
795793
796- result = actx .empty (
794+ result = actx .zeros (
797795 target_info .ntargets , tgt_assoc_result .target_to_center .dtype
798796 )
799797 result [:self .ncenters ].fill (target_state .NO_QBX_NEEDED )
@@ -812,12 +810,12 @@ def center_to_tree_targets(self):
812810 actx = self ._setup_actx
813811 user_ttc = self .user_target_to_center ()
814812
815- tree_ttc = actx .empty_like (user_ttc )
813+ tree_ttc = actx .np . zeros_like (user_ttc )
816814 tree_ttc [self .tree ().sorted_target_ids ] = user_ttc
817815
818- filtered_tree_ttc = actx .empty (tree_ttc .shape , dtype = tree_ttc .dtype )
819- filtered_target_ids = actx .empty (tree_ttc .shape , dtype = tree_ttc .dtype )
820- count = actx .empty (1 , dtype = tree_ttc .dtype )
816+ filtered_tree_ttc = actx .zeros (tree_ttc .shape , dtype = tree_ttc .dtype )
817+ filtered_target_ids = actx .zeros (tree_ttc .shape , dtype = tree_ttc .dtype )
818+ count = actx .zeros (1 , dtype = tree_ttc .dtype )
821819
822820 self .code_getter .filter_center_and_target_ids (tree_ttc .dtype )(
823821 tree_ttc , filtered_tree_ttc , filtered_target_ids , count ,
0 commit comments