Пример #1
0
        DINLINE void operator()(DataBoxJ dataBoxJ,
                                const PosType pos,
                                const VelType velocity,
                                const ChargeType charge, const float3_X& cellSize, const float_X deltaTime)
    {
        this->charge = charge;
        const float3_X deltaPos = float3_X(velocity.x() * deltaTime / cellSize.x(),
                                           velocity.y() * deltaTime / cellSize.y(),
                                           velocity.z() * deltaTime / cellSize.z());
        const PosType oldPos = pos - deltaPos;
        Line line(oldPos, pos);
        BOOST_AUTO(cursorJ, dataBoxJ.toCursor());

        /**
         * \brief the following three calls separate the 3D current deposition
         * into three independent 1D calls, each for one direction and current component.
         * Therefore the coordinate system has to be rotated so that the z-direction
         * is always specific.
         */

        using namespace cursor::tools;
        cptCurrent1D(twistVectorFieldAxes<PMacc::math::CT::Int < 1, 2, 0 > >(cursorJ), rotateOrigin < 1, 2, 0 > (line), cellSize.x());
        cptCurrent1D(twistVectorFieldAxes<PMacc::math::CT::Int < 2, 0, 1 > >(cursorJ), rotateOrigin < 2, 0, 1 > (line), cellSize.y());
        cptCurrent1D(cursorJ, line, cellSize.z());
    }
Пример #2
0
    DINLINE void operator()(DataBoxJ dataBoxJ,
                            const PosType pos,
                            const VelType velocity,
                            const ChargeType charge, const float_X deltaTime)
    {
        this->charge = charge;
        const float2_X deltaPos = float2_X(velocity.x() * deltaTime / cellSize.x(),
                                           velocity.y() * deltaTime / cellSize.y());
        const PosType oldPos = pos - deltaPos;
        Line<float2_X> line(oldPos, pos);
        BOOST_AUTO(cursorJ, dataBoxJ.toCursor());

        if (supp % 2 == 1)
        {
            /* odd support
             * we need only for odd supports a shift because for even supports
             * we have always the grid range [-support/2+1;support/2] if we have
             * no moving particle
             *
             * With this coordinate shift we only look to the support of one
             * particle which is not moving. Moving praticles coordinate shifts
             * are handled later (named offset_*)
             */

            /* for any direction
             * if pos> 0.5
             * shift curser+1 and new_pos=old_pos-1
             *
             * floor(pos*2.0) is equal (pos > 0.5)
             */
            float2_X coordinate_shift(
                                      float_X(math::floor(pos.x() * float_X(2.0))),
                                      float_X(math::floor(pos.y() * float_X(2.0)))
                                      );
            cursorJ = cursorJ(
                              PMacc::math::Int < 2 > (
                                                      coordinate_shift.x(),
                                                      coordinate_shift.y()
                                                      ));
            //same as: pos = pos - coordinate_shift;
            line.pos0 -= (coordinate_shift);
            line.pos1 -= (coordinate_shift);
        }

        /**
         * \brief the following three calls separate the 3D current deposition
         * into three independent 1D calls, each for one direction and current component.
         * Therefore the coordinate system has to be rotated so that the z-direction
         * is always specific.
         */

        using namespace cursor::tools;
        cptCurrent1D(cursorJ, line, cellSize.x());
        cptCurrent1D(twistVectorFieldAxes<PMacc::math::CT::Int < 1, 0 > >(cursorJ), rotateOrigin < 1, 0 > (line), cellSize.y());
        cptCurrentZ(cursorJ, line, velocity.z());
    }