Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

weno_order solver keyword argument is silently ignored when kernel_language='Python' #242

Closed
ahmadia opened this issue Apr 7, 2013 · 3 comments · Fixed by #400
Closed
Labels

Comments

@ahmadia
Copy link
Member

ahmadia commented Apr 7, 2013

We should either raise an error when this occurs or fix it.

@ahmadia
Copy link
Member Author

ahmadia commented Apr 7, 2013

This is pretty simple to reproduce:

cd pyclaw/apps/acoustics_1d_homogeneous
ipython
from acoustics import acoustics
clawf = acoustics(use_petsc=False, kernel_language='Fortran', \
       solver_type='sharpclaw', weno_order=15)
clawp = acoustics(use_petsc=False, kernel_language='Python', \
       solver_type='sharpclaw', weno_order=15)
q0 = clawp.frames[0].state.get_q_global()
qfinal = clawp.frames[claw.num_output_times].state.get_q_global()
print "Python kernel error: %e" % (dx*np.linalg.norm(qfinal-q0,1))

q0 = clawf.frames[0].state.get_q_global()
qfinal = clawf.frames[claw.num_output_times].state.get_q_global()
print "Fortran kernel error: %e" % (dx*np.linalg.norm(qfinal-q0,1))

On my machine I see the following output:

Python kernel error: 1.236605e-05
Fortran kernel error: 9.067284e-06

The Python error aligns with the default weno order=5:

clawf = acoustics(use_petsc=False, kernel_language='Fortran', \
       solver_type='sharpclaw', weno_order=5)
q0 = clawf.frames[0].state.get_q_global()
qfinal = clawf.frames[claw.num_output_times].state.get_q_global()
print "Fortran (5) kernel error: %e" % (dx*np.linalg.norm(qfinal-q0,1))
Fortran (5) kernel error: 1.236605e-05

@ketch
Copy link
Member

ketch commented Apr 7, 2013

If you're raising this as an issue, there are a dozen other combinations to raise. This was never designed as a real API. The point of the apps/ directory is to give simple examples. If you wanted to check for all these things, you'd need to make all the scripts twice as long (definitely a bad idea) or add new code implementing a standardized API for the apps scripts (probably a bad thing, in my opinion, since it makes it seem more complicated for users to roll their own scripts).

@ketch
Copy link
Member

ketch commented Apr 7, 2013

To amend my last comment, after looking more closely: I agree that the solver should tell you something is wrong if you set solver.weno_order != 5 and solver.kernel_language='Python'. Or we should go in and call the PyWENO kernels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants