-
Notifications
You must be signed in to change notification settings - Fork 4
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
Solver for Poisson's equation in (radial,polar) coordinates. #245
Open
mrhardman
wants to merge
23
commits into
master
Choose a base branch
from
spatial_poissons_equation
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ian in cylindrical polar coordinates is required for a particular dimension. Make vperp and r the two dimensions for which this is true. Note that this does not generalise well to other situations with more complicated Jacobian factors.
…atment of periodic functions.
…or non-trivial functions of polar angle (with phi = 0 boundary conditions only).
…ndrical coordinates (radial,polar), as opposed to (radial,vertical) coordinates used for the velocity space solvers in the Fokker-Planck operator.
… to enable them to be reused for a different set of coordinates.
…ndre tensor product elements (not using Fourier transform).
…of periodic function -- make sure data for lower row assembly comes from correct location.
…matrix using ic_global and icp_global indices only (no icsc index). This assembly is slower for larger resolution due to memory usage, but can be done correctly with existing indexing functions. Update automatic tests to test the 2D Poisson solve as well as the 1D+Fourier decomposition version.
…ipts/PoissonSolve.jl to workflow.
… These 1D ODE solvers are useful to show the basics of how the more complex 2D PDE solvers are constructed, and to show how different types of boundary conditions are imposed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR gives the option of solving
for$\phi = \phi(r,\theta)$ using two different methods.
First, Fourier transforms for$\theta$ and Gauss-Legendre finite-element methods in 1D for the resulting system of independent ODEs. A Fourier spectral object (separate from Chebyshev) is added. Dirichlet (zero) boundary conditions are imposed on $\phi$ at the radial boundary. In the test, the radial domain runs from $(0,L]$ .
Second, a 2D tensor-product Gauss-Legendre finite-element method, using the functions originally designed for the Fokker-Planck collision operator. Some base level functions have to be moved to effect this change. The sparse-matrix version of the assembly where the periodic boundary condition is imposed is currently broken, so for this PR we resort to the dense-matrix version of the operator creation (for now).
These features (and their extensions) may be useful if more complicated field solvers are eventually required in moment_kinetics, for example, for solving for$\phi$ from vorticity on closed field lines, or solving for the electromagnetic fields.
An automatic test is added which runs in serial (even if multiple cores are passed).