where \nabla_X(\cdot) is the gradient with respect to initial (reference) coordinates and u and v are the test and trial functions. How can I write it in dolfinx form?
By “reference coordinates” do you mean the reference element? Or do you mean a solid body’s reference configuration, typically employed in computational mechanics?
By reference coordinate I mean the initial configuration of the solid body in computational mechanics in which no deformation has occurred yet. Normally we know that the relationship between current configuration (\mathbf{x}) and initial configuration (\mathbf{X}) can be written as:
\mathbf{x} = \mathbf{X} + \mathbf{u}.
where \mathbf{u} is displacement. So for instance if one wants to obtain partial derivatives of any arbitrary field with respect to (\mathbf{X}) (which is very common in total Lagrangian formulations) then they should apply something like this