@@ -56,8 +56,12 @@ def interior(x_coords, y_space):
56
56
57
57
58
58
def interpolation_matrix (x_coords , y_space ):
59
- from tlm_adjoint .fenics .fenics_equations import greedy_coloring , \
60
- interpolation_matrix , point_owners
59
+ try :
60
+ from tlm_adjoint .fenics .interpolation import (
61
+ greedy_coloring , interpolation_matrix , point_owners )
62
+ except ImportError :
63
+ from tlm_adjoint .fenics .fenics_equations import (
64
+ greedy_coloring , interpolation_matrix , point_owners )
61
65
62
66
y_cells = point_owners (x_coords , y_space , tolerance = np .inf )
63
67
x_local = np .array (y_cells >= 0 , dtype = bool )
@@ -964,8 +968,12 @@ def B_M_0(*X):
964
968
M
965
969
"""
966
970
967
- from tlm_adjoint .fenics .backend_code_generator_interface import \
968
- matrix_multiply
971
+ try :
972
+ from tlm_adjoint .fenics .backend_interface import \
973
+ matrix_multiply
974
+ except ImportError :
975
+ from tlm_adjoint .fenics .backend_code_generator_interface import \
976
+ matrix_multiply
969
977
970
978
B_0_action = []
971
979
for i , x in enumerate (X ):
@@ -1268,7 +1276,10 @@ def comp_J_inv(self, verbose=False):
1268
1276
cache_jacobian = False , cache_rhs_assembly = False ).solve ()
1269
1277
1270
1278
if not hasattr (self , "_cached_J_mismatch_data" ):
1271
- from tlm_adjoint .fenics .fenics_equations import LocalMatrix
1279
+ try :
1280
+ from tlm_adjoint .fenics .interpolation import LocalMatrix
1281
+ except ImportError :
1282
+ from tlm_adjoint .fenics .fenics_equations import LocalMatrix
1272
1283
from scipy .sparse import spdiags
1273
1284
1274
1285
obs_local , P = interpolation_matrix (uv_obs_pts , interp_space )
0 commit comments