Nodal Vector Poisson solver with EB - #548
Conversation
Signed-off-by: S. Eric Clark <25495882+clarkse@users.noreply.github.com>
Signed-off-by: S. Eric Clark <25495882+clarkse@users.noreply.github.com>
Signed-off-by: S. Eric Clark <245461744+clarkse-he@users.noreply.github.com>
Signed-off-by: S. Eric Clark <245461744+clarkse-he@users.noreply.github.com>
…nitizlize EB. Signed-off-by: S. Eric Clark <245461744+clarkse-he@users.noreply.github.com>
Signed-off-by: S. Eric Clark <245461744+clarkse-he@users.noreply.github.com>
|
@prkkumar-he please excuse the slowness, lots of proposals in the last 2 months... I tried to help here and push directly to the branch, but it seems I lack permissions. Will continue the branch in #577 for now :) |
| #!/usr/bin/env python3 | ||
| """Test VectorPoissonSolverNodal in 2D RZ — A_theta convergence study. | ||
|
|
||
| Manufactured solution: A_theta = r * sin(pi*r) * sin(pi*z) on [0,1]^2. | ||
|
|
There was a problem hiding this comment.
Would be nice if this was integrated in our pytest suite. Please add a def test_... entry point function.
| #!/usr/bin/env python3 | ||
|
|
||
| """ | ||
| Self-convergence test: VectorPoissonSolverNodal with EB in 2D RZ. | ||
| ================================================================= |
There was a problem hiding this comment.
Would be nice if this was integrated in our pytest suite. Please add a def test_... entry point function.
| #ifndef VECTOR_POISSON_SOLVER_NODAL_H | ||
| #define VECTOR_POISSON_SOLVER_NODAL_H |
There was a problem hiding this comment.
Would probably prefix with PYAMREX_ to be sure it is long-term stable.
| #ifndef VECTOR_POISSON_SOLVER_3D_H | ||
| #define VECTOR_POISSON_SOLVER_3D_H |
There was a problem hiding this comment.
Would probably prefix with PYAMREX_ to be sure it is long-term stable.
| #ifndef PY_VECTOR_POISSON_H | ||
| #define PY_VECTOR_POISSON_H |
There was a problem hiding this comment.
Would probably prefix with PYAMREX_ to be sure it is long-term stable.
| foreach(_dim 1 2 3) | ||
| set(_target pyAMReX_${_dim}d) | ||
| if(TARGET ${_target}) | ||
| target_sources(${_target} | ||
| PRIVATE | ||
| ${CMAKE_CURRENT_SOURCE_DIR}/VectorPoissonSolver.cpp | ||
| ${CMAKE_CURRENT_SOURCE_DIR}/VectorPoissonSolverNodal.cpp |
There was a problem hiding this comment.
The pattern we use in all other files is
foreach(D IN LISTS AMReX_SPACEDIM)and no need to prefix with CMAKE_CURRENT_SOURCE_DIR
| amrex::Real inv_dr; | ||
| amrex::Real inv_dz; | ||
|
|
||
| AMREX_GPU_DEVICE |
There was a problem hiding this comment.
This probably needs host-device annotation
…CEDIM), host-device functor annotation
No worries! Thanks for reviewing :) will address your comments shortly |
This PR adds vector Poisson solver in pyamrex. Works with and without EB in 1D, 2D, 3D cartesian as well RZ geometries.
Cell-centered solver uses MLABecLaplacian
Nodal uses MLEBNodeFDLaplacian
Our primary use case is with nodal solver with EB. If it is useful for others, let's consider merging. @atmyers @WeiqunZhang
Tested with manufactured solutions, first without EB: Perfect 2nd order convergence.
Test script: tests/test_vector_poisson_solver_rz.py
Tested with EB: Order of convergence goes below 2 as expected.

Test script: tests/test_vector_poisson_rz_EB.py