Skip to content

Commit da9519d

Browse files
refactore filed solver and nummerical cell type usage
- get numerical cell type from the defined field solver - use new field solver definition `fields::Solver`
1 parent 2cce486 commit da9519d

File tree

20 files changed

+64
-49
lines changed

20 files changed

+64
-49
lines changed

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/background/templates/TWTS/BField.tpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
#include "picongpu/fields/background/templates/TWTS/GetInitialTimeDelay_SI.tpp"
3333
#include "picongpu/fields/background/templates/TWTS/getFieldPositions_SI.tpp"
3434
#include "picongpu/fields/background/templates/TWTS/BField.hpp"
35+
#include "picongpu/fields/MaxwellSolver/Solvers.hpp"
36+
3537

3638
namespace picongpu
3739
{
@@ -270,7 +272,7 @@ namespace twts
270272
const uint32_t currentStep ) const
271273
{
272274
const float_64 time_SI = float_64(currentStep) * dt - tdelay;
273-
const fieldSolver::numericalCellType::traits::FieldPosition<FieldB> fieldPosB;
275+
const traits::FieldPosition<typename fields::Solver::NummericalCellType, FieldB> fieldPosB;
274276

275277
const pmacc::math::Vector<floatD_64,detail::numComponents> bFieldPositions_SI =
276278
detail::getFieldPositions_SI(cellIdx, halfSimSize,

include/picongpu/fields/background/templates/TWTS/EField.tpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include "picongpu/fields/background/templates/TWTS/GetInitialTimeDelay_SI.tpp"
3333
#include "picongpu/fields/background/templates/TWTS/getFieldPositions_SI.tpp"
3434
#include "picongpu/fields/background/templates/TWTS/EField.hpp"
35+
#include "picongpu/fields/MaxwellSolver/Solvers.hpp"
3536

3637
namespace picongpu
3738
{
@@ -175,7 +176,7 @@ namespace twts
175176
const uint32_t currentStep ) const
176177
{
177178
const float_64 time_SI = float_64(currentStep) * dt - tdelay;
178-
const fieldSolver::numericalCellType::traits::FieldPosition<FieldE> fieldPosE;
179+
const traits::FieldPosition<typename fields::Solver::NummericalCellType, FieldE> fieldPosE;
179180

180181
const pmacc::math::Vector<floatD_64,detail::numComponents> eFieldPositions_SI =
181182
detail::getFieldPositions_SI(cellIdx, halfSimSize,

include/picongpu/fields/background/templates/TWTS/getFieldPositions_SI.tpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ namespace detail
5959
* that to the total cell indices. The physical field coordinate origin is transversally
6060
* centered with respect to the global simulation volume.
6161
* pmacc::math::Vector<floatD_X, numComponents> fieldPositions =
62-
* fieldSolver::numericalCellType::traits::FieldPosition<FieldE>(); */
62+
* traits::FieldPosition<typename fields::Solver::NummericalCellType, FieldE>(); */
6363
pmacc::math::Vector<floatD_X, numComponents> fieldPositions = fieldOnGridPositions;
6464

6565
pmacc::math::Vector<floatD_64,numComponents> fieldPositions_SI;

include/picongpu/fields/currentDeposition/ZigZag/ZigZag.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
#include <boost/mpl/if.hpp>
3535
#include <pmacc/compileTime/AllCombinations.hpp>
3636
#include "picongpu/fields/currentDeposition/ZigZag/EvalAssignmentFunction.hpp"
37+
#include "picongpu/fields/MaxwellSolver/Solvers.hpp"
38+
#include "picongpu/traits/FieldPosition.hpp"
3739

3840

3941
namespace picongpu
@@ -222,7 +224,7 @@ struct ZigZag
222224
* - run calculations in a shape optimized coordinate system
223225
* with fixed interpolation points
224226
*/
225-
const fieldSolver::numericalCellType::traits::FieldPosition<FieldJ> fieldPosJ;
227+
const traits::FieldPosition<typename fields::Solver::NummericalCellType, FieldJ> fieldPosJ;
226228
ShiftCoordinateSystem<Supports_direction>()(cursor, pos, fieldPosJ()[dir]);
227229

228230
/* define grid points where we evaluate the shape function*/

include/picongpu/particles/Particles.kernel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,8 +600,8 @@ struct PushParticlePerFrame
600600

601601
DataSpace<TVec::dim> localCell(DataSpaceOperations<TVec::dim>::template map<TVec > (particleCellIdx));
602602

603-
const fieldSolver::numericalCellType::traits::FieldPosition<FieldE> fieldPosE;
604-
const fieldSolver::numericalCellType::traits::FieldPosition<FieldB> fieldPosB;
603+
const traits::FieldPosition<typename fields::Solver::NummericalCellType, FieldE> fieldPosE;
604+
const traits::FieldPosition<typename fields::Solver::NummericalCellType, FieldB> fieldPosB;
605605

606606
auto functorEfield = CreateInterpolationForPusher<Field2ParticleInterpolation>()( eBox.shift(localCell).toCursor(), fieldPosE() );
607607
auto functorBfield = CreateInterpolationForPusher<Field2ParticleInterpolation>()( bBox.shift(localCell).toCursor(), fieldPosB() );

include/picongpu/particles/bremsstrahlung/Bremsstrahlung.tpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
#include "picongpu/algorithms/Gamma.hpp"
2323
#include "picongpu/traits/frame/GetMass.hpp"
2424
#include "picongpu/traits/frame/GetCharge.hpp"
25+
#include "picongpu/fields/MaxwellSolver/Solvers.hpp"
26+
#include "picongpu/traits/FieldPosition.hpp"
2527
#include "picongpu/particles/particleToGrid/ComputeGridValuePerFrame.def"
2628
#include <pmacc/particles/operations/Assign.hpp>
2729
#include <pmacc/particles/operations/Deselect.hpp>
@@ -190,7 +192,7 @@ unsigned int Bremsstrahlung<T_IonSpecies, T_ElectronSpecies, T_PhotonSpecies>::n
190192
/* multi-dim coordinate of the local cell inside the super cell */
191193
const DataSpace<TVec::dim> localCell(DataSpaceOperations<TVec::dim>::template map<TVec > (particleCellIdx));
192194
/* interpolation of fieldTmp */
193-
const fieldSolver::numericalCellType::traits::FieldPosition<FieldTmp, simDim> fieldTmpPos;
195+
const picongpu::traits::FieldPosition<typename fields::Solver::NummericalCellType, FieldTmp, simDim> fieldTmpPos;
194196
const ValueTypeIonDensity ionDensity_norm = Field2ParticleInterpolation()
195197
(cachedIonDensity.shift(localCell).toCursor(), pos, fieldTmpPos());
196198

0 commit comments

Comments
 (0)