-
Notifications
You must be signed in to change notification settings - Fork 5
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 wave equation solver.[WIP] #16
Conversation
…ime to N_LGL x N_Elements x time
…speed. -testwaveEqn has issues accessing modules.
…ecreases with larger array size).
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 review is mainly concerned with the code guidelines issues. I have not reviewed few changes related to writing mathematical equations in doc-strings because I had some confusion about it, which, I have discussed in issue #19. I will review them once this issue is resolved.
I did not review any of the test functions because on running pytest
, the tests are failing.
README.md
Outdated
@@ -27,4 +27,4 @@ python3 main.py | |||
* **Mani Chandra** - [GitHub Profile](https://github.com/mchandra) | |||
|
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 updated the README a few days ago. You should have the updated README here. I am attaching the
link where you can find it.
hdf5_ImplementationForStoring_u
code/app/global_variables.py
Outdated
@@ -1,201 +1,72 @@ | |||
import numpy as np |
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.
According to the Quazartech style guidelines, the imports should be grouped in the following order
Imports should be grouped in the following order:
- standard library imports
- related third party imports
- local application/library specific imports
I would prefer if you give spacing between different groups.
I am adding this review only here but you should check for this issue in every python file.
code/app/global_variables.py
Outdated
dLp_xi = af.blas.matmul(differentiation_coeffs, nodes_power_tile) | ||
|
||
return dLp_xi | ||
|
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.
why are you still using global variables?
You mentioned in Issue #17 that this code is not using global variables. What's going on?
code/app/global_variables.py
Outdated
stored in stored in variable `time`. | ||
|
||
|
||
Calculates and returns the LGL points for a given N, These are roots of |
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.
You can write,
Calculates : math: `N` Legendre-Gauss-Lobatto (LGL) points.
LGL points are the roots of the polynomial
:math: `(1 - \\xi ** 2) P_{n - 1}'(\\xi) = 0`
Where :math: `P_{n}(\\xi)` are the Legendre polynomials.
This function finds the roots of the above polynomial
code/app/global_variables.py
Outdated
Calculates and returns the LGL points for a given N, These are roots of | ||
the formula. | ||
:math: `(1 - xi ** 2) P_{n - 1}'(xi) = 0` | ||
Legendre polynomials satisfy the recurrence relation |
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.
What is the point adding this recurrence relation?
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.
The variable legendre_N_minus_1
uses this recurrence relation.
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.
It would have made sense to give the recurrence relation if you had explained the algorithm. But since you have not explained the algorithm, the reader won't know why you have written the recurrence relation.
code/app/wave_equation.py
Outdated
|
||
Parameters | ||
---------- | ||
u_t_n : arrayfire.Array [N_LGL N_Elements 1 1] |
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.
Why is the variable named u_t_n
?
If I understand correctly, u_t_n
is basically the wave amplitude at n^{th}
time step.
Then why don't we name it just u_n
.
code/app/wave_equation.py
Outdated
|
||
def surface_term(u_t_n): | ||
''' | ||
A function which is used to calculate the surface term, |
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.
Don't start with A function ...
, we know that it is a function. Remove unneeded words.
@@ -1,72 +1,41 @@ | |||
import numpy as np |
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.
Code guidelines violation for imports.
code/unit_test/test_waveEqn.py
Outdated
from utils import utils | ||
import math | ||
af.set_backend('opencl') |
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.
I think that this function should be called right after importing arrayfire.
code/app/wave_equation.py
Outdated
--------- | ||
Link to PDF describing the algorithm to obtain the surface term. | ||
|
||
https://cocalc.com/projects/1b7f404c-87ba-40d0-816c-2eba17466aa8/files |
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.
See issue #18 and shorten the URL. Do this at all the places where such long URLs are written.
@Balavarun5 @mchandra @Balavarun5 have you already removed the usage of global variables from the code? |
…e refactored to include `Integrate()` function.
…umentation and comments need to be added.
Code to simulate the time evolution of the 1D wave equation using discontinuous Galerkin and Euler forward methods. This code is not completely functional (Ref- Issue #6 for further details), as the amplitude increases with time and eventually blows up.