Solving coefficient Poisson equation for binary neutron stars on irregular domain.
The simplest way to run the code is to run it directly in a python environment:
$ python3The code requires libraries including numpy, matplotlib, scipy
To try a demo code, run the main.py file:
python3 main.pyIn the demo code, first create a inputconfig class that initializes all inputs:
test_inputconfig = inputconfig()Call the source term method in the source_term_method.py file
stm.stm_coef_Neumann(test_inputconfig)Use plot1d_error to make a plot of the relative error along the x-axis
or use plot2d_error to make a comparison plot of the result and the theory
The configuration is initialized in the file main.py in the class inputconfig
The code requires
N_grid: the size of the gridmaxIt_: the maximum iteration allowed for the source term methodit_multiple_: the maximum iteration multiple (multiply byN_grid ^ 2) allowed for the jacobi iteration method.eta_: the minimum convergence rate for terminationrlx_: the relaxation constanttheory_: the theoretical value for Phiboundary_: the boundary condition for Phi_nS_zeta_: the source (right hand side) for the coefficient Poisson equationrho_: the density that defines the level setnum_grid_dr: the number of grid points for the separationzeta_: the coefficient for the Poisson equation
- The file
main.pycontains an inputconfig class for configuring the input. - The file
source_term_method.pycontains the source term method that solves the coefficient Poisson equation. - The file
mesh_helper_functions.pycontains helper function of vector calculus and level set operations forsource_term_method.py. - The file
mesh_helper_functions_3d.pycontains helper function of vector calculus and level set operations in 3d. It is currently only helpful for plotting purposes.