(matrix-free-single-field)= # Generic weak form (single field) Ratel solves the momentum balance equations using unstructured high-order finite/spectral element spatial discretizations by matrix-free approach. We present here the notation and mathematical formulation of matrix-free method for a general Dirichlet problem $\bm{R}(\bm{u}) = 0$: find $\bm{u} \in \mathcal{V} \subset H^1 \left( \Omega_0 \right)$ such that $$ \langle\bm{v}, \bm{R}(\bm{u}) \rangle= \int_{\Omega_0}{\bm{v} \cdot \bm{f}_0 (\bm{u}, \nabla \bm{u}) + \nabla \bm{v} \tcolon \bm{f}_1 (\bm{u}, \nabla \bm{u})} \, dV = 0, \quad \forall \bm{v} \in \mathcal{V}, $$ (residual-matrix-free) where the operators $\bm{f}_0$ and $\bm{f}_1$ contain all possible sources in the problem. In order to solve {eq}`residual-matrix-free` with Newton-Krylov iterative solvers we need its Jacobian form: find $\diff \bm{u} \in \mathcal{V} \subset H^1 \left( \Omega_0 \right)$ such that $$ \langle\bm{v}, \bm{J}(\bm{u}) \diff \bm{u} \rangle= \int_{\Omega_0}{\bm{v} \cdot \diff \bm{f}_0 + \nabla \bm{v} \tcolon \diff \bm{f}_1} \, dV, $$ (jacobian-matrix-free) where the linearization of operators $\bm{f}_0$ and $\bm{f}_1$ are $$ \diff \bm{f}_i = \frac{\partial \bm{f}_i}{\partial \bm{u}} \diff \bm{u} + \frac{\partial \bm{f}_i}{\partial \nabla \bm{u}} \nabla \diff \bm{u}, \quad i=0,1 $$ It should be noted that the gradient in the {eq}`residual-matrix-free`, {eq}`jacobian-matrix-free` depends on the configuration system and it could be with respect to initial configuration $\bm{X}$ i.e., $\nabla_X \bm{v}$ (Lagrangian approach) or current configuration $\bm{x}$ i.e., $\nabla_x \bm{v}$ (Eulerian approach). Compare with governing equations derived in pervious sections for linear and large deformation, it is easy to verify that * For linear elasticity described in {eq}`linear-weak-form` we have $$ \bm f_0 = -\rho \bm g, \quad \bm f_1 = \bm \sigma(\bm u). $$ where the linearization satisfies $\diff\bm f_{1}(\diff\bm u) = \bm f_1(\diff \bm u)$ due to linearity. * For hyperelastic in initial configuration described in {eq}`hyperelastic-weak-form-initial` and {eq}`hyperelastic-weak-form-initial-linearization` we have $$ \bm f_0 = -\rho_0 \bm g, \quad \bm f_1 = \bm F \bm S, \quad \diff \bm f_1 = \diff \bm F \bm S + \bm F \diff \bm S. $$ * For hyperelastic in current configuration derived in {eq}`hyperelastic-weak-form-current` and {eq}`jacobian-weak-form-current` $$ \bm f_0 = -\rho_0 \bm g, \quad \bm f_1 = \bm \tau, \quad \diff \bm f_1 = \diff \bm{\tau} - \bm{\tau} \left( \nabla_x \diff \bm{u} \right)^T. $$