def basis_transform_tensorDD_from_Cartesian_to_rfmbasis(Jac_dUCart_dDrfmUD, Cart_src_tensorDD):
    rfm_dst_tensorDD = ixp.zerorank2()
    for i in range(3):
        for j in range(3):
            for l in range(3):
                for m in range(3):
                    rfm_dst_tensorDD[i][j] += ((Jac_dUCart_dDrfmUD[l][i] * Jac_dUCart_dDrfmUD[m][j]) * Cart_src_tensorDD[l][m])
    return rfm_dst_tensorDD
def basis_transform_tensorDD_from_Cartesian_to_rfmbasis(Jac_dUCart_dDrfmUD, Cart_src_tensorDD):
    rfm_dst_tensorDD = ixp.zerorank2()
    for i in range(3):
        for j in range(3):
            for l in range(3):
                for m in range(3):
                    rfm_dst_tensorDD[i][j] += ((Jac_dUCart_dDrfmUD[l][i] * Jac_dUCart_dDrfmUD[m][j]) * Cart_src_tensorDD[l][m])
    return rfm_dst_tensorDD