def test_solvers(sol): config.update({ 'nu': 0.000625, # Viscosity 'dt': 0.01, # Time step 'T': 0.1, # End time 'convection': 'Vortex' }) solver = get_solver(regression_test=regression_test, parse_args=sol) context = solver.get_context() initialize(solver, **context) solve(solver, context) config.params.make_profile = 1 config.params.dealias = '3/2-rule' initialize(solver, **context) solve(solver, context) #config.params.dealias = '2/3-rule' #config.params.optimization = 'cython' #reload_module(solver) #initialize(solver, **context) #solve(solver, context) config.params.write_result = 1 config.params.checkpoint = 1 config.params.dt = 0.01 config.params.t = 0.0 config.params.tstep = 0 config.params.T = 0.04 solver.regression_test = lambda c: None solve(solver, context)
def test_integrators(sol): config.update({ 'nu': 0.000625, # Viscosity 'dt': 0.01, # Time step 'T': 0.1, # End time 'convection': 'Vortex' }) solver = get_solver(regression_test=regression_test, parse_args=sol) context = solver.get_context() for integrator in ('RK4', 'ForwardEuler', 'AB2', 'BS5_adaptive', 'BS5_fixed'): if integrator in ('ForwardEuler', 'AB2'): config.params.ntol = 4 else: config.params.ntol = 7 config.params.integrator = integrator initialize(solver, context) solve(solver, context)
def test_integrators(sol): config.update( { 'nu': 0.000625, # Viscosity 'dt': 0.01, # Time step 'T': 0.1, # End time 'convection': 'Vortex' } ) solver = get_solver(regression_test=regression_test, parse_args=sol) context = solver.get_context() for integrator in ('RK4', 'ForwardEuler', 'AB2', 'BS5_adaptive', 'BS5_fixed'): if integrator in ('ForwardEuler', 'AB2'): config.params.ntol = 4 else: config.params.ntol = 7 config.params.integrator = integrator initialize(solver, context) solve(solver, context)
def test_solvers(sol): config.update( { 'nu': 0.000625, # Viscosity 'dt': 0.01, # Time step 'T': 0.1, # End time 'convection': 'Vortex' } ) solver = get_solver(regression_test=regression_test, parse_args=sol) context = solver.get_context() initialize(solver, context) solve(solver, context) config.params.make_profile = 1 config.params.dealias = '3/2-rule' initialize(solver, context) solve(solver, context) config.params.dealias = '2/3-rule' for opt in ('cython', 'numba', 'pythran'): config.params.optimization = opt reload_module(solver) # To load optimized methods initialize(solver, context) solve(solver, context) config.params.write_result = 2 config.params.checkpoint = 2 config.params.dt = 0.01 config.params.t = 0.0 config.params.tstep = 0 config.params.T = 0.04 solver.regression_test = lambda c: None solve(solver, context)