diff --git a/src/picongpu/include/simulation_defines/unitless/gridConfig.unitless b/src/picongpu/include/simulation_defines/unitless/gridConfig.unitless index 5317ebf081..3529297a11 100644 --- a/src/picongpu/include/simulation_defines/unitless/gridConfig.unitless +++ b/src/picongpu/include/simulation_defines/unitless/gridConfig.unitless @@ -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); }