# Path: blond/utils/bmath.py
# def use_mpi():
# def mpiMode():
# def use_fftw():
# def use_precision(_precision='double'):
# def update_active_dict(new_dict):


from builtins import range, object
from scipy.integrate import cumtrapz
from ..utils import bmath as bm
import numpy as np
import ctypes
import warnings
        if (self.cavityFB is not None) and (self.profile is None):
            # ProfileError
            raise RuntimeError("ERROR in RingAndRFTracker: Please specify a" +
                               " Profile object to use the CavityFeedback class")
        if (self.rf_params.empty is True) and (self.periodicity is True):
            # PeriodicityError
            raise RuntimeError("ERROR in RingAndRFTracker: Empty RFStation" +
                               " with periodicity not yet implemented!")
        if (self.cavityFB is not None) and (self.interpolation is False):
            self.interpolation = True
            warnings.warn('Setting interpolation to TRUE')
            # self.logger.warning("Setting interpolation to TRUE")

    def kick(self, beam_dt, beam_dE, index):
        """Function updating the particle energy due to the RF kick in a given
        RF station. The kicks are summed over the different harmonic RF systems
        in the station. The cavity phase can be shifted by the user via
        phi_offset. The main RF (harmonic[0]) has by definition phase = 0 at
        time = 0 below transition. The phases of all other RF systems are
        defined w.r.t.\ to the main RF. The increment in energy is given by the
        discrete equation of motion:

        .. math::
            \Delta E^{n+1} = \Delta E^n + \sum_{k=0}^{n_{\mathsf{rf}}-1}{e V_k^n \\sin{\\left(\omega_{\mathsf{rf,k}}^n \\Delta t^n + \phi_{\mathsf{rf,k}}^n \\right)}} - (E_s^{n+1} - E_s^n)

        """

        # voltage_kick = np.ascontiguousarray(self.charge*self.voltage[:, index])
        # omegarf_kick = np.ascontiguousarray(self.omega_rf[:, index])
        # phirf_kick = np.ascontiguousarray(self.phi_rf[:, index])

# Path: blond/utils/bmath.py
# def use_mpi():
# def mpiMode():
# def use_fftw():
# def use_precision(_precision='double'):
# def update_active_dict(new_dict):


# Path: blond/trackers/tracker.py
from builtins import range, object
from scipy.integrate import cumtrapz
from ..utils import bmath as bm
import numpy as np
import ctypes
import warnings

        if (self.cavityFB is not None) and (self.profile is None):
            # ProfileError
            raise RuntimeError("ERROR in RingAndRFTracker: Please specify a" +
                               " Profile object to use the CavityFeedback class")
        if (self.rf_params.empty is True) and (self.periodicity is True):
            # PeriodicityError
            raise RuntimeError("ERROR in RingAndRFTracker: Empty RFStation" +
                               " with periodicity not yet implemented!")
        if (self.cavityFB is not None) and (self.interpolation is False):
            self.interpolation = True
            warnings.warn('Setting interpolation to TRUE')
            # self.logger.warning("Setting interpolation to TRUE")

    def kick(self, beam_dt, beam_dE, index):
        """Function updating the particle energy due to the RF kick in a given
        RF station. The kicks are summed over the different harmonic RF systems
        in the station. The cavity phase can be shifted by the user via
        phi_offset. The main RF (harmonic[0]) has by definition phase = 0 at
        time = 0 below transition. The phases of all other RF systems are
        defined w.r.t.\ to the main RF. The increment in energy is given by the
        discrete equation of motion:

        .. math::
            \Delta E^{n+1} = \Delta E^n + \sum_{k=0}^{n_{\mathsf{rf}}-1}{e V_k^n \\sin{\\left(\omega_{\mathsf{rf,k}}^n \\Delta t^n + \phi_{\mathsf{rf,k}}^n \\right)}} - (E_s^{n+1} - E_s^n)

        """

        # voltage_kick = np.ascontiguousarray(self.charge*self.voltage[:, index])
        # omegarf_kick = np.ascontiguousarray(self.omega_rf[:, index])
        # phirf_kick = np.ascontiguousarray(self.phi_rf[:, index])

        bm.kick(beam_dt, beam_dE, self.voltage[:, index],