Skip to content

Commit 78000e3

Browse files
committed
Support ghost margin <= subdomain size
1 parent 7ea4e53 commit 78000e3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

splashsurf_lib/src/dense_subdomains.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,10 @@ pub(crate) fn initialize_parameters<I: Index, R: Real>(
142142
ghost_particle_margin / (cube_size * subdomain_cubes.to_real_unchecked())
143143
);
144144

145-
if ghost_margin_cubes > subdomain_cubes / I::two() {
145+
if ghost_margin_cubes > subdomain_cubes {
146146
panic!(
147-
"The ghost margin is {ghost_margin_cubes} cubes wide (rounded up), while the subdomain only has an extent of {subdomain_cubes} cubes. The subdomain has to have at least twice the number of cubes ({})!",
148-
ghost_margin_cubes.times(2)
147+
"The ghost margin is {ghost_margin_cubes} cubes wide (rounded up), while the subdomain only has an extent of {subdomain_cubes} cubes. The subdomain has to have at least the same number of cubes ({})!",
148+
ghost_margin_cubes
149149
);
150150
}
151151
}
@@ -1494,7 +1494,7 @@ pub(crate) mod subdomain_classification {
14941494

14951495
/// Classifier that assign a particle to its owning subdomain and all subdomains where it's a ghost particle
14961496
pub struct GhostMarginClassifier<I: Index> {
1497-
subdomains: ArrayVec<I, 8>,
1497+
subdomains: ArrayVec<I, 27>,
14981498
}
14991499

15001500
impl<I: Index, R: Real> ParticleToSubdomainClassifier<I, R> for GhostMarginClassifier<I> {
@@ -1535,7 +1535,7 @@ pub(crate) mod subdomain_classification {
15351535
particle: &Vector3<R>,
15361536
subdomain_grid: &UniformCartesianCubeGrid3d<I, R>,
15371537
ghost_particle_margin: R,
1538-
subdomains: &mut ArrayVec<I, 8>,
1538+
subdomains: &mut ArrayVec<I, 27>,
15391539
) {
15401540
// Find the owning subdomain of the particle
15411541
let subdomain_ijk = subdomain_grid.enclosing_cell(particle);

0 commit comments

Comments
 (0)