-
Notifications
You must be signed in to change notification settings - Fork 184
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
Merged
zhiminzhang0830
merged 55 commits into
PaddlePaddle:develop
from
HydrogenSulfate:cvt_pyfunc_to_sym
Sep 13, 2023
Merged
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
2d95737
add sympy2func
AndPuQing f8bb795
fix node
AndPuQing b31a785
fix var name
AndPuQing d9d30d1
fix implementation
AndPuQing 6877901
Merge branch 'develop' into feature-sympy
HydrogenSulfate 2ccc9f5
add sympy to func module
HydrogenSulfate bb9d71c
add type hint and clean code
HydrogenSulfate 8783ec9
update unitest for N-S equation with sympy-base 'nu'
HydrogenSulfate 6f376b6
delete redundant sympy2func.py
HydrogenSulfate cfa853f
remove sympy to function code from expression.py to sym_to_func.py
HydrogenSulfate 62e9855
update type hint in expression
HydrogenSulfate fee4553
update code
HydrogenSulfate 1b7642e
update code
HydrogenSulfate 1538f0d
update code
HydrogenSulfate 36e48e5
refine sym_to_func.py
HydrogenSulfate d32fd84
replace sympy PDE for biharmonic and laplace
HydrogenSulfate 4e61fa5
refine sym_to_func.py
HydrogenSulfate 4baf466
fix bug in _cvt_to_key
HydrogenSulfate ba2a5c2
refine sym_to_func and expression code
HydrogenSulfate f057eec
add euler_beam static code(WIP, can not running, to be debug)
HydrogenSulfate ffd6b27
wip code
HydrogenSulfate 0809194
Merge branch 'develop' into cvt_pyfunc_to_sym
HydrogenSulfate b0d1df1
temporary code(need to be refined)
HydrogenSulfate 2fa8a8b
Merge branch 'develop' into cvt_pyfunc_to_sym
HydrogenSulfate b2a4509
update solver code
HydrogenSulfate 13d6ff6
replace more pdes with sympy
HydrogenSulfate ffd3a93
simplify code in solver
HydrogenSulfate 256f31a
update code
HydrogenSulfate 3a870d9
rename 'normal_dot_vel' to 'normal_dot_vec'
HydrogenSulfate 08e92d3
fix bug
HydrogenSulfate c2373ca
update unitest
HydrogenSulfate 051dcd6
remove redundant unitest
HydrogenSulfate 2eacfea
Merge branch 'develop' into cvt_pyfunc_to_sym
HydrogenSulfate c7eea1b
remove unnecessary code
HydrogenSulfate 615fefb
remove unnecessary more code
HydrogenSulfate e096ea2
use DETACH_FUNC_NAME instead of 'detach'
HydrogenSulfate cb16107
add derivatives for sdf function
HydrogenSulfate 899a2d2
replace .diff.diff with .diff(, 2)
HydrogenSulfate 640c080
support exporting expression to .dot and .png file for visualizing an…
HydrogenSulfate 16aae52
remove compute_sdf_derivatives for next PR
HydrogenSulfate 9b46410
refine docstring of ppsci/data/dataset/array_dataset.py
HydrogenSulfate f179ec1
remove sdf_derivatives code in geometry for next PR
HydrogenSulfate 2e37bca
remove print code in solver
HydrogenSulfate 6ecb31b
rename sympy_to_function to lambdify and add it in ppsci.*
HydrogenSulfate 0a88a08
rename for test files
HydrogenSulfate 18a1638
rename sym_to_func.py to symbolic.py
HydrogenSulfate 8ccf858
update linear_init_ and conv_init_ to kaiming style
HydrogenSulfate 978cdfc
Merge branch 'develop' into cvt_pyfunc_to_sym
HydrogenSulfate a319e99
refine probability document
HydrogenSulfate be67fb4
change list to tuple
HydrogenSulfate eecc5e9
update docstrings of equations
HydrogenSulfate cb7f777
Merge branch 'develop' into cvt_pyfunc_to_sym
HydrogenSulfate 59bc990
Merge branch 'develop' into cvt_pyfunc_to_sym
HydrogenSulfate c0228f0
larger atol to 1e-7 for test_linear_elasticity
HydrogenSulfate 408e378
fix seed to 42 for test_linear_elasticity
HydrogenSulfate File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
update docstrings of equations
- Loading branch information
commit eecc5e9d3f1a984c8ca939fae14f4ae2cb4ea319
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
|
||
from typing import Optional | ||
from typing import Tuple | ||
from typing import Union | ||
|
||
import sympy as sp | ||
|
||
|
@@ -38,13 +39,15 @@ class LinearElasticity(base.PDE): | |
$$ | ||
|
||
Args: | ||
E (Optional[float]): The Young's modulus. Defaults to None. | ||
nu (Optional[float]): The Poisson's ratio. Defaults to None. | ||
lambda_ (Optional[float]): Lamé's first parameter. Defaults to None. | ||
mu (Optional[float]): Lamé's second parameter (shear modulus). Defaults to None. | ||
rho (float, optional): Mass density. Defaults to 1. | ||
E (Optional[Union[float, str]]): The Young's modulus. Defaults to None. | ||
nu (Optional[Union[float, str]]): The Poisson's ratio. Defaults to None. | ||
lambda_ (Optional[Union[float, str]]): Lamé's first parameter. Defaults to None. | ||
mu (Optional[Union[float, str]]): Lamé's second parameter (shear modulus). Defaults to None. | ||
rho (Union[float, str], optional): Mass density. Defaults to 1. | ||
dim (int, optional): Dimension of the linear elasticity (2 or 3). Defaults to 3. | ||
time (bool, optional): Whether contains time data. Defaults to False. | ||
detach_keys(Optional[Tuple[str, ...]]): Keys used for detach during computing. | ||
Defaults to None. | ||
|
||
Examples: | ||
>>> import ppsci | ||
|
@@ -55,11 +58,11 @@ class LinearElasticity(base.PDE): | |
|
||
def __init__( | ||
self, | ||
E: Optional[float] = None, | ||
nu: Optional[float] = None, | ||
lambda_: Optional[float] = None, | ||
mu: Optional[float] = None, | ||
rho: float = 1, | ||
E: Optional[Union[float, str]] = None, | ||
nu: Optional[Union[float, str]] = None, | ||
lambda_: Optional[Union[float, str]] = None, | ||
mu: Optional[Union[float, str]] = None, | ||
rho: Union[float, str] = 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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. 已修改 |
||
|
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
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
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
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.
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.
已修改