vector diffusion across chunk boundaries

This commit is contained in:
austin 2024-12-12 16:17:11 -05:00
parent 533b8e3f76
commit 71ba3029cb
2 changed files with 14 additions and 8 deletions

View File

@ -207,12 +207,15 @@ void fluid_grid2_set_bounds_neighbor(
case BOUND_SET_DENSITY: {
neighborArr = environment->state.grid2.fluid_grid2_neighborArr_d;
} break;
case BOUND_SET_VECTOR_DIFFUSE_PHI_U:
case BOUND_SET_VECTOR_U: {
neighborArr = environment->state.grid2.fluid_grid2_neighborArr_u;
} break;
case BOUND_SET_VECTOR_DIFFUSE_PHI_V:
case BOUND_SET_VECTOR_V: {
neighborArr = environment->state.grid2.fluid_grid2_neighborArr_v;
} break;
case BOUND_SET_VECTOR_DIFFUSE_PHI_W:
case BOUND_SET_VECTOR_W: {
neighborArr = environment->state.grid2.fluid_grid2_neighborArr_w;
} break;
@ -322,15 +325,18 @@ LIBRARY_API void fluid_grid2_set_bounds(
float * target
){
switch(vector_dir){
case BOUND_SET_VECTOR_DIFFUSE_PHI_U:
case BOUND_SET_VECTOR_DIFFUSE_PHI_V:
case BOUND_SET_VECTOR_DIFFUSE_PHI_W: {
fluid_grid2_set_bounds_reflection(environment,vector_dir,target);
} break;
// case BOUND_SET_VECTOR_DIFFUSE_PHI_U:
// case BOUND_SET_VECTOR_DIFFUSE_PHI_V:
// case BOUND_SET_VECTOR_DIFFUSE_PHI_W: {
// fluid_grid2_set_bounds_reflection(environment,vector_dir,target);
// } break;
case BOUND_SET_PROJECTION_PHI:
case BOUND_SET_PROJECTION_PHI_0: {
fluid_grid2_set_bounds_continuity(environment,target);
} break;
case BOUND_SET_VECTOR_DIFFUSE_PHI_U:
case BOUND_SET_VECTOR_DIFFUSE_PHI_V:
case BOUND_SET_VECTOR_DIFFUSE_PHI_W:
case BOUND_SET_DENSITY_PHI:
case BOUND_SET_VECTOR_U:
case BOUND_SET_VECTOR_V:

View File

@ -68,9 +68,9 @@ LIBRARY_API void fluid_grid2_solveVectorDiffuse(
solver_gauss_seidel_iterate_parallel(w,w0,a,c,DIM);
//set bounds
fluid_grid2_set_bounds(environment,BOUND_SET_VECTOR_U,u);
fluid_grid2_set_bounds(environment,BOUND_SET_VECTOR_V,v);
fluid_grid2_set_bounds(environment,BOUND_SET_VECTOR_W,w);
fluid_grid2_set_bounds(environment,BOUND_SET_VECTOR_DIFFUSE_PHI_U,u);
fluid_grid2_set_bounds(environment,BOUND_SET_VECTOR_DIFFUSE_PHI_V,v);
fluid_grid2_set_bounds(environment,BOUND_SET_VECTOR_DIFFUSE_PHI_W,w);
}
}