basic neighbor referencing
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
This commit is contained in:
parent
db388b9b1f
commit
02611038f2
@ -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);
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -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:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user