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

pytest missing laplace as mesh moving #72

Closed
keiyamamo opened this issue Jun 21, 2023 · 0 comments · Fixed by #73
Closed

pytest missing laplace as mesh moving #72

keiyamamo opened this issue Jun 21, 2023 · 0 comments · Fixed by #73

Comments

@keiyamamo
Copy link
Collaborator

I found out that the pytest actually does not test laplace.py because the parameter is not passed inside test_laplace function. The default parameter for extrapolation is set to biharmonic and I’m pretty sure that is the one used for test_laplace.

@pytest.mark.parametrize("extrapolation_sub_type", ["volume", "volume_change",
"constant", "small_constant"])
def test_laplace(extrapolation_sub_type):
cmd = ("turtleFSI --problem TF_fsi -dt 0.01 -T 0.05 --verbose True --theta 0.51" +
" --folder tmp --sub-folder 4")
d = system(cmd)
drag = np.loadtxt("tmp/4/Drag.txt")[-1]
lift = np.loadtxt("tmp/4/Lift.txt")[-1]
distance_x = np.loadtxt("tmp/4/dis_x.txt")[-1]
distance_y = np.loadtxt("tmp/4/dis_y.txt")[-1]
distance_x_reference = -6.896013956339182e-06
distance_y_reference = 1.876355330341896e-09
drag_reference = 4.407481239804155
lift_reference = -0.005404703556977697
assert compare(distance_x, distance_x_reference)
assert compare(distance_y, distance_y_reference)
assert compare(drag, drag_reference)
assert compare(lift, lift_reference)

Here is coverage report that shows we are not hitting laplace.py

--------- coverage: platform darwin, python 3.10.10-final-0 ----------
Name                                    Stmts   Miss  Cover
-----------------------------------------------------------
turtleFSI/__init__.py                       1      0   100%
turtleFSI/modules/__init__.py               1      0   100%
turtleFSI/modules/biharmonic.py            14      0   100%
turtleFSI/modules/common.py               111     69    38%
turtleFSI/modules/domain.py                43     22    49%
turtleFSI/modules/elastic.py               12      0   100%
turtleFSI/modules/fluid.py                 20      0   100%
turtleFSI/modules/laplace.py               16     16     0%
turtleFSI/modules/newtonsolver.py          52      2    96%
turtleFSI/modules/no_extrapolation.py       2      0   100%
turtleFSI/modules/no_fluid.py               8      0   100%
turtleFSI/modules/no_solid.py               8      0   100%
turtleFSI/modules/solid.py                 36     13    64%
turtleFSI/monolithic.py                   128     19    85%
turtleFSI/run_turtle.py                     8      1    88%
turtleFSI/utils/Probe.py                   70     49    30%
turtleFSI/utils/Womersley.py              138    119    14%
turtleFSI/utils/__init__.py                16     12    25%
turtleFSI/utils/argpar.py                 142     58    59%
-----------------------------------------------------------
TOTAL                                     826    380    54%

I will fix it and will create a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant