22import numpy as np
33import pytest
44import ufl
5- import utils
65
76from pulse import invariants , kinematics
87
1110 "cls, expected" ,
1211 (
1312 (kinematics .DeformationGradient , 4 * 3 ),
14- (utils . IsochoricDeformationGradient , pow (8 , - 2 / 3 ) * 4 * 3 ),
13+ (kinematics . IsochoricDeformationGradient_from_u , pow (8 , - 2 / 3 ) * 4 * 3 ),
1514 ),
1615)
1716def test_I1 (cls , expected , u ) -> None :
@@ -30,7 +29,7 @@ def test_I1(cls, expected, u) -> None:
3029 (
3130 (kinematics .DeformationGradient , 0.5 * ((4 * 3 ) ** 2 - (4 ** 2 ) * 3 )),
3231 (
33- utils . IsochoricDeformationGradient ,
32+ kinematics . IsochoricDeformationGradient_from_u ,
3433 0.5 * (((pow (8 , - 2 / 3 ) * 4 * 3 ) ** 2 ) - ((pow (8 , - 2 / 3 ) * 4 ) ** 2 ) * 3 ),
3534 ),
3635 ),
@@ -49,7 +48,7 @@ def test_I2(cls, expected, u) -> None:
4948 "cls, expected" ,
5049 (
5150 (kinematics .DeformationGradient , 4 ** 3 ),
52- (utils . IsochoricDeformationGradient , (pow (8 , - 2 / 3 ) * 4 ) ** 3 ),
51+ (kinematics . IsochoricDeformationGradient_from_u , (pow (8 , - 2 / 3 ) * 4 ) ** 3 ),
5352 ),
5453)
5554def test_I3 (cls , expected , u ) -> None :
@@ -67,7 +66,7 @@ def test_I3(cls, expected, u) -> None:
6766 "cls, expected" ,
6867 (
6968 (kinematics .DeformationGradient , 4 ),
70- (utils . IsochoricDeformationGradient , pow (8 , - 2 / 3 ) * 4 ),
69+ (kinematics . IsochoricDeformationGradient_from_u , pow (8 , - 2 / 3 ) * 4 ),
7170 ),
7271)
7372def test_I4 (cls , expected , u , mesh ) -> None :
@@ -86,7 +85,7 @@ def test_I4(cls, expected, u, mesh) -> None:
8685 "cls, expected" ,
8786 (
8887 (kinematics .DeformationGradient , 4 ** 2 ),
89- (utils . IsochoricDeformationGradient , (pow (8 , - 2 / 3 ) * 4 ) ** 2 ),
88+ (kinematics . IsochoricDeformationGradient_from_u , (pow (8 , - 2 / 3 ) * 4 ) ** 2 ),
9089 ),
9190)
9291def test_I5 (cls , expected , u , mesh ) -> None :
@@ -103,7 +102,7 @@ def test_I5(cls, expected, u, mesh) -> None:
103102
104103@pytest .mark .parametrize (
105104 "cls, expected" ,
106- ((kinematics .DeformationGradient , 0 ), (utils . IsochoricDeformationGradient , 0 )),
105+ ((kinematics .DeformationGradient , 0 ), (kinematics . IsochoricDeformationGradient_from_u , 0 )),
107106)
108107def test_I8 (cls , expected , u , mesh ) -> None :
109108 u .interpolate (lambda x : x )
0 commit comments