Beispiel #1
0
    def Initialize(self,N):
        self.xi, self.vi, self.xe, self.ve = self.IDatGen(N,self.DomLen)
        self.parwtse = np.ones_like(self.xe); self.parwtsi = np.ones_like(self.xi)
        self.InterpGridHydros(0)
#        self.phi[0] = SO.Poisson2Dperiodic(self.chrge*(self.rho[0] - np.mean(self.rho[0]))*self.DomLenX*self.DomLenY,self.DomLenX,self.DomLenY)
        self.phi[0] = SO.Poisson1Dperiodic(self.rho[0],self.DomLen)
        self.E[0,:] = SO.SpectralDerivative(-1.*self.phi[0],self.DomLen)
        
        ## Do an initial backward half-step to offset positions and velocities in time
        self.Epare, self.Epari = self.IPVec(self.E[0])
        dt_tmp = -1.*0.5*self.dt

        self.vi += dt_tmp*self.chrgi*self.Epari
        self.ve += dt_tmp*self.chrge*self.Epare
Beispiel #2
0
    def ComputeFieldPoisson(self,i):
#        self.phi[i] = SO.Poisson2Dperiodic(self.chrge*(self.rho[i] - np.mean(self.rho[i]))*self.DomLenX*self.DomLenY,self.DomLenX,self.DomLenY)
        self.phi[i] = SO.Poisson1Dperiodic(self.rho[i],self.DomLen)
        self.E[i,:] = SO.SpectralDerivative(-1.*self.phi[i],self.DomLen)