Skip to content

Commit 12f6fd6

Browse files
PIConGPU: update examples
- add define `PARAM_CURRENTINTERPOLATION` in - LaserWakefield - KelvinHelmholtz - rename field solver to Yee, Lehe, DirSplitting, None
1 parent 4f04d12 commit 12f6fd6

File tree

13 files changed

+156
-117
lines changed

13 files changed

+156
-117
lines changed

share/picongpu/examples/Bremsstrahlung/include/picongpu/param/components.param

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,6 @@ namespace simulation_starter = defaultPIConGPU;
4444
*/
4545
namespace laserProfile = laserGaussianBeam;
4646

47-
/*! Field Configuration --------------------------------------------------
48-
* - fieldSolverYee : standard Yee solver
49-
* - fieldSolverLehe: Num. Cherenkov free field solver in a chosen direction
50-
* - fieldSolverDirSplitting: Sentoku's Directional Splitting Method
51-
* - fieldSolverNone: disable the vacuum update of E and B
52-
*
53-
* * For development purposes: ---------------------------------------------
54-
* - fieldSolverYeeNative : generic version of fieldSolverYee
55-
* (need more shared memory per GPU and is slow)
56-
*/
57-
namespace fieldSolver = fieldSolverYee;
58-
5947
/*enable (1) or disable (0) current calculation*/
6048
#define ENABLE_CURRENT 1
6149

share/picongpu/examples/Bunch/include/picongpu/param/components.param

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,6 @@ namespace simulation_starter = defaultPIConGPU;
4646
*/
4747
namespace laserProfile = laserPlaneWave;
4848

49-
/*! Field Configuration --------------------------------------------------
50-
* - fieldSolverYee : standard Yee solver
51-
* - fieldSolverLehe: Num. Cherenkov free field solver in a chosen direction
52-
* - fieldSolverDirSplitting: Sentoku's Directional Splitting Method
53-
* - fieldSolverNone: disable the vacuum update of E and B
54-
*
55-
* * For development purposes: ---------------------------------------------
56-
* - fieldSolverYeeNative : generic version of fieldSolverYee
57-
* (need more shared memory per GPU and is slow)
58-
*/
59-
namespace fieldSolver = fieldSolverYee;
60-
6149
/*enable (1) or disable (0) current calculation*/
6250
#define ENABLE_CURRENT 0
6351

share/picongpu/examples/FoilLCT/include/picongpu/param/components.param

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -59,22 +59,6 @@ namespace picongpu
5959
*/
6060
namespace laserProfile = PARAM_LASERPROFILE;
6161

62-
/** @namespace fieldSolver
63-
*
64-
* Field Solver Selection:
65-
* - fieldSolverYee : standard Yee solver
66-
* - fieldSolverLehe: Num. Cherenkov free field solver in a chosen direction
67-
* - fieldSolverDirSplitting: Sentoku's Directional Splitting Method
68-
* - fieldSolverNone: disable the vacuum update of E and B
69-
*
70-
* For development purposes:
71-
* - fieldSolverYeeNative : generic version of fieldSolverYee
72-
* (need more shared memory per GPU and is slow)
73-
*
74-
* Adjust the settings of the selected field solver in fieldSolver.param
75-
*/
76-
namespace fieldSolver = fieldSolverYee;
77-
7862
/** enable (1) or disable (0) current calculation (deprecated) */
7963
#define ENABLE_CURRENT 1
8064

share/picongpu/examples/KelvinHelmholtz/cmakeFlags

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ flags[3]="-DPARAM_OVERWRITES:LIST='-DPARAM_CURRENTSOLVER=ZigZag<UsedParticleShap
3636
flags[4]="-DPARAM_OVERWRITES:LIST='-DPARAM_CURRENTSOLVER=ZigZag<UsedParticleShape>;-DPARAM_PARTICLESHAPE=PCS'"
3737
flags[5]="-DPARAM_OVERWRITES:LIST='-DPARAM_CURRENTSOLVER=ZigZag<UsedParticleShape>;-DPARAM_PARTICLESHAPE=TSC'"
3838
flags[6]="-DPARAM_OVERWRITES:LIST='-DPARAM_CURRENTSOLVER=ZigZag<UsedParticleShape>;-DPARAM_PARTICLESHAPE=TSC;-DPARAM_DIMENSION=DIM2'"
39-
flags[7]="-DPARAM_OVERWRITES:LIST='-DPARAM_FIELDSOLVER=fieldSolverDirSplitting'"
39+
flags[7]="-DPARAM_OVERWRITES:LIST='-DPARAM_FIELDSOLVER=DirSplitting;-DPARAM_CURRENTINTERPOLATION=NoneDS'"
4040

4141

4242
################################################################################

share/picongpu/examples/KelvinHelmholtz/include/picongpu/param/components.param

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -46,24 +46,6 @@ namespace picongpu
4646
*/
4747
namespace laserProfile = laserNone;
4848

49-
/*! Field Configuration --------------------------------------------------
50-
* - fieldSolverYee : standard Yee solver
51-
* - fieldSolverLehe: Num. Cherenkov free field solver in a chosen direction
52-
* - fieldSolverDirSplitting: Sentoku's Directional Splitting Method
53-
* - fieldSolverNone: disable the vacuum update of E and B
54-
*
55-
* * For development purposes: ---------------------------------------------
56-
* - fieldSolverYeeNative : generic version of fieldSolverYee
57-
* (need more shared memory per GPU and is slow)
58-
*/
59-
#ifndef PARAM_FIELDSOLVER
60-
/* WARNING: if you change field solver by hand please update your CELL_WIDTH_SI
61-
* in `grid.param` to fulfill the convergence condition (CFL)
62-
*/
63-
#define PARAM_FIELDSOLVER fieldSolverYee
64-
#endif
65-
namespace fieldSolver = PARAM_FIELDSOLVER;
66-
6749
/*enable (1) or disable (0) current calculation*/
6850
#define ENABLE_CURRENT 1
6951

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/* Copyright 2013-2018 Axel Huebl, Heiko Burau, Rene Widera
2+
*
3+
* This file is part of PIConGPU.
4+
*
5+
* PIConGPU is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* PIConGPU is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with PIConGPU.
17+
* If not, see <http://www.gnu.org/licenses/>.
18+
*/
19+
20+
/** @file
21+
*
22+
* Configure the field solver
23+
*/
24+
25+
#pragma once
26+
27+
#include "picongpu/fields/MaxwellSolver/Solvers.def"
28+
#include "picongpu/fields/currentInterpolation/CurrentInterpolation.def"
29+
30+
31+
namespace picongpu
32+
{
33+
namespace fields
34+
{
35+
36+
/** Current Interpolation
37+
*
38+
* CurrentInterpolation is used to set a method performing the
39+
* interpolate/assign operation from the generated currents of particle
40+
* species to the electro-magnetic fields.
41+
*
42+
* Allowed values are:
43+
* - None:
44+
* - default for staggered grids/Yee-scheme
45+
* - updates E
46+
* - Binomial: 2nd order Binomial filter
47+
* - smooths the current before assignment in staggered grid
48+
* - updates E & breaks local charge conservation slightly
49+
* - NoneDS:
50+
* - experimental assignment for all-centered/directional splitting
51+
* - updates E & B at the same time
52+
*/
53+
#ifndef PARAM_CURRENTINTERPOLATION
54+
# define PARAM_CURRENTINTERPOLATION None
55+
#endif
56+
using CurrentInterpolation = currentInterpolation::PARAM_CURRENTINTERPOLATION;
57+
58+
/** FieldSolver
59+
*
60+
* Field Solver Selection:
61+
* - Yee< CurrentInterpolation >: standard Yee solver
62+
* - Lehe< CurrentInterpolation >: Num. Cherenkov free field solver in a chosen direction
63+
* - DirSplitting< CurrentInterpolation >: Sentoku's Directional Splitting Method
64+
* - None< CurrentInterpolation >: disable the vacuum update of E and B
65+
*/
66+
67+
#ifndef PARAM_FIELDSOLVER
68+
/* WARNING: if you change field solver by hand please update your CELL_WIDTH_SI
69+
* in `grid.param` to fulfill the convergence condition (CFL)
70+
*/
71+
# define PARAM_FIELDSOLVER Yee
72+
#endif
73+
using Solver = maxwellSolver::PARAM_FIELDSOLVER< CurrentInterpolation >;
74+
75+
} // namespace fields
76+
} // namespace picongpu

share/picongpu/examples/KelvinHelmholtz/include/picongpu/param/grid.param

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ namespace picongpu
3333

3434
/** equals X
3535
* unit: meter */
36-
#define fieldSolverDirSplitting 1
36+
#define DirSplitting 1
3737
#if (PARAM_FIELDSOLVER == 1)
3838
/* THIS CODE PATH IS ONLY USED IF `PARAM_FIELDSOLVER` IS CHANGED IN
3939
* `cmakeFlags` and the field solver there is set to fieldSolverDirSplitting
@@ -52,7 +52,7 @@ namespace picongpu
5252
*/
5353
constexpr float_64 CELL_WIDTH_SI = 9.34635e-8;
5454
#endif
55-
#undef fieldSolverDirSplitting
55+
#undef DirSplitting
5656

5757
/** equals Y
5858
* unit: meter */
@@ -104,6 +104,3 @@ namespace picongpu
104104
constexpr float_64 movePoint = 0.90;
105105

106106
}
107-
108-
109-

share/picongpu/examples/LaserWakefield/cmakeFlags

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
# - increase by 1, no gaps
3131

3232
flags[0]=""
33-
flags[1]="-DPARAM_OVERWRITES:LIST='-DPARAM_FIELDSOLVER=fieldSolverLehe;-DPARAM_PARTICLEPUSHER=Vay'"
33+
flags[1]="-DPARAM_OVERWRITES:LIST='-DPARAM_FIELDSOLVER=Lehe;-DPARAM_PARTICLEPUSHER=Vay'"
3434
flags[2]="-DPARAM_OVERWRITES:LIST='-DPARAM_CURRENTSOLVER=Esirkepov;-DPARAM_PARTICLESHAPE=CIC'"
3535
flags[3]="-DPARAM_OVERWRITES:LIST='-DPARAM_CURRENTSOLVER=VillaBune;-DPARAM_PARTICLESHAPE=CIC'"
3636
flags[4]="-DPARAM_OVERWRITES:LIST='-DPARAM_PRECISION=precision64Bit'"

share/picongpu/examples/LaserWakefield/include/picongpu/param/components.param

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,6 @@ namespace simulation_starter = defaultPIConGPU;
4747
*/
4848
namespace laserProfile = laserGaussianBeam;
4949

50-
/*! Field Configuration --------------------------------------------------
51-
* - fieldSolverYee : standard Yee solver
52-
* - fieldSolverLehe: Num. Cherenkov free field solver in a chosen direction
53-
* - fieldSolverDirSplitting: Sentoku's Directional Splitting Method
54-
* - fieldSolverNone: disable the vacuum update of E and B
55-
*
56-
* * For development purposes: ---------------------------------------------
57-
* - fieldSolverYeeNative : generic version of fieldSolverYee
58-
* (need more shared memory per GPU and is slow)
59-
*/
60-
#ifndef PARAM_FIELDSOLVER
61-
#define PARAM_FIELDSOLVER fieldSolverYee
62-
#endif
63-
namespace fieldSolver = PARAM_FIELDSOLVER;
64-
6550
/*enable (1) or disable (0) current calculation*/
6651
#ifndef ENABLE_CURRENT
6752
#define ENABLE_CURRENT 1
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/* Copyright 2013-2018 Axel Huebl, Heiko Burau, Rene Widera
2+
*
3+
* This file is part of PIConGPU.
4+
*
5+
* PIConGPU is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* PIConGPU is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with PIConGPU.
17+
* If not, see <http://www.gnu.org/licenses/>.
18+
*/
19+
20+
/** @file
21+
*
22+
* Configure the field solver
23+
*/
24+
25+
#pragma once
26+
27+
#include "picongpu/fields/MaxwellSolver/Solvers.def"
28+
#include "picongpu/fields/currentInterpolation/CurrentInterpolation.def"
29+
30+
31+
namespace picongpu
32+
{
33+
namespace fields
34+
{
35+
36+
/** Current Interpolation
37+
*
38+
* CurrentInterpolation is used to set a method performing the
39+
* interpolate/assign operation from the generated currents of particle
40+
* species to the electro-magnetic fields.
41+
*
42+
* Allowed values are:
43+
* - None:
44+
* - default for staggered grids/Yee-scheme
45+
* - updates E
46+
* - Binomial: 2nd order Binomial filter
47+
* - smooths the current before assignment in staggered grid
48+
* - updates E & breaks local charge conservation slightly
49+
* - NoneDS:
50+
* - experimental assignment for all-centered/directional splitting
51+
* - updates E & B at the same time
52+
*/
53+
#ifndef PARAM_CURRENTINTERPOLATION
54+
# define PARAM_CURRENTINTERPOLATION None
55+
#endif
56+
using CurrentInterpolation = currentInterpolation::PARAM_CURRENTINTERPOLATION;
57+
58+
/** FieldSolver
59+
*
60+
* Field Solver Selection:
61+
* - Yee< CurrentInterpolation >: standard Yee solver
62+
* - Lehe< CurrentInterpolation >: Num. Cherenkov free field solver in a chosen direction
63+
* - DirSplitting< CurrentInterpolation >: Sentoku's Directional Splitting Method
64+
* - None< CurrentInterpolation >: disable the vacuum update of E and B
65+
*/
66+
67+
#ifndef PARAM_FIELDSOLVER
68+
/* WARNING: if you change field solver by hand please update your CELL_WIDTH_SI
69+
* in `grid.param` to fulfill the convergence condition (CFL)
70+
*/
71+
# define PARAM_FIELDSOLVER Yee
72+
#endif
73+
using Solver = maxwellSolver::PARAM_FIELDSOLVER< CurrentInterpolation >;
74+
75+
} // namespace fields
76+
} // namespace picongpu

0 commit comments

Comments
 (0)