The mesh points of the grid are the vertices of triangles, located at points . We use a finite element discretization, introducing basis functions , which in the present work are piecewise linear over each triangle, and satisfy The basis function is equal to unity on vertex i, and equal to zero on all other vertices.
The variables in the MHD equations are represented as a sum over basis functions. We first consider discretization of the equations (7), (8), (9), and (10), in which the variables to be expanded in basis functions are the velocity stream function the magnetic flux vorticity and the current C. The variables in the MHD equations, such as are represented as
We use a zero residual Galerkin approach in which the equations are multiplied by a basis function , and integrated over the domain. This gives the set of sparse matrix equations,
where
The matrices appearing in these equations are the mass matrix the stiffness matrix and the Poisson bracket tensor defined by
Both the stiffness and mass matrices are symmetric. The Poisson bracket is anti symmetric under the exchange of any two indices. This assures that some of the most important integral relations satisfied by the differential equations are preserved by the finite element discretization. This includes conservation of energy and magnetic flux in the absence of dissipation. The matrices are sparse, having nonzero elements only between those vertices connected by the side of a triangle.
The discretization of the current - vorticity forms of the MHD equations is similar and involves the same matrices.