File tree Expand file tree Collapse file tree 4 files changed +51
-18
lines changed
simulation_defines/unitless Expand file tree Collapse file tree 4 files changed +51
-18
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,34 @@ namespace dirSplitting
40
40
{
41
41
using namespace PMacc ;
42
42
43
- class DirSplitting
43
+ /* * Check Directional Splitting grid and time conditions
44
+ *
45
+ * This is a workaround that the condition check is only
46
+ * triggered if the current used solver is `DirSplitting`
47
+ */
48
+ template <typename T_UsedSolver, typename T_Dummy=void >
49
+ struct ConditionCheck
50
+ {
51
+ };
52
+
53
+ template <typename T_Dummy>
54
+ struct ConditionCheck <DirSplitting, T_Dummy>
55
+ {
56
+ /* Directional Splitting conditions:
57
+ *
58
+ * using SI units to avoid round off errors
59
+ */
60
+ PMACC_CASSERT_MSG (DirectionSplitting_Set_dX_equal_dt_times_c____check_your_gridConfig_param_file,
61
+ (SI::SPEED_OF_LIGHT_SI * SI::DELTA_T_SI) == SI::CELL_WIDTH_SI);
62
+ PMACC_CASSERT_MSG (DirectionSplitting_use_cubic_cells____check_your_gridConfig_param_file,
63
+ SI::CELL_HEIGHT_SI == SI::CELL_WIDTH_SI);
64
+ #if (SIMDIM == DIM3)
65
+ PMACC_CASSERT_MSG (DirectionSplitting_use_cubic_cells____check_your_gridConfig_param_file,
66
+ SI::CELL_DEPTH_SI == SI::CELL_WIDTH_SI);
67
+ #endif
68
+ };
69
+
70
+ class DirSplitting : private ConditionCheck <fieldSolver::FieldSolver>
44
71
{
45
72
private:
46
73
template <typename CursorE, typename CursorB, typename GridSize>
Original file line number Diff line number Diff line change @@ -34,26 +34,31 @@ namespace picongpu
34
34
{
35
35
using namespace PMacc ;
36
36
37
+ /* * Check Yee grid and time conditions
38
+ *
39
+ * This is a workaround that the condition check is only
40
+ * triggered if the current used solver is `NoSolver`
41
+ */
42
+ template <typename T_UsedSolver, typename T_Dummy=void >
43
+ struct ConditionCheck
44
+ {
45
+ };
46
+
47
+ template <typename T_Dummy>
48
+ struct ConditionCheck <NoSolver, T_Dummy>
49
+ {
50
+ /* Courant-Friedrichs-Levy-Condition for Yee Field Solver: */
51
+ PMACC_CASSERT_MSG (Courant_Friedrichs_Levy_condition_failure____check_your_gridConfig_param_file,
52
+ (SPEED_OF_LIGHT*SPEED_OF_LIGHT*DELTA_T*DELTA_T*INV_CELL2_SUM)<=1.0 );
53
+ };
37
54
38
- class NoSolver
55
+ class NoSolver : private ConditionCheck <fieldSolver::FieldSolver>
39
56
{
40
57
private:
41
58
typedef MappingDesc::SuperCellSize SuperCellSize;
42
59
43
60
MappingDesc cellDescription;
44
61
45
- template <uint32_t AREA>
46
- void updateE ()
47
- {
48
- return ;
49
- }
50
-
51
- template <uint32_t AREA>
52
- void updateBHalf ()
53
- {
54
- return ;
55
- }
56
-
57
62
public:
58
63
59
64
NoSolver (MappingDesc cellDescription) : cellDescription(cellDescription)
Original file line number Diff line number Diff line change @@ -57,13 +57,18 @@ class YeeSolver
57
57
private:
58
58
typedef MappingDesc::SuperCellSize SuperCellSize;
59
59
60
+
60
61
FieldE* fieldE;
61
62
FieldB* fieldB;
62
63
MappingDesc cellDescription;
63
64
64
65
template <uint32_t AREA>
65
66
void updateE ()
66
67
{
68
+ /* Courant-Friedrichs-Levy-Condition for Yee Field Solver: */
69
+ PMACC_CASSERT_MSG (Courant_Friedrichs_Levy_condition_failure____check_your_gridConfig_param_file,
70
+ (SPEED_OF_LIGHT*SPEED_OF_LIGHT*DELTA_T*DELTA_T*INV_CELL2_SUM)<=1.0 );
71
+
67
72
typedef SuperCellDescription<
68
73
SuperCellSize,
69
74
typename CurlB::LowerMargin,
Original file line number Diff line number Diff line change @@ -47,8 +47,4 @@ namespace picongpu
47
47
const float_X INV_CELL2_SUM = 1.0 / ( CELL_WIDTH * CELL_WIDTH );
48
48
#endif
49
49
50
- /* Courant-Friedrichs-Levy-Condition for Yee Field Solver: */
51
- PMACC_CASSERT_MSG(Courant_Friedrichs_Levy_condition_failure____check_your_gridConfig_param_file,
52
- (SPEED_OF_LIGHT*SPEED_OF_LIGHT*DELTA_T*DELTA_T*INV_CELL2_SUM)<=1.0);
53
-
54
50
}
You can’t perform that action at this time.
0 commit comments