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
[Feature] Replace python funcion with sympy expression #507
[Feature] Replace python funcion with sympy expression #507
Conversation
Thanks for your contribution! |
efaf5e4
to
be67fb4
Compare
ppsci/equation/pde/navier_stokes.py
Outdated
def __init__(self, nu: Union[float, Callable], rho: float, dim: int, time: bool): | ||
def __init__( | ||
self, | ||
nu: Union[float, Callable], |
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.
后面代码中 nu 允许类型为 str, 类型提示需要修改下。其他变量也检查下有没有类似情况
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.
已修改
ppsci/equation/pde/navier_stokes.py
Outdated
invars = (t,) + invars | ||
if dim == 3: | ||
invars += (z,) | ||
|
||
self.nu = nu | ||
self.rho = rho |
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.
这两行代码中用的的 nu, rho 在后续代码中有修改,看是否需要把这两行放到修改后面
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.
已修改
@@ -33,15 +35,15 @@ class Poisson(base.PDE): | |||
>>> pde = ppsci.equation.Poisson(2) | |||
""" | |||
|
|||
def __init__(self, dim: int): | |||
def __init__(self, dim: int, detach_keys: Optional[Tuple[str, ...]] = None): |
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.
更新docstring
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.
已修改
@@ -61,214 +62,114 @@ def __init__( | |||
rho: float = 1, | |||
dim: int = 3, | |||
time: bool = False, | |||
detach_keys: Optional[Tuple[str, ...]] = None, |
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.
更新docstring
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.
已修改
dim: int, | ||
q: float, | ||
D: float, | ||
detach_keys: Optional[Tuple[str, ...]] = None, |
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.
更新docstring, 检查类型提示
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.
已修改
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.
LGTM
PR types
Others
PR changes
Others
Describe
主要修改点:
Solver
和expression
其他:
normal_dot_vel
为normal_dot_vec
sp_parser
的相关无用代码