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

3 statements  

« prev     ^ index     » next       coverage.py v7.5.0, created at 2024-04-29 09:02 +0000

1import numpy as np 

2from pySDC.projects.Second_orderSDC.harmonic_oscillator_params import get_default_harmonic_oscillator_description 

3from pySDC.projects.Second_orderSDC.stability_simulation import compute_and_generate_table 

4 

5if __name__ == '__main__': 

6 ''' 

7 This script generates a table to compare stability of the SDC iteration for given points, 

8 exploring different quadrature types, number of nodes, and number of iterations. 

9 

10 Additional parameters in the function `compute_and_generate_table`: 

11 - To save the table, set: `save_points_table=True`. 

12 - To change the filename, set `points_table_filename='FILENAME'`. Default is './data/point_table.txt'. 

13 ''' 

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

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

16 # Get default parameters for the harmonic oscillator problem 

17 description = get_default_harmonic_oscillator_description() 

18 

19 # Additional parameters to compute stability points 

20 helper_params = { 

21 'quad_type_list': ('GAUSS', 'LOBATTO'), # List of quadrature types 

22 'Num_iter': (2, 2), # Number of iterations 

23 'num_nodes_list': np.arange(3, 6, 1), # List of number of nodes 

24 'max_iter_list': np.arange(2, 10, 1), # List of maximum iterations 

25 } 

26 

27 points = ((1, 100), (3, 100), (10, 100)) # Stability parameters: (kappa, mu) 

28 

29 # Iterate through points and perform stability check 

30 for ii in points: 

31 compute_and_generate_table(description, helper_params, ii, check_stability_point=True, save_points_table=False)