@@ -209,7 +209,8 @@ def reconstruct_surface(
209209 iso_surface_threshold : float = 0.6 ,
210210 enable_multi_threading : bool = False ,
211211 global_neighborhood_list : bool = False ,
212- subdomain_grid : bool = False ,
212+ subdomain_grid : bool = True ,
213+ auto_disable_subdomain_grid : bool = True ,
213214 subdomain_num_cubes_per_dim : int = 64 ,
214215 aabb_min = None ,
215216 aabb_max = None ,
@@ -245,7 +246,10 @@ def reconstruct_surface(
245246 Global neighborhood list flag
246247
247248 subdomain_grid: bool
248- Enable spatial decomposition using a regular grid-based approach
249+ Enable spatial decomposition using by dividing the domain into subdomains with dense marching cube grids for efficient multi-threading
250+
251+ auto_disable_subdomain_grid: bool
252+ Whether to automatically disable the subdomain grid if the global domain is too small
249253
250254 subdomain_num_cubes_per_dim: int
251255 Each subdomain will be a cube consisting of this number of MC cube cells along each coordinate axis
@@ -267,13 +271,13 @@ def reconstruct_surface(
267271 return reconstruct_surface_f32 (particles , particle_radius = particle_radius , rest_density = rest_density ,
268272 smoothing_length = smoothing_length , cube_size = cube_size , iso_surface_threshold = iso_surface_threshold ,
269273 enable_multi_threading = enable_multi_threading , global_neighborhood_list = global_neighborhood_list ,
270- use_custom_grid_decomposition = subdomain_grid , subdomain_num_cubes_per_dim = subdomain_num_cubes_per_dim ,
274+ use_subdomain_grid = subdomain_grid , auto_disable_subdomain_grid = auto_disable_subdomain_grid , subdomain_num_cubes_per_dim = subdomain_num_cubes_per_dim ,
271275 aabb_min = aabb_min , aabb_max = aabb_max )
272276 elif particles .dtype == 'float64' :
273277 return reconstruct_surface_f64 (particles , particle_radius = particle_radius , rest_density = rest_density ,
274278 smoothing_length = smoothing_length , cube_size = cube_size , iso_surface_threshold = iso_surface_threshold ,
275279 enable_multi_threading = enable_multi_threading , global_neighborhood_list = global_neighborhood_list ,
276- use_custom_grid_decomposition = subdomain_grid , subdomain_num_cubes_per_dim = subdomain_num_cubes_per_dim ,
280+ use_subdomain_grid = subdomain_grid , auto_disable_subdomain_grid = auto_disable_subdomain_grid , subdomain_num_cubes_per_dim = subdomain_num_cubes_per_dim ,
277281 aabb_min = aabb_min , aabb_max = aabb_max )
278282 else :
279283 raise ValueError ("Invalid data type (only float32 and float64 are supported, consider explicitly specifying the dtype for particles)" )
@@ -530,7 +534,7 @@ def reconstruction_pipeline(
530534 mesh_smoothing_weights_normalization = 13.0 , mesh_smoothing_iters = None , normals_smoothing_iters = None ,
531535 mesh_cleanup = False , mesh_cleanup_snap_dist = None , decimate_barnacles = False , keep_vertices = False ,
532536 compute_normals = False , output_raw_normals = False , output_raw_mesh = False , output_mesh_smoothing_weights = False , mesh_aabb_clamp_vertices = False ,
533- subdomain_grid = True , subdomain_num_cubes_per_dim = 64 , aabb_min = None , aabb_max = None , mesh_aabb_min = None , mesh_aabb_max = None ,
537+ subdomain_grid = True , auto_disable_subdomain_grid = True , subdomain_num_cubes_per_dim = 64 , aabb_min = None , aabb_max = None , mesh_aabb_min = None , mesh_aabb_max = None ,
534538 generate_quads = False , quad_max_edge_diag_ratio = 1.75 , quad_max_normal_angle = 10.0 , quad_max_interior_angle = 135.0
535539):
536540 """Surface reconstruction based on particle positions with subsequent post-processing
@@ -622,7 +626,10 @@ def reconstruction_pipeline(
622626 Flag to clamp the vertices of the mesh to the AABB
623627
624628 subdomain_grid: bool
625- Enables spatial decomposition using a regular grid-based approach
629+ Enable spatial decomposition using by dividing the domain into subdomains with dense marching cube grids for efficient multi-threading
630+
631+ auto_disable_subdomain_grid: bool
632+ Whether to automatically disable the subdomain grid if the global domain is too small
626633
627634 subdomain_num_cubes_per_dim: int
628635 Each subdomain will be a cube consisting of this number of MC cube cells along each coordinate axis
@@ -660,7 +667,7 @@ def reconstruction_pipeline(
660667 tri_mesh , tri_quad_mesh , reconstruction = reconstruction_pipeline_f32 (particles , attributes_to_interpolate = attributes_to_interpolate , particle_radius = particle_radius , rest_density = rest_density ,
661668 smoothing_length = smoothing_length , cube_size = cube_size , iso_surface_threshold = iso_surface_threshold ,
662669 aabb_min = aabb_min , aabb_max = aabb_max , enable_multi_threading = enable_multi_threading ,
663- use_custom_grid_decomposition = subdomain_grid , subdomain_num_cubes_per_dim = subdomain_num_cubes_per_dim ,
670+ use_subdomain_grid = subdomain_grid , auto_disable_subdomain_grid = auto_disable_subdomain_grid , subdomain_num_cubes_per_dim = subdomain_num_cubes_per_dim ,
664671 check_mesh_closed = check_mesh_closed , check_mesh_manifold = check_mesh_manifold , check_mesh_orientation = check_mesh_orientation , check_mesh_debug = check_mesh_debug ,
665672 mesh_cleanup = mesh_cleanup , max_rel_snap_dist = mesh_cleanup_snap_dist , decimate_barnacles = decimate_barnacles ,
666673 keep_vertices = keep_vertices , compute_normals = compute_normals , sph_normals = sph_normals , normals_smoothing_iters = normals_smoothing_iters ,
@@ -678,7 +685,7 @@ def reconstruction_pipeline(
678685 tri_mesh , tri_quad_mesh , reconstruction = reconstruction_pipeline_f64 (particles , attributes_to_interpolate = attributes_to_interpolate , particle_radius = particle_radius , rest_density = rest_density ,
679686 smoothing_length = smoothing_length , cube_size = cube_size , iso_surface_threshold = iso_surface_threshold ,
680687 aabb_min = aabb_min , aabb_max = aabb_max , enable_multi_threading = enable_multi_threading ,
681- use_custom_grid_decomposition = subdomain_grid , subdomain_num_cubes_per_dim = subdomain_num_cubes_per_dim ,
688+ use_subdomain_grid = subdomain_grid , auto_disable_subdomain_grid = auto_disable_subdomain_grid , subdomain_num_cubes_per_dim = subdomain_num_cubes_per_dim ,
682689 check_mesh_closed = check_mesh_closed , check_mesh_manifold = check_mesh_manifold , check_mesh_orientation = check_mesh_orientation , check_mesh_debug = check_mesh_debug ,
683690 mesh_cleanup = mesh_cleanup , max_rel_snap_dist = mesh_cleanup_snap_dist , decimate_barnacles = decimate_barnacles ,
684691 keep_vertices = keep_vertices , compute_normals = compute_normals , sph_normals = sph_normals , normals_smoothing_iters = normals_smoothing_iters ,
0 commit comments