Skip to content

Commit c26428d

Browse files
authored
Merge pull request ComputationalRadiationPhysics#2534 from psychocoderHPC/topic-maxwellSolverStructs
refactor: field solvers
2 parents e842b1e + 992e341 commit c26428d

File tree

61 files changed

+1485
-1219
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1485
-1219
lines changed

include/picongpu/_defaultUnitless.loader

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#include "picongpu/unitless/laser.unitless"
3333
#include "picongpu/unitless/density.unitless"
3434
#include "picongpu/unitless/particle.unitless"
35-
#include "picongpu/unitless/fieldSolver.unitless"
3635
#include "picongpu/unitless/pusher.unitless"
3736
#include "picongpu/unitless/ionizer.unitless"
3837
#include "picongpu/unitless/speciesAttributes.unitless"

include/picongpu/fields/FieldB.tpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
#include <pmacc/dimensions/SuperCellDescription.hpp>
3838

39-
#include "MaxwellSolver/Solvers.hpp"
39+
#include "picongpu/fields/MaxwellSolver/Solvers.hpp"
4040
#include "picongpu/fields/numericalCellTypes/NumericalCellTypes.hpp"
4141

4242
#include <pmacc/math/Vector.hpp>
@@ -86,11 +86,11 @@ SimulationFieldHelper<MappingDesc>( cellDescription )
8686
/* Calculate the maximum Neighbors we need from MAX(ParticleShape, FieldSolver) */
8787
typedef pmacc::math::CT::max<
8888
LowerMarginInterpolation,
89-
GetMargin<fieldSolver::FieldSolver, FIELD_B>::LowerMargin
89+
GetMargin<fields::Solver, FIELD_B>::LowerMargin
9090
>::type LowerMarginInterpolationAndSolver;
9191
typedef pmacc::math::CT::max<
9292
UpperMarginInterpolation,
93-
GetMargin<fieldSolver::FieldSolver, FIELD_B>::UpperMargin
93+
GetMargin<fields::Solver, FIELD_B>::UpperMargin
9494
>::type UpperMarginInterpolationAndSolver;
9595

9696
/* Calculate upper and lower margin for pusher

include/picongpu/fields/FieldE.tpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
#include "picongpu/fields/FieldE.kernel"
3636

37-
#include "MaxwellSolver/Solvers.hpp"
37+
#include "picongpu/fields/MaxwellSolver/Solvers.hpp"
3838
#include "picongpu/fields/numericalCellTypes/NumericalCellTypes.hpp"
3939

4040
#include <pmacc/math/Vector.hpp>
@@ -81,11 +81,11 @@ SimulationFieldHelper<MappingDesc>( cellDescription )
8181
/* Calculate the maximum Neighbors we need from MAX(ParticleShape, FieldSolver) */
8282
typedef pmacc::math::CT::max<
8383
LowerMarginInterpolation,
84-
GetMargin<fieldSolver::FieldSolver, FIELD_E>::LowerMargin
84+
GetMargin<fields::Solver, FIELD_E>::LowerMargin
8585
>::type LowerMarginInterpolationAndSolver;
8686
typedef pmacc::math::CT::max<
8787
UpperMarginInterpolation,
88-
GetMargin<fieldSolver::FieldSolver, FIELD_E>::UpperMargin
88+
GetMargin<fields::Solver, FIELD_E>::UpperMargin
8989
>::type UpperMarginInterpolationAndSolver;
9090

9191
/* Calculate upper and lower margin for pusher
@@ -233,7 +233,7 @@ void FieldE::laserManipulation( uint32_t currentStep )
233233
*
234234
*
235235
* @todo: might also lack temporal offset since our formulas are E(x,z,t) instead of E(x,y,z,t)
236-
* `const int max_y_neighbors = Get<fieldSolver::FieldSolver::OffsetOrigin_E, 1 >::value;`
236+
* `const int max_y_neighbors = Get<fields::Solver::OffsetOrigin_E, 1 >::value;`
237237
*
238238
* @todo Right now, the phase could be wrong ( == is cloned)
239239
* @see LaserPhysics.hpp

include/picongpu/fields/FieldJ.tpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,12 @@ fieldJ( cellDescription.getGridLayout( ) ), fieldJrecv( nullptr )
8484
* -> use max(shape,filter) */
8585
typedef pmacc::math::CT::max<
8686
LowerMarginShapes,
87-
GetMargin<fieldSolver::CurrentInterpolation>::LowerMargin
87+
GetMargin<typename fields::Solver::CurrentInterpolation>::LowerMargin
8888
>::type LowerMargin;
8989

9090
typedef pmacc::math::CT::max<
9191
UpperMarginShapes,
92-
GetMargin<fieldSolver::CurrentInterpolation>::UpperMargin
92+
GetMargin<typename fields::Solver::CurrentInterpolation>::UpperMargin
9393
>::type UpperMargin;
9494

9595
const DataSpace<simDim> originGuard( LowerMargin( ).toRT( ) );
@@ -125,8 +125,8 @@ fieldJ( cellDescription.getGridLayout( ) ), fieldJrecv( nullptr )
125125
}
126126

127127
/* Receive border values in own guard for "receive" communication pattern - necessary for current interpolation/filter */
128-
const DataSpace<simDim> originRecvGuard( GetMargin<fieldSolver::CurrentInterpolation>::LowerMargin( ).toRT( ) );
129-
const DataSpace<simDim> endRecvGuard( GetMargin<fieldSolver::CurrentInterpolation>::UpperMargin( ).toRT( ) );
128+
const DataSpace<simDim> originRecvGuard( GetMargin<typename fields::Solver::CurrentInterpolation>::LowerMargin( ).toRT( ) );
129+
const DataSpace<simDim> endRecvGuard( GetMargin<typename fields::Solver::CurrentInterpolation>::UpperMargin( ).toRT( ) );
130130
if( originRecvGuard != DataSpace<simDim>::create(0) ||
131131
endRecvGuard != DataSpace<simDim>::create(0) )
132132
{

include/picongpu/fields/FieldTmp.tpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
#include "picongpu/simulation_defines.hpp"
2424
#include "picongpu/fields/FieldTmp.kernel"
25-
#include "MaxwellSolver/Solvers.hpp"
25+
#include "picongpu/fields/MaxwellSolver/Solvers.hpp"
2626
#include "picongpu/fields/numericalCellTypes/NumericalCellTypes.hpp"
2727
#include "picongpu/traits/GetMargin.hpp"
2828
#include "picongpu/particles/traits/GetInterpolation.hpp"
@@ -102,8 +102,8 @@ namespace picongpu
102102
FieldTmpLowerMargin>::type SpeciesFieldTmpLowerMargin;
103103

104104
typedef pmacc::math::CT::max<
105-
GetMargin<fieldSolver::FieldSolver, FIELD_B>::LowerMargin,
106-
GetMargin<fieldSolver::FieldSolver, FIELD_E>::LowerMargin>::type
105+
GetMargin<fields::Solver, FIELD_B>::LowerMargin,
106+
GetMargin<fields::Solver, FIELD_E>::LowerMargin>::type
107107
FieldSolverLowerMargin;
108108

109109
typedef pmacc::math::CT::max<
@@ -130,8 +130,8 @@ namespace picongpu
130130
FieldTmpUpperMargin>::type SpeciesFieldTmpUpperMargin;
131131

132132
typedef pmacc::math::CT::max<
133-
GetMargin<fieldSolver::FieldSolver, FIELD_B>::UpperMargin,
134-
GetMargin<fieldSolver::FieldSolver, FIELD_E>::UpperMargin>::type
133+
GetMargin<fields::Solver, FIELD_B>::UpperMargin,
134+
GetMargin<fields::Solver, FIELD_E>::UpperMargin>::type
135135
FieldSolverUpperMargin;
136136

137137
typedef pmacc::math::CT::max<

include/picongpu/fields/MaxwellSolver/DirSplitting/DirSplitting.def

Lines changed: 36 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,31 +20,51 @@
2020
#pragma once
2121

2222
#include "picongpu/simulation_defines.hpp"
23+
#include "picongpu/fields/currentInterpolation/CurrentInterpolation.def"
2324

2425
namespace picongpu
2526
{
26-
namespace dirSplitting
27+
namespace fields
2728
{
28-
class DirSplitting;
29-
} // dirSplitting
29+
namespace maxwellSolver
30+
{
31+
32+
template< typename T_CurrentInterpolation = currentInterpolation::NoneDS >
33+
class DirSplitting;
34+
35+
} // namespace maxwellSolver
36+
} // namespace fields
3037

3138
namespace traits
3239
{
3340

34-
template<>
35-
struct GetMargin<picongpu::dirSplitting::DirSplitting, picongpu::FIELD_B>
36-
{
37-
typedef pmacc::math::CT::Int < 1, 1, 1 > LowerMargin;
38-
typedef pmacc::math::CT::Int < 1, 1, 1 > UpperMargin;
39-
};
41+
template< typename T_CurrentInterpolation >
42+
struct GetMargin<
43+
picongpu::fields::maxwellSolver::DirSplitting< T_CurrentInterpolation >,
44+
picongpu::FIELD_B
45+
>
46+
{
47+
using LowerMargin = pmacc::math::CT::Int <
48+
1,
49+
1,
50+
1
51+
>;
52+
using UpperMargin = LowerMargin;
53+
};
4054

41-
template<>
42-
struct GetMargin<picongpu::dirSplitting::DirSplitting, picongpu::FIELD_E>
43-
{
44-
typedef pmacc::math::CT::Int < 1, 1, 1 > LowerMargin;
45-
typedef pmacc::math::CT::Int < 1, 1, 1 > UpperMargin;
46-
};
55+
template< typename T_CurrentInterpolation >
56+
struct GetMargin<
57+
picongpu::fields::maxwellSolver::DirSplitting< T_CurrentInterpolation >,
58+
picongpu::FIELD_E
59+
>
60+
{
61+
using LowerMargin = pmacc::math::CT::Int <
62+
1,
63+
1,
64+
1
65+
>;
66+
using UpperMargin = LowerMargin;
67+
};
4768

4869
} //namespace traits
49-
5070
} // picongpu

0 commit comments

Comments
 (0)