-
Notifications
You must be signed in to change notification settings - Fork 0
Adding SPH velocity evaluation #106
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
base: devel
Are you sure you want to change the base?
Conversation
|
|
||
| if n_xyz is None: | ||
| n_xyz = lambda x, y, z: 0.0 * x | ||
| n_xyz = lambda x, y, z: 1.0 + 0.0 * x |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| n_xyz = lambda x, y, z: 1.0 + 0.0 * x | |
| n_xyz = lambda x, y, z: np.ones_like(x, dtype=float) |
|
|
||
| if p_xyz is None: | ||
| p_xyz = lambda x, y, z: 0.0 * x | ||
| p_xyz = lambda x, y, z: 1.0 + 0.0 * x |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| p_xyz = lambda x, y, z: 1.0 + 0.0 * x | |
| p_xyz = lambda x, y, z: np.ones_like(x, dtype=float) |
|
Hi @aminrai2000, could you please add the requested changes, push and then request review from me? There should not be any conflicts. |
Hi Stefan. |
src/struphy/pic/tests/test_sph.py
Outdated
| def u_eta(eta1, eta2, eta3): | ||
| u1 = 1 / Lx * xp.cos(2 * xp.pi * l1 / Lx + 2 * xp.pi * eta1) * xp.cos(2 * xp.pi * eta2 + 2 * xp.pi * l2 / Ly) | ||
| u2 = 1 / Ly * xp.cos(2 * xp.pi * l1 / Lx + 2 * xp.pi * eta1) * xp.cos(2 * xp.pi * eta2 + +2 * xp.pi * l2 / Ly) | ||
| u3 = 0.0 * z | ||
| return (u1, u2, u3) | ||
|
|
||
| # derivatives: | ||
| # derivative == 1 -> ∂/∂e1 | ||
| # derivative == 2 -> ∂/∂e2 | ||
| def du_dx(x, y, z): | ||
| dux = -2 * xp.pi / Lx * xp.sin(2 * xp.pi / Lx * x) * xp.cos(2 * xp.pi / Ly * y) | ||
| duy = -2 * xp.pi / Lx * xp.sin(2 * xp.pi / Lx * x) * xp.cos(2 * xp.pi / Ly * y) | ||
| duz = 0.0 * z | ||
| return (dux, duy, duz) | ||
|
|
||
| def du_dy(x, y, z): | ||
| dux = -2 * xp.pi / Ly * xp.cos(2 * xp.pi / Lx * x) * xp.sin(2 * xp.pi / Ly * y) | ||
| duy = -2 * xp.pi / Ly * xp.cos(2 * xp.pi / Lx * x) * xp.sin(2 * xp.pi / Ly * y) | ||
| duz = 0.0 * z | ||
| return (dux, duy, duz) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be deleted.
src/struphy/pic/tests/test_sph.py
Outdated
| v1_e, v2_e, v3_e = du_deta1(ee1, ee2, ee3) | ||
| v1, v2, v3 = v_log |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This must be removed, as it is already done above. If you overwrite here, the Allreduce will not be performed and the mpi tests will fail.
src/struphy/pic/tests/test_sph.py
Outdated
| v1_e, v2_e, v3_e = du_deta2(ee1, ee2, ee3) | ||
| v1, v2, v3 = v_log |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This must also be removed, as above
src/struphy/pic/tests/test_sph.py
Outdated
| assert err_ux < 0.8709 | ||
| assert err_uy < 0.8709 | ||
| else: | ||
| assert err_ux < 0.716 | ||
| assert err_uy < 0.716 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We must choose test parameters such that these error get at least below 0.4
Solves the following issue(s):
None
Core changes:
Model-specific changes:
None
Documentation changes:
None