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

1d_stencil codes all have wrong factor #1656

Closed
stevenrbrandt opened this issue Jul 8, 2015 · 1 comment
Closed

1d_stencil codes all have wrong factor #1656

stevenrbrandt opened this issue Jul 8, 2015 · 1 comment

Comments

@stevenrbrandt
Copy link
Member

All the 1d_stencil codes have a line that looks like this:
return middle + (k * dt/dx * dx) * (left - 2*middle + right);
The code should look like this:
return middle + (k * dt/(dx * dx)) * (left - 2*middle + right);

Because the example codes all have dx set to 1, fixing the
expressions won't make any difference for output. However,
if dx is set to any other value the results will be wrong.

@Titzi90
Copy link
Contributor

Titzi90 commented Jul 8, 2015

You are absolutely right

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

No branches or pull requests

3 participants