diff --git a/anisotropy/shaping/bodyCentered.py b/anisotropy/shaping/bodyCentered.py index 3dea258..5a32a21 100644 --- a/anisotropy/shaping/bodyCentered.py +++ b/anisotropy/shaping/bodyCentered.py @@ -146,7 +146,7 @@ class BodyCentered(Periodic): fNorm = self.normal(face) fAngle = self.angle(vecFlow, fNorm) - if fAngle == 0: + if fAngle == 0 or fAngle == numpy.pi: if (face.center.pos() == inletface.center.pos()).prod(): face.name = "inlet" diff --git a/anisotropy/shaping/faceCentered.py b/anisotropy/shaping/faceCentered.py index 8aef95b..e7b7de6 100644 --- a/anisotropy/shaping/faceCentered.py +++ b/anisotropy/shaping/faceCentered.py @@ -153,7 +153,7 @@ class FaceCentered(Periodic): fNorm = self.normal(face) fAngle = self.angle(vecFlow, fNorm) - if fAngle == 0: + if fAngle == 0 or fAngle == numpy.pi: if (face.center.pos() == inletface.center.pos()).prod(): face.name = "inlet" diff --git a/anisotropy/shaping/simple.py b/anisotropy/shaping/simple.py index 8818167..7acc3e2 100644 --- a/anisotropy/shaping/simple.py +++ b/anisotropy/shaping/simple.py @@ -140,11 +140,11 @@ class Simple(Periodic): for face in self.cell.faces: fNorm = self.normal(face) fAngle = self.angle(vecFlow, fNorm) - - if fAngle == 0: + + if fAngle == 0 or fAngle == numpy.pi: if (face.center.pos() == inletface.center.pos()).prod(): face.name = "inlet" - + else: face.name = "outlet" diff --git a/tests/test_core.py b/tests/test_core.py index cb75a51..f3a5fd3 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -21,7 +21,8 @@ class TestCore(unittest.TestCase): self.core = core - self.outputPath = os.path.join(os.path.abspath("."), "tests/test_core_output") + self.currentPath = os.path.abspath(".") + self.outputPath = os.path.join(self.currentPath, "tests/test_core_output") os.makedirs(self.outputPath, exist_ok = True) def test_config(self): @@ -54,12 +55,12 @@ class TestCore(unittest.TestCase): self.assertTrue(path.isfile(path.join(runner.casepath(), "mesh.mesh"))) runner.computeFlow() - #self.assertTrue(path.isfile(path.join(runner.casepath(), "mesh.mesh"))) + self.assertTrue(path.isfile(path.join(runner.casepath(), "mesh.mesh"))) os.chdir(pathOld) def tearDown(self): - pass + os.chdir(self.currentPath) if __name__ == "__main__": unittest.main()