@@ -70,16 +70,26 @@ struct ConditionCheck<DirSplitting, T_Dummy>
7070class DirSplitting : private ConditionCheck <fieldSolver::FieldSolver>
7171{
7272private:
73- template <typename CursorE, typename CursorB, typename GridSize>
73+ template <typename OrientationTwist, typename CursorE, typename CursorB, typename GridSize>
7474 void propagate (CursorE cursorE, CursorB cursorB, GridSize gridSize) const
7575 {
76- typedef SuperCellSize BlockDim;
76+ using namespace cursor ::tools;
77+ using namespace PMacc ::math::tools;
78+
79+ PMACC_AUTO (gridSizeTwisted,twistVectorAxes<OrientationTwist>(gridSize));
80+
81+ /* twist components of the supercell */
82+ typedef PMacc::math::CT::Int<
83+ PMacc::math::CT::At<SuperCellSize,typename OrientationTwist::x>::type::value,
84+ PMacc::math::CT::At<SuperCellSize,typename OrientationTwist::y>::type::value,
85+ PMacc::math::CT::At<SuperCellSize,typename OrientationTwist::z>::type::value
86+ > BlockDim;
7787
7888 algorithm::kernel::ForeachBlock<BlockDim> foreach;
79- foreach (zone::SphericZone<3 >(PMacc::math::Size_t<3 >(BlockDim::x::value, gridSize .y (), gridSize .z ())),
80- cursor::make_NestedCursor (cursorE),
81- cursor::make_NestedCursor (cursorB),
82- DirSplittingKernel<BlockDim>((int )gridSize .x ()));
89+ foreach (zone::SphericZone<3 >(PMacc::math::Size_t<3 >(BlockDim::x::value, gridSizeTwisted .y (), gridSizeTwisted .z ())),
90+ cursor::make_NestedCursor (twistVectorFieldAxes<OrientationTwist>( cursorE) ),
91+ cursor::make_NestedCursor (twistVectorFieldAxes<OrientationTwist>( cursorB) ),
92+ DirSplittingKernel<BlockDim>((int )gridSizeTwisted .x ()));
8393 }
8494public:
8595 DirSplitting (MappingDesc) {}
@@ -107,25 +117,30 @@ class DirSplitting : private ConditionCheck<fieldSolver::FieldSolver>
107117
108118 PMacc::math::Size_t<3 > gridSize = fieldE_coreBorder.size ();
109119
110- propagate (fieldE_coreBorder.origin (),
120+
121+ typedef PMacc::math::CT::Int<0 ,1 ,2 > Orientation_X;
122+ propagate<Orientation_X>(
123+ fieldE_coreBorder.origin (),
111124 fieldB_coreBorder.origin (),
112- fieldE_coreBorder. size () );
125+ gridSize );
113126
114127 __setTransactionEvent (fieldE.asyncCommunication (__getTransactionEvent ()));
115128 __setTransactionEvent (fieldB.asyncCommunication (__getTransactionEvent ()));
116129
117130 typedef PMacc::math::CT::Int<1 ,2 ,0 > Orientation_Y;
118- propagate (twistVectorFieldAxes<Orientation_Y>(fieldE_coreBorder.origin ()),
119- twistVectorFieldAxes<Orientation_Y>(fieldB_coreBorder.origin ()),
120- twistVectorAxes<Orientation_Y>(gridSize));
131+ propagate<Orientation_Y>(
132+ fieldE_coreBorder.origin (),
133+ fieldB_coreBorder.origin (),
134+ gridSize);
121135
122136 __setTransactionEvent (fieldE.asyncCommunication (__getTransactionEvent ()));
123137 __setTransactionEvent (fieldB.asyncCommunication (__getTransactionEvent ()));
124138
125139 typedef PMacc::math::CT::Int<2 ,0 ,1 > Orientation_Z;
126- propagate (twistVectorFieldAxes<Orientation_Z>(fieldE_coreBorder.origin ()),
127- twistVectorFieldAxes<Orientation_Z>(fieldB_coreBorder.origin ()),
128- twistVectorAxes<Orientation_Z>(gridSize));
140+ propagate<Orientation_Z>(
141+ fieldE_coreBorder.origin (),
142+ fieldB_coreBorder.origin (),
143+ gridSize);
129144
130145 if (laserProfile::INIT_TIME > float_X (0.0 ))
131146 dc.getData <FieldE > (FieldE::getName (), true ).laserManipulation (currentStep);
0 commit comments