"""Tests for the `foil` module."""
from __future__ import division, print_function, absolute_import
from foampy.foil import *
[docs]def test_foildata_mirror():
fd = FoilData()
fd.cl = np.linspace(1, 20, 10)
fd.alpha = np.linspace(-5, 10, 10)
fd.cd = np.linspace(0.001, 0.01, 10)
fd.cm = np.linspace(0.5, 50, 10)
fd.mirror()
print(fd.alpha)
assert fd.alpha[0] == -10.0
assert fd.cl[0] == -fd.cl[-1]
assert fd.cd[0] == fd.cd[-1]
assert fd.cm[0] == -fd.cm[-1]
[docs]def test_mirror_foildata():
reformat_foildata("test/NACA_0021.dat", "test/NACA_0021_4.txt",
startline=57)
mirror_foildata("test/NACA_0021_4.txt", "test/NACA_0021_4_m.txt")