def CalculateOneAdaptiveTimeStep(self,state,flux,t,dt,scale,dynamics): if self.PIStepsizeControl == True: performedTimeStep, nextTimeStep, time, state, errmax = NumericalMethods.rkqs(state,flux,t,dt,self.eps,scale,dynamics, self.PIStepsizeControl,self.pre_errmax) self.pre_errmax = errmax return performedTimeStep, nextTimeStep, time, state else: return NumericalMethods.rkqs(state,flux,t,dt,self.eps,scale,dynamics)
def CalculateOneAdaptiveTimeStep(self,state,flux,t,dt,scale,dynamics): correction = self.SymmetricCorrection(state) if self.PIStepsizeControl == True: performedTimeStep, nextTimeStep, time, newstate, errmax = NumericalMethods.rkqs(state,flux,t,dt,self.eps,scale,dynamics, self.PIStepsizeControl,self.pre_errmax) self.pre_errmax = errmax return performedTimeStep, nextTimeStep, time, newstate+correction else: performedTimeStep, nextTimeStep, time, newstate = NumericalMethods.rkqs(state,flux,t,dt,self.eps,scale,dynamics) return performedTimeStep, nextTimeStep, time, newstate+correction
def CalculateOneAdaptiveTimeStep(self,state,flux,t,dt,scale,dynamics): if self.PIStepsizeControl == True: performedTimeStep, nextTimeStep, time, newstate, errmax = NumericalMethods.rkqs(state,flux,t,dt,self.eps,scale,dynamics, self.PIStepsizeControl,self.pre_errmax) self.pre_errmax = errmax if self.CheckInstability(newstate) == False: FieldInitializer.SaveNumpyFileFromState(newstate,self.filename) self.stop = True return performedTimeStep, nextTimeStep, time, newstate else: performedTimeStep, nextTimeStep, time, newstate = NumericalMethods.rkqs(state,flux,t,dt,self.eps,scale,dynamics) if self.CheckInstability(newstate) == False: FieldInitializer.SaveNumpyFileFromState(newstate,self.filename) self.stop = True return performedTimeStep, nextTimeStep, time, newstate
def CalculateOneFixedTimeStep(self,state,flux,t,dt,dynamics): newState, error = NumericalMethods.rkck(state,flux,t,dt,dynamics) self.FourierRegularize(newState, dt) return newState
def CalculateOneFixedTimeStep(self,state,flux,t,dt,dynamics): correction = self.SymmetricCorrection(state) newState, error = NumericalMethods.rkck(state,flux,t,dt,dynamics) return newState+correction
def CalculateOneFixedTimeStep(self,state,flux,t,dt,dynamics): newState, error = NumericalMethods.rkck(state,flux,t,dt,dynamics) return newState