Coverage for pySDC/projects/Second_orderSDC/penningtrap_run_error.py: 0%

2 statements  

« prev     ^ index     » next       coverage.py v7.6.7, created at 2024-11-16 14:51 +0000

1from pySDC.projects.Second_orderSDC.penningtrap_params import penningtrap_params 

2from pySDC.projects.Second_orderSDC.penningtrap_Simulation import ComputeError 

3 

4if __name__ == '__main__': 

5 """ 

6 Implementation of the order plots of the Spectral deferred correction method for second-order problems paper. 

7 Both local and global convergence-order plots. 

8 To implement local convergence plot: 

9 Run: conv.run_local_error() 

10 To implement global convergence plot: 

11 Run: conv.run_global_error() 

12 Data: 

13 All of the data and plots saved to the data folder 

14 

15 Note: 

16 Tend: final time value can be given manually by default Tend=2 

17 """ 

18 # This code checks if the "data" folder exists or not. 

19 exec(open("check_data_folder.py").read()) 

20 # Get params for the penning trap problem from the function 

21 controller_params, description = penningtrap_params() 

22 ## ============================================================================= 

23 ## dt-timestep and num_nodes can be changed here manually 

24 description['level_params']['dt'] = 0.015625 / 4 

25 description['sweeper_params']['num_nodes'] = 4 

26 ## ============================================================================= 

27 # Give the parameters to the class 

28 conv = ComputeError(controller_params, description, time_iter=3, K_iter=(1, 2, 3), axes=(0,)) 

29 # Run local convergence order 

30 # conv.run_local_error() 

31 # Run global convergence order 

32 # ============================================================================= 

33 # To find apporximate order and expected order you can use this function 

34 # it is going to save the values in data/global_order_vs_approxorder.csv file 

35 # ============================================================================= 

36 conv.run_global_error()