Form compiles differently inside vs outside time loop [3D elasticity]

Thanks very much @dokken. I have made changes per your suggestions and getting consistent results. I am marking this form compilation as solved.

On a different note, as I am generating results, the iterative methods (GMRES) aren’t proving helpful. Instead, using one of the direct solvers (LU), the results seem to converge expectedly, and solution values are also resonable.

Should I have to fine tune my computations to move away from direct solvers, what is an ideal approach in your view?

So far, my reference has been what’s explained in this answer

I am using the following parameter set for SNES solver.

    snes_solver_parameters = {"nonlinear_solver": "snes",              
                              "snes_solver": {"linear_solver": 'gmres', #"lu",
                                              "preconditioner": "pcmg", 
                                               "line_search": "bt",
                                               "maximum_iterations": 50,
                                               "absolute_tolerance": 1E-3,
                                               "relative_tolerance": 1E-3,
                                               "report": True,
                                               #"method":'vinewtonrsls',
                                               "error_on_nonconvergence": False}}

(tolerances are kept low for the tine being to get a approximate sense of solution)

Thanks a lot.

Deepak