2020#pragma once
2121
2222#include " picongpu/simulation_defines.hpp"
23+ #include " picongpu/traits/FieldPosition.hpp"
2324#include " picongpu/fields/Fields.def"
25+
2426#include < pmacc/math/Vector.hpp>
2527
2628
2729namespace picongpu
2830{
29- namespace yeeCell
31+ namespace numericalCellTypes
3032{
33+ struct YeeCell {};
34+ } // namespace numericalCellTypes
35+
3136namespace traits
3237{
33- /* * \tparam floatD_X position of the component in the cell
34- * \tparam DIM3 Fields (E/B/J) have 3 components, even in 1 or 2D !
35- */
36- typedef const ::pmacc::math::Vector<float2_X,DIM3> VectorVector2D3V;
37- typedef const ::pmacc::math::Vector<float3_X,DIM3> VectorVector3D3V;
38-
39- template <typename T_Field, uint32_t T_simDim = simDim>
40- struct FieldPosition ;
41-
4238 /* * position (float2_X) in cell for E_x, E_y, E_z
4339 */
4440 template <>
45- struct FieldPosition <FieldE, DIM2>
41+ struct FieldPosition <numericalCellTypes::YeeCell, FieldE, DIM2>
4642 {
43+ /* * \tparam float2_X position of the component in the cell
44+ * \tparam DIM3 Fields (E/B/J) have 3 components, even in 1 or 2D !
45+ */
46+ using VectorVector2D3V = const ::pmacc::math::Vector<
47+ float2_X,
48+ DIM3
49+ >;
4750 // / boost::result_of hints
4851 template <class > struct result ;
4952
@@ -69,8 +72,16 @@ namespace traits
6972 /* * position (float3_X) in cell for E_x, E_y, E_z
7073 */
7174 template <>
72- struct FieldPosition <FieldE, DIM3>
75+ struct FieldPosition <numericalCellTypes::YeeCell, FieldE, DIM3>
7376 {
77+ /* * \tparam float2_X position of the component in the cell
78+ * \tparam DIM3 Fields (E/B/J) have 3 components, even in 1 or 2D !
79+ */
80+ using VectorVector3D3V = const ::pmacc::math::Vector<
81+ float3_X,
82+ DIM3
83+ >;
84+
7485 // / boost::result_of hints
7586 template <class > struct result ;
7687
@@ -96,8 +107,15 @@ namespace traits
96107 /* * position (float2_X) in cell for B_x, B_y, B_z
97108 */
98109 template <>
99- struct FieldPosition <FieldB, DIM2>
110+ struct FieldPosition <numericalCellTypes::YeeCell, FieldB, DIM2>
100111 {
112+ /* * \tparam float2_X position of the component in the cell
113+ * \tparam DIM3 Fields (E/B/J) have 3 components, even in 1 or 2D !
114+ */
115+ using VectorVector2D3V = const ::pmacc::math::Vector<
116+ float2_X,
117+ DIM3
118+ >;
101119 // / boost::result_of hints
102120 template <class > struct result ;
103121
@@ -123,8 +141,16 @@ namespace traits
123141 /* * position (float3_X) in cell for B_x, B_y, B_z
124142 */
125143 template <>
126- struct FieldPosition <FieldB, DIM3>
144+ struct FieldPosition <numericalCellTypes::YeeCell, FieldB, DIM3>
127145 {
146+ /* * \tparam float2_X position of the component in the cell
147+ * \tparam DIM3 Fields (E/B/J) have 3 components, even in 1 or 2D !
148+ */
149+ using VectorVector3D3V = const ::pmacc::math::Vector<
150+ float3_X,
151+ DIM3
152+ >;
153+
128154 // / boost::result_of hints
129155 template <class > struct result ;
130156
@@ -151,8 +177,8 @@ namespace traits
151177 * J_x, J_y, J_z
152178 */
153179 template <uint32_t T_simDim>
154- struct FieldPosition <FieldJ, T_simDim> :
155- public FieldPosition<FieldE, T_simDim>
180+ struct FieldPosition <numericalCellTypes::YeeCell, FieldJ, T_simDim> :
181+ public FieldPosition<numericalCellTypes::YeeCell, FieldE, T_simDim>
156182 {
157183 HDINLINE FieldPosition ()
158184 {
@@ -164,7 +190,7 @@ namespace traits
164190 * scalar field FieldTmp
165191 */
166192 template <uint32_t T_simDim>
167- struct FieldPosition <FieldTmp, T_simDim>
193+ struct FieldPosition <numericalCellTypes::YeeCell, FieldTmp, T_simDim>
168194 {
169195 typedef pmacc::math::Vector<float_X, T_simDim> FieldPos;
170196 typedef pmacc::math::Vector<FieldPos, DIM1> ReturnType;
@@ -186,6 +212,5 @@ namespace traits
186212 return ReturnType ( FieldPos::create (0.0 ) );
187213 }
188214 };
189- } // traits
190- } // yeeCell
191- } // picongpu
215+ } // namespace traits
216+ } // namespace picongpu
0 commit comments