# PETSc SNES for user defined state

How to use PETSc SNES (scalable nonlinear equation solver), when the solution is not a vector but a user defined state?

I am implementing a non-linear mechanics problem (geometrically exact shell 5-paramter model), the update

$$X^{(k+1)} = X^{(k)} + \Delta_X$$

is not additive and requires the use of exponential maps.

More specifically, the state I mentioned above stores $X$ : $$X = \left \{ \Phi , \Lambda \right \}$$ $\Phi$ (vector of size 3) is mid-surface coordinates and have direct updates i.e $$\Phi _{n+1} = \Phi_{n} + \Delta \Phi$$ While $\Lambda$, the rotation matrix (correpondiong to director at mid surface), is updated through exponential map (the update increment is a vector of size 2, which is obtained after exploiting the one to one connection between tangent space of SO3 and S2 and fixing a reference vector). The residual at each point of mid surface(node) is a vector of size 5 and consists of $\Lambda$ , $\Phi$ and their derivatives.

I am using Newton-Raphson and many times the solution couldn't converge using a complete step size. Consequently, I thought of resorting to PETSc SNES (line search).

At any state, I know the residual vector and stiffness matrix. I could not figure how to make sense of solution vector that I get from SNES solver (or to send data to SNES), given that I have my own update procedure.

• Could you write out the question in proper mathematical notation please? In particular, it's not clear to me what $X$ is, what equation is being solved by SNES and how it relates to $X$ and $\Delta_X$, what exactly is being updated and where, what the unknowns are, etc. – Kirill Jun 5 '18 at 16:41
• you should ask this q to the petsc-users mailing list. – GoHokies Jun 5 '18 at 16:52