Skip to content
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

add unit test for biharmonic #394

Merged
merged 1 commit into from
Jun 23, 2023
Merged

Conversation

jjyaoao
Copy link
Contributor

@jjyaoao jjyaoao commented Jun 17, 2023

PR types

Others

PR changes

Others

Describe

add unit test for biharmonic

e4da662943735a310b5a8ec029f64bc

@paddle-bot
Copy link

paddle-bot bot commented Jun 17, 2023

Thanks for your contribution!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

单测应该写的不正确,biharmonic是四阶微分,但是单测的参考值构造只用了一次hessian,相当于只有二阶微分image

Comment on lines 50 to 57
# compute fourth order derivative
for var_i in (x, y):
for var_j in (x, y):
expected_result += hessian(hessian(u, var_i), var_j)
if dim == 3:
for var_i in (x, y, z):
for var_j in (x, y, z):
expected_result += hessian(hessian(u, var_i), var_j)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dim=3的时候,51-53行代码也会被执行,然后又执行了55-57行,这样显然是不对的,改成下面这样

    # compute expected result
    expected_result = -q / D
    vars = (x, y)
    if dim == 3:
        vars += (z, )
    for var_i in vars:
        for var_j in vars:
            expected_result += hessian(hessian(u, var_i), var_j)

Signed-off-by: jjyaoao <jjyaoao@126.com>
Copy link
Collaborator

@HydrogenSulfate HydrogenSulfate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@HydrogenSulfate HydrogenSulfate merged commit b2b8c57 into PaddlePaddle:develop Jun 23, 2023
huohuohuohuohuo123 pushed a commit to huohuohuohuohuo123/PaddleScience that referenced this pull request Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants