Skip to content

Commit

Permalink
Fix #165 Use Corrected CFL Criteria
Browse files Browse the repository at this point in the history
A. Taflove & M. E. Brodwin
IEEE Trans. on Microwave Theory and Techniques, August 1975
Formula (7)
  • Loading branch information
ax3l committed Apr 25, 2014
1 parent 2ece943 commit fdf5346
Showing 1 changed file with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,20 @@ namespace picongpu
CONST_VECTOR(float_X,simDim,cellSize,CELL_WIDTH,CELL_HEIGHT,CELL_DEPTH);

#if (SIMDIM==DIM3)
const float_X CELL_VOLUME = CELL_WIDTH * CELL_HEIGHT *CELL_DEPTH;
/* Courant-Friedrichs-Levy-Condition for Field Solver: */
PMACC_CASSERT_MSG(Courant_Friedrichs_Levy_condition_failure____check_your_gridConfig_param_file,
(PMACC_MIN(CELL_DEPTH,PMACC_MIN(CELL_WIDTH,CELL_HEIGHT))/SPEED_OF_LIGHT/DELTA_T)>1.77f);
const float_X CELL_VOLUME = CELL_WIDTH * CELL_HEIGHT * CELL_DEPTH;
const float_X INV_CELL2_SUM = 1.0 / ( CELL_WIDTH * CELL_WIDTH )
+ 1.0 / ( CELL_HEIGHT * CELL_HEIGHT )
+ 1.0 / ( CELL_DEPTH * CELL_DEPTH );
#elif(SIMDIM==DIM2)
const float_X CELL_VOLUME = CELL_WIDTH * CELL_HEIGHT ;
/* Courant-Friedrichs-Levy-Condition for Field Solver: */
PMACC_CASSERT_MSG(Courant_Friedrichs_Levy_condition_failure____check_your_gridConfig_param_file,
(PMACC_MIN(CELL_WIDTH,CELL_HEIGHT)/SPEED_OF_LIGHT/DELTA_T)>1.77f);
const float_X CELL_VOLUME = CELL_WIDTH * CELL_HEIGHT;
const float_X INV_CELL2_SUM = 1.0 / ( CELL_WIDTH * CELL_WIDTH )
+ 1.0 / ( CELL_HEIGHT * CELL_HEIGHT );
#else
const float_X INV_CELL2_SUM = 1.0 / ( CELL_WIDTH * CELL_WIDTH );
#endif

/* Courant-Friedrichs-Levy-Condition for Yee Field Solver: */
PMACC_CASSERT_MSG(Courant_Friedrichs_Levy_condition_failure____check_your_gridConfig_param_file,
(SPEED_OF_LIGHT*SPEED_OF_LIGHT*DELTA_T*DELTA_T*INV_CELL2_SUM)<=1.0);

}

0 comments on commit fdf5346

Please sign in to comment.