remove prints from multigrid
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
1d75ad9af9
commit
96e03bea33
@ -66,8 +66,6 @@ void initialization_check();
|
|||||||
float solver_multigrid_iterate_serial_recursive(float * phi, float * phi0, float a, float c, int GRIDDIM){
|
float solver_multigrid_iterate_serial_recursive(float * phi, float * phi0, float a, float c, int GRIDDIM){
|
||||||
initialization_check();
|
initialization_check();
|
||||||
float residual;
|
float residual;
|
||||||
printf("Current dim: %d \n",GRIDDIM);
|
|
||||||
fflush(stdout);
|
|
||||||
|
|
||||||
int LOWERDIM = ((GRIDDIM - 2) / 2) + 2;
|
int LOWERDIM = ((GRIDDIM - 2) / 2) + 2;
|
||||||
float * currResidual = get_current_residual(GRIDDIM);
|
float * currResidual = get_current_residual(GRIDDIM);
|
||||||
@ -75,11 +73,6 @@ float solver_multigrid_iterate_serial_recursive(float * phi, float * phi0, float
|
|||||||
float * lowerPhi0 = get_current_phi0(LOWERDIM);
|
float * lowerPhi0 = get_current_phi0(LOWERDIM);
|
||||||
float * lowerResidual = get_current_residual(LOWERDIM);
|
float * lowerResidual = get_current_residual(LOWERDIM);
|
||||||
|
|
||||||
printf("Solved arrays: %p %p %p %p \n",currResidual,lowerPhi, lowerPhi0, lowerResidual);
|
|
||||||
fflush(stdout);
|
|
||||||
|
|
||||||
printf("smooth\n");
|
|
||||||
fflush(stdout);
|
|
||||||
//
|
//
|
||||||
//gauss-seidel at highest res
|
//gauss-seidel at highest res
|
||||||
solver_gauss_seidel_iterate_parallel(phi,phi0,a,c,GRIDDIM);
|
solver_gauss_seidel_iterate_parallel(phi,phi0,a,c,GRIDDIM);
|
||||||
@ -89,8 +82,6 @@ float solver_multigrid_iterate_serial_recursive(float * phi, float * phi0, float
|
|||||||
//compute residuals
|
//compute residuals
|
||||||
residual = solver_multigrid_store_residual_serial(phi,phi0,currResidual,a,c,GRIDDIM);
|
residual = solver_multigrid_store_residual_serial(phi,phi0,currResidual,a,c,GRIDDIM);
|
||||||
|
|
||||||
printf("restrict\n");
|
|
||||||
fflush(stdout);
|
|
||||||
//restrict
|
//restrict
|
||||||
//(current operator is injection -- inject r^2 from this grid at phi0 of the smaller grid)
|
//(current operator is injection -- inject r^2 from this grid at phi0 of the smaller grid)
|
||||||
for(int x = 0; x < LOWERDIM; x++){
|
for(int x = 0; x < LOWERDIM; x++){
|
||||||
@ -111,8 +102,6 @@ float solver_multigrid_iterate_serial_recursive(float * phi, float * phi0, float
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("recurse\n");
|
|
||||||
fflush(stdout);
|
|
||||||
//solve next-coarsest grid
|
//solve next-coarsest grid
|
||||||
if(GRIDDIM <= LOWEST_DIM){
|
if(GRIDDIM <= LOWEST_DIM){
|
||||||
//smooth
|
//smooth
|
||||||
@ -120,8 +109,6 @@ float solver_multigrid_iterate_serial_recursive(float * phi, float * phi0, float
|
|||||||
//compute residual
|
//compute residual
|
||||||
residual = solver_multigrid_store_residual_serial(quarterGridPhi,quarterGridPhi0,quarterGridResidual,a,c,quarterDim);
|
residual = solver_multigrid_store_residual_serial(quarterGridPhi,quarterGridPhi0,quarterGridResidual,a,c,quarterDim);
|
||||||
} else {
|
} else {
|
||||||
printf("solve\n");
|
|
||||||
fflush(stdout);
|
|
||||||
float solution =
|
float solution =
|
||||||
(
|
(
|
||||||
phi0[solver_gauss_seidel_get_index(1,1,1,GRIDDIM)] +
|
phi0[solver_gauss_seidel_get_index(1,1,1,GRIDDIM)] +
|
||||||
@ -135,8 +122,6 @@ float solver_multigrid_iterate_serial_recursive(float * phi, float * phi0, float
|
|||||||
) / 8.0f
|
) / 8.0f
|
||||||
;
|
;
|
||||||
|
|
||||||
printf("interpolate solution\n");
|
|
||||||
fflush(stdout);
|
|
||||||
//interpolate from the lower grid
|
//interpolate from the lower grid
|
||||||
for(int x = 1; x < GRIDDIM - 1; x++){
|
for(int x = 1; x < GRIDDIM - 1; x++){
|
||||||
for(int y = 1; y < GRIDDIM - 1; y++){
|
for(int y = 1; y < GRIDDIM - 1; y++){
|
||||||
@ -148,8 +133,6 @@ float solver_multigrid_iterate_serial_recursive(float * phi, float * phi0, float
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("interpolate\n");
|
|
||||||
fflush(stdout);
|
|
||||||
//interpolate from the lower grid
|
//interpolate from the lower grid
|
||||||
for(int x = 1; x < GRIDDIM - 1; x++){
|
for(int x = 1; x < GRIDDIM - 1; x++){
|
||||||
for(int y = 1; y < GRIDDIM - 1; y++){
|
for(int y = 1; y < GRIDDIM - 1; y++){
|
||||||
@ -183,8 +166,6 @@ float solver_multigrid_iterate_serial_recursive(float * phi, float * phi0, float
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
printf("smooth\n");
|
|
||||||
fflush(stdout);
|
|
||||||
//
|
//
|
||||||
// full res
|
// full res
|
||||||
//
|
//
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user