Commit 429c8b3c authored by Olga Stamati's avatar Olga Stamati
Browse files

resolves #172 test for decomposePhiField

parent 5fe426a2
Pipeline #50440 passed with stages
in 23 minutes and 56 seconds
...@@ -895,5 +895,20 @@ class testAll(unittest.TestCase): ...@@ -895,5 +895,20 @@ class testAll(unittest.TestCase):
res = spam.deformation.deformationFunction.decomposeF(F) res = spam.deformation.deformationFunction.decomposeF(F)
self.assertTrue(numpy.isnan(res['r'][0])) self.assertTrue(numpy.isnan(res['r'][0]))
def test_decomposePhiField(self):
PhiField = numpy.array([numpy.eye(4) for point in range(3)])
decomposedPhiField = spam.deformation.decomposePhiField(PhiField, ["vol", "dev", "volss", "devss", "t", "r", "z", "U", "e"])
for point in range(PhiField.shape[0]):
self.assertTrue(numpy.allclose(decomposedPhiField["t"][point], numpy.zeros(3)))
self.assertTrue(numpy.allclose(decomposedPhiField["r"][point], numpy.zeros(3)))
self.assertTrue(numpy.allclose(decomposedPhiField["U"][point], numpy.eye(3)))
self.assertTrue(numpy.allclose(decomposedPhiField["vol"][point], 0.0))
self.assertTrue(numpy.allclose(decomposedPhiField["dev"][point], 0.0))
self.assertTrue(numpy.allclose(decomposedPhiField["e"][point], numpy.zeros((3,3))))
self.assertTrue(numpy.allclose(decomposedPhiField["volss"][point], 0.0))
self.assertTrue(numpy.allclose(decomposedPhiField["devss"][point], 0.0))
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment