Coverage for pySDC/projects/Second_orderSDC/harmonic_oscillator_params.py: 100%
10 statements
« prev ^ index » next coverage.py v7.6.7, created at 2024-11-16 14:51 +0000
« prev ^ index » next coverage.py v7.6.7, created at 2024-11-16 14:51 +0000
1import numpy as np
2from pySDC.implementations.problem_classes.HarmonicOscillator import harmonic_oscillator
3from pySDC.implementations.sweeper_classes.boris_2nd_order import boris_2nd_order
6def get_default_harmonic_oscillator_description():
7 """
8 Routine to compute modules of the stability function
10 Returns:
11 description (dict): A dictionary containing parameters for the damped harmonic oscillator problem
12 """
14 # Initialize level parameters
15 level_params = {'restol': 1e-16, 'dt': 1.0}
17 # Initialize problem parameters for the Damped harmonic oscillator problem
18 problem_params = {'k': 0, 'mu': 0, 'u0': np.array([1, 1])}
20 # Initialize sweeper parameters
21 sweeper_params = {'quad_type': 'GAUSS', 'num_nodes': 3, 'do_coll_update': True, 'picard_mats_sweep': True}
23 # Initialize step parameters
24 step_params = {'maxiter': 50}
26 # Fill description dictionary for easy step instantiation
27 description = {
28 'problem_class': harmonic_oscillator,
29 'problem_params': problem_params,
30 'sweeper_class': boris_2nd_order,
31 'sweeper_params': sweeper_params,
32 'level_params': level_params,
33 'step_params': step_params,
34 }
36 return description