def testVerboseSimulation(self): pathIN = os.path.join(os.path.dirname(os.path.realpath(__file__)), "Generators.IN") pathOUT = os.path.join(os.path.dirname(os.path.realpath(__file__)), "Generators.verbose.OUT") data = OpenFLUID.openDataset(pathIN) OpenFLUID.setCurrentOutputDir(pathOUT) self.assertRaises(Exception, OpenFLUID.runSimulation(data, True))
def testProjectSimulation(self): path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "Generators.PRJ") pathOUT = os.path.join(os.path.dirname(os.path.realpath(__file__)), "Generators.PRJ", "OUT") data = OpenFLUID.openProject(path) OpenFLUID.setCurrentOutputDir(pathOUT) self.assertRaises(Exception, OpenFLUID.runSimulation(data))
def testSimulation(self): pathIN = os.path.join(os.path.dirname(os.path.realpath(__file__)), "Generators.IN") pathOUT = os.path.join(os.path.dirname(os.path.realpath(__file__)), "Generators.OUT") OpenFLUID.setCurrentOutputDir(pathOUT) data = OpenFLUID.openDataset(pathIN) # self.assertEqual(OpenFLUID.getSimulationOutputDir(data),pathOUT) self.assertRaises(Exception, OpenFLUID.runSimulation(data))
def testObserversPaths(self): print(OpenFLUID.getObserversPaths()) self.assertEqual(len(OpenFLUID.getExtraObserversPaths()), 0) OpenFLUID.addExtraObserversPaths("/path/obs/10") self.assertEqual(OpenFLUID.getExtraObserversPaths(), ["/path/obs/10"]) OpenFLUID.addExtraObserversPaths("/path/obs/20") self.assertEqual(len(OpenFLUID.getExtraObserversPaths()), 2) self.assertEqual(sorted(OpenFLUID.getExtraObserversPaths()), sorted(["/path/obs/10", "/path/obs/20"])) OpenFLUID.addExtraObserversPaths(["/path/obs/30", "/path/obs/40"]) self.assertEqual(len(OpenFLUID.getExtraObserversPaths()), 4) OpenFLUID.resetExtraObserversPaths() self.assertEqual(len(OpenFLUID.getExtraObserversPaths()), 0) self.assertEqual(OpenFLUID.getExtraObserversPaths(), []) OpenFLUID.addExtraObserversPaths(["/path/obs/50", "/path/obs/50"]) self.assertEqual(len(OpenFLUID.getExtraObserversPaths()), 1)
def testSimulatorsPaths(self): print(OpenFLUID.getSimulatorsPaths()) self.assertEqual(len(OpenFLUID.getExtraSimulatorsPaths()), 0) OpenFLUID.addExtraSimulatorsPaths("/path/sim/1") self.assertEqual(OpenFLUID.getExtraSimulatorsPaths(), ["/path/sim/1"]) OpenFLUID.addExtraSimulatorsPaths("/path/sim/2") self.assertEqual(len(OpenFLUID.getExtraSimulatorsPaths()), 2) self.assertEqual(sorted(OpenFLUID.getExtraSimulatorsPaths()), sorted(["/path/sim/1", "/path/sim/2"])) OpenFLUID.addExtraSimulatorsPaths(["/path/sim/3", "/path/sim/4"]) self.assertEqual(len(OpenFLUID.getExtraSimulatorsPaths()), 4) OpenFLUID.resetExtraSimulatorsPaths() self.assertEqual(len(OpenFLUID.getExtraSimulatorsPaths()), 0) self.assertEqual(OpenFLUID.getExtraSimulatorsPaths(), []) OpenFLUID.addExtraSimulatorsPaths(["/path/sim/5", "/path/sim/5"]) self.assertEqual(len(OpenFLUID.getExtraSimulatorsPaths()), 1)
def testBlob(self): b = OpenFLUID.newBlob() OpenFLUID.deleteBlob(b)
def testVersion(self): print(OpenFLUID.getVersion())
def testProject(self): path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "Generators.PRJ") data = OpenFLUID.openProject(path) OpenFLUID.printSimulationInfo(data)
def testDataset(self): path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "6fields_3reaches.IN") data = OpenFLUID.openDataset(path) OpenFLUID.printSimulationInfo(data)