basic neighbor referencing
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit

This commit is contained in:
austin 2024-12-13 17:26:23 -05:00
parent db388b9b1f
commit 02611038f2
2 changed files with 22 additions and 22 deletions

View File

@ -71,20 +71,20 @@ LIBRARY_API void fluid_grid2_solveDiffuseDensity(
//about ~40% faster than gauss seidel //about ~40% faster than gauss seidel
float residual = 1; float residual = 1;
int iterations = 0; int iterations = 0;
// while(iterations < FLUID_GRID2_SOLVER_MULTIGRID_MAX_ITERATIONS && (residual > FLUID_GRID2_SOLVER_MULTIGRID_TOLERANCE || residual < -FLUID_GRID2_SOLVER_MULTIGRID_TOLERANCE)){ while(iterations < FLUID_GRID2_SOLVER_MULTIGRID_MAX_ITERATIONS && (residual > FLUID_GRID2_SOLVER_MULTIGRID_TOLERANCE || residual < -FLUID_GRID2_SOLVER_MULTIGRID_TOLERANCE)){
// residual = solver_multigrid_parallel_iterate(x,x0,a,c); residual = solver_multigrid_parallel_iterate(x,x0,a,c);
// fluid_grid2_set_bounds(environment,BOUND_SET_DENSITY_PHI,x);
// iterations++;
// }
//about ~40% slower than multigrid
for(int l = 0; l < FLUID_GRID2_LINEARSOLVERTIMES; l++){
//iterate
solver_gauss_seidel_iterate_parallel(x,x0,a,c,DIM);
//set bounds
fluid_grid2_set_bounds(environment,BOUND_SET_DENSITY_PHI,x); fluid_grid2_set_bounds(environment,BOUND_SET_DENSITY_PHI,x);
iterations++;
} }
// //about ~40% slower than multigrid
// for(int l = 0; l < FLUID_GRID2_LINEARSOLVERTIMES; l++){
// //iterate
// solver_gauss_seidel_iterate_parallel(x,x0,a,c,DIM);
// //set bounds
// fluid_grid2_set_bounds(environment,BOUND_SET_DENSITY_PHI,x);
// }
} }
/** /**

View File

@ -351,10 +351,10 @@ LIBRARY_API void fluid_grid2_set_bounds(
case BOUND_SET_VECTOR_DIFFUSE_PHI_V: case BOUND_SET_VECTOR_DIFFUSE_PHI_V:
case BOUND_SET_VECTOR_DIFFUSE_PHI_W: case BOUND_SET_VECTOR_DIFFUSE_PHI_W:
case BOUND_SET_DENSITY_PHI: case BOUND_SET_DENSITY_PHI:
case BOUND_SET_VECTOR_U: // case BOUND_SET_VECTOR_U:
case BOUND_SET_VECTOR_V: // case BOUND_SET_VECTOR_V:
case BOUND_SET_VECTOR_W: // case BOUND_SET_VECTOR_W:
case BOUND_SET_DENSITY: // case BOUND_SET_DENSITY:
fluid_grid2_set_bounds_reflection(environment,vector_dir,target); fluid_grid2_set_bounds_reflection(environment,vector_dir,target);
break; break;
@ -377,12 +377,12 @@ LIBRARY_API void fluid_grid2_set_bounds(
// case BOUND_SET_VECTOR_DIFFUSE_PHI_V: // case BOUND_SET_VECTOR_DIFFUSE_PHI_V:
// case BOUND_SET_VECTOR_DIFFUSE_PHI_W: // case BOUND_SET_VECTOR_DIFFUSE_PHI_W:
// case BOUND_SET_DENSITY_PHI: // case BOUND_SET_DENSITY_PHI:
// case BOUND_SET_VECTOR_U: case BOUND_SET_VECTOR_U:
// case BOUND_SET_VECTOR_V: case BOUND_SET_VECTOR_V:
// case BOUND_SET_VECTOR_W: case BOUND_SET_VECTOR_W:
// case BOUND_SET_DENSITY: case BOUND_SET_DENSITY:
// fluid_grid2_set_bounds_ghost_cell(environment,vector_dir,target); fluid_grid2_set_bounds_ghost_cell(environment,vector_dir,target);
// break; break;
// case BOUND_SET_PROJECTION_PHI: // case BOUND_SET_PROJECTION_PHI:
// case BOUND_SET_PROJECTION_PHI_0: // case BOUND_SET_PROJECTION_PHI_0: