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

simulate_wave_propagation solver error when using accuracy that's not the default accuracy of 8 #224

Open
whajjali opened this issue Dec 14, 2023 · 0 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@whajjali
Copy link

Describe the bug
When testing the time domain simulate_wave_propagation solver for the case of FiniteDifference parameters and/or initial conditions, it looks like the solver automatically converts them to accuracy=8 no matter what accuracy is specified when defining the FiniteDifference objects. In particular, the smoothing step done for the initial condition converts it to accuracy=8 if a different accuracy was used when constructing the initial condition. If smooth_initial=False is chosen, then the following error comes up after the first time step:

"TypeError: Scanned function carry input and carry output must have the same pytree structure, but they differ: the input carry component fields[0] is a <class 'jaxdf.discretization.FiniteDifferences'> with pytree metadata ('params', 'domain'), ('accuracy',), (2,) but the corresponding component of the carry output is a <class 'jaxdf.discretization.FiniteDifferences'> with pytree metadata ('params', 'domain'), ('accuracy',), (8,), so the pytree node metadata does not match"

which means that the mass_conservation_rhs and momentum_conservation_rhs return FiniteDifference objects of accuracy=8 rather than the specified accuracy. Upon further investigation, I noticed that the replace_params method always defaults to the default accuracy of 8.

To Reproduce
Check the attached pdf file.
homogeneous_medium_FD_test.pdf

@whajjali whajjali added bug Something isn't working help wanted Extra attention is needed labels Dec 14, 2023
@astanziola astanziola self-assigned this Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants