def test_GenerateSectionCurves_Numpy_Functs(): """Tests the GenerateSectionCurves function given a set of Lifting surface functional parameters f(eps) which expects a numpy array """ def myNumpyFunct(eps): # This will be used for twist, sweep. dihedral, and chord. returns # an array, as eps is expected to be an array return np.ones_like(eps) * 5 wing = LiftingSurface(construct_geometry=False) wing.ChordFunct = myNumpyFunct wing.SweepFunct = myNumpyFunct wing.DihedralFunct = myNumpyFunct wing.TwistFunct = myNumpyFunct wing.AirfoilFunct = myAirfoilFunctionAirliner # Builtin example wing.GenerateSectionCurves() assert(len(wing._Sections) > 0)
def test_GenerateSectionCurves_NonNumpy_ChordFunct(): """Tests the GenerateSectionCurves function given a set of Lifting surface functional parameters f(eps) which expects a single input (and output) """ def mySingleInputFunct(eps): # This will be used for twist, sweep. dihedral, and chord. Returns a # single value, as eps is expected to be a single value return 5 wing = LiftingSurface(construct_geometry=False) wing.ChordFunct = mySingleInputFunct wing.SweepFunct = mySingleInputFunct wing.DihedralFunct = mySingleInputFunct wing.TwistFunct = mySingleInputFunct wing.AirfoilFunct = myAirfoilFunctionAirliner # Builtin example wing.GenerateSectionCurves() assert(len(wing._Sections) > 0)
def test_GenerateSectionCurves_Numpy_Functs(): """Tests the GenerateSectionCurves function given a set of Lifting surface functional parameters f(eps) which expects a numpy array """ def myNumpyFunct(eps): # This will be used for twist, sweep. dihedral, and chord. returns # an array, as eps is expected to be an array return np.ones_like(eps) * 5 wing = LiftingSurface(construct_geometry=False) wing.ChordFunct = myNumpyFunct wing.SweepFunct = myNumpyFunct wing.DihedralFunct = myNumpyFunct wing.TwistFunct = myNumpyFunct wing.AirfoilFunct = myAirfoilFunctionAirliner # Builtin example wing.GenerateSectionCurves() assert (len(wing._Sections) > 0)
def test_GenerateSectionCurves_NonNumpy_ChordFunct(): """Tests the GenerateSectionCurves function given a set of Lifting surface functional parameters f(eps) which expects a single input (and output) """ def mySingleInputFunct(eps): # This will be used for twist, sweep. dihedral, and chord. Returns a # single value, as eps is expected to be a single value return 5 wing = LiftingSurface(construct_geometry=False) wing.ChordFunct = mySingleInputFunct wing.SweepFunct = mySingleInputFunct wing.DihedralFunct = mySingleInputFunct wing.TwistFunct = mySingleInputFunct wing.AirfoilFunct = myAirfoilFunctionAirliner # Builtin example wing.GenerateSectionCurves() assert (len(wing._Sections) > 0)