Skip to content

Commit

Permalink
Require DomainView to be Sync
Browse files Browse the repository at this point in the history
  • Loading branch information
SallySoul committed Dec 29, 2024
1 parent 1ed1037 commit 7f2463a
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 10 deletions.
7 changes: 2 additions & 5 deletions src/domain/bc/periodic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,8 @@ impl<
}
}

impl<
const GRID_DIMENSION: usize,
DomainType: DomainView<GRID_DIMENSION> + Sync,
> BCCheck<GRID_DIMENSION>
for PeriodicCheck<'_, GRID_DIMENSION, DomainType>
impl<const GRID_DIMENSION: usize, DomainType: DomainView<GRID_DIMENSION>>
BCCheck<GRID_DIMENSION> for PeriodicCheck<'_, GRID_DIMENSION, DomainType>
{
fn check(&self, world_coord: &Coord<GRID_DIMENSION>) -> Option<f64> {
let p_coord = &self.domain.aabb().periodic_coord(world_coord);
Expand Down
2 changes: 1 addition & 1 deletion src/domain/view/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub use slice::*;
use crate::util::*;
use rayon::prelude::*;

pub trait DomainView<const GRID_DIMENSION: usize> {
pub trait DomainView<const GRID_DIMENSION: usize>: Sync {
fn aabb(&self) -> &AABB<GRID_DIMENSION>;

fn set_aabb(&mut self, aabb: AABB<GRID_DIMENSION>);
Expand Down
2 changes: 1 addition & 1 deletion src/par_stencil.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub fn apply<
Operation,
const GRID_DIMENSION: usize,
const NEIGHBORHOOD_SIZE: usize,
DomainType: DomainView<GRID_DIMENSION> + Sync,
DomainType: DomainView<GRID_DIMENSION>,
>(
bc: &BC,
stencil: &StencilF64<Operation, GRID_DIMENSION, NEIGHBORHOOD_SIZE>,
Expand Down
2 changes: 1 addition & 1 deletion src/solver/direct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub fn box_apply<
Operation,
const GRID_DIMENSION: usize,
const NEIGHBORHOOD_SIZE: usize,
DomainType: DomainView<GRID_DIMENSION> + Sync,
DomainType: DomainView<GRID_DIMENSION>,
>(
bc: &BC,
stencil: &StencilF64<Operation, GRID_DIMENSION, NEIGHBORHOOD_SIZE>,
Expand Down
2 changes: 1 addition & 1 deletion src/solver/periodic_direct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pub fn direct_periodic_apply<
Operation,
const GRID_DIMENSION: usize,
const NEIGHBORHOOD_SIZE: usize,
DomainType: DomainView<GRID_DIMENSION> + Sync,
DomainType: DomainView<GRID_DIMENSION>,
>(
stencil: &StencilF64<Operation, GRID_DIMENSION, NEIGHBORHOOD_SIZE>,
input: &mut DomainType,
Expand Down
2 changes: 1 addition & 1 deletion src/solver/trapezoid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub fn trapezoid_apply<
Operation,
const GRID_DIMENSION: usize,
const NEIGHBORHOOD_SIZE: usize,
DomainType: DomainView<GRID_DIMENSION> + Sync,
DomainType: DomainView<GRID_DIMENSION>,
>(
bc: &BC,
stencil: &StencilF64<Operation, GRID_DIMENSION, NEIGHBORHOOD_SIZE>,
Expand Down

0 comments on commit 7f2463a

Please sign in to comment.