Skip to content

Commit ad710a8

Browse files
committed
Add Margin Traits: FieldJ Communication
1 parent c270936 commit ad710a8

File tree

3 files changed

+56
-2
lines changed

3 files changed

+56
-2
lines changed

src/picongpu/include/fields/FieldJ.tpp

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,31 @@ fieldJ( cellDescription.getGridLayout( ) ), fieldE( NULL ), fieldB( NULL )
5757
{
5858
const DataSpace<simDim> coreBorderSize = cellDescription.getGridLayout( ).getDataSpaceWithoutGuarding( );
5959

60-
60+
/* cell margins the current might spread to due to particle shapes */
6161
typedef typename bmpl::accumulate<
6262
VectorAllSpecies,
6363
typename PMacc::math::CT::make_Int<simDim, 0>::type,
6464
PMacc::math::CT::max<bmpl::_1, GetLowerMargin< GetCurrentSolver<bmpl::_2> > >
65-
>::type LowerMargin;
65+
>::type LowerMarginShapes;
6666

6767
typedef typename bmpl::accumulate<
6868
VectorAllSpecies,
6969
typename PMacc::math::CT::make_Int<simDim, 0>::type,
7070
PMacc::math::CT::max<bmpl::_1, GetUpperMargin< GetCurrentSolver<bmpl::_2> > >
71+
>::type UpperMarginShapes;
72+
73+
/* margins are always positive, also for lower margins
74+
* additional current interpolations and current filters on FieldJ might
75+
* spread the dependencies on neighboring cells
76+
* -> use max(shape,filter) */
77+
typedef typename PMacc::math::CT::max<
78+
LowerMarginShapes,
79+
GetMargin<fieldSolver::CurrentInterpolation>::LowerMargin
80+
>::type LowerMargin;
81+
82+
typedef typename PMacc::math::CT::max<
83+
UpperMarginShapes,
84+
GetMargin<fieldSolver::CurrentInterpolation>::UpperMargin
7185
>::type UpperMargin;
7286

7387
const DataSpace<simDim> originGuard( LowerMargin( ).toRT( ) );

src/picongpu/include/fields/currentInterpolation/Binomial/Binomial.def

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,24 @@ struct Binomial;
3131

3232
} /* namespace currentInterpolation */
3333

34+
namespace traits
35+
{
36+
37+
/* Get margin of the current interpolation
38+
*
39+
* This class defines a LowerMargin and an UpperMargin.
40+
*/
41+
template<uint32_t T_dim>
42+
struct GetMargin<picongpu::currentInterpolation::Binomial<T_dim > >
43+
{
44+
private:
45+
typedef picongpu::currentInterpolation::Binomial<T_dim> MyInterpolation;
46+
47+
public:
48+
typedef typename MyInterpolation::LowerMargin LowerMargin;
49+
typedef typename MyInterpolation::UpperMargin UpperMargin;
50+
};
51+
52+
} /* namespace traits */
53+
3454
} /* namespace picongpu */

src/picongpu/include/fields/currentInterpolation/None/None.def

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,24 @@ struct None;
3030

3131
} /* namespace currentInterpolation */
3232

33+
namespace traits
34+
{
35+
36+
/* Get margin of the current interpolation
37+
*
38+
* This class defines a LowerMargin and an UpperMargin.
39+
*/
40+
template<uint32_t T_dim>
41+
struct GetMargin<picongpu::currentInterpolation::None<T_dim > >
42+
{
43+
private:
44+
typedef picongpu::currentInterpolation::None<T_dim> MyInterpolation;
45+
46+
public:
47+
typedef typename MyInterpolation::LowerMargin LowerMargin;
48+
typedef typename MyInterpolation::UpperMargin UpperMargin;
49+
};
50+
51+
} /* namespace traits */
52+
3353
} /* namespace picongpu */

0 commit comments

Comments
 (0)