예제 #1
0
 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)
예제 #2
0
 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
예제 #4
0
 def CalculateOneFixedTimeStep(self,state,flux,t,dt,dynamics):
     newState, error = NumericalMethods.rkck(state,flux,t,dt,dynamics)
     self.FourierRegularize(newState, dt)
     return newState
예제 #5
0
 def CalculateOneFixedTimeStep(self,state,flux,t,dt,dynamics):
     correction = self.SymmetricCorrection(state)
     newState, error = NumericalMethods.rkck(state,flux,t,dt,dynamics)
     return newState+correction
예제 #6
0
 def CalculateOneFixedTimeStep(self,state,flux,t,dt,dynamics):
     newState, error = NumericalMethods.rkck(state,flux,t,dt,dynamics)
     return newState