I am working on an elastodynamic simulation system (FEniCS-x, in Docker Jupyter-Lab, DOLFIN-x Real) where individual objects are Python objects, with the functions and weak form of each object contained within the object. Right now I have one elastic body contacting two rigid bodies. When I run the simulation outside of a OOP formulation, it runs fine and converges well (with tuning of the time step), but when I run the same simulation (same weak form, same contact model, same parameters) in the OOP formulation, the simulation fails to converge once where are any body forces or non-zero contact forces (RuntimeError: Newton solver did not converge because maximum number of iterations reached).
Are there particular considerations that need to be taken if you are solving FEniCS-x problems within an OOP formulation? Are there issues with the OOP formulation because of the FEniCS-x C++ backend?
I can post an example code, but because of the elastodynamics and contact mechanics, it would be a pretty lengthy example.
Any help would be greatly appreciated!