Geometry and Coordinate Transformations

Notation: Throughout this section: - \(\hat{x} = (r, \theta, \zeta) \in [0,1]^3\) denotes logical coordinates (hat indicates logical domain) - \(x = (x, y, z) \in \Omega \subset \mathbb{R}^3\) denotes physical coordinates (no hat indicates physical domain) - \(\Phi: [0,1]^3 \to \Omega\) (or \(F\)) maps logical coordinates to physical coordinates

MRX uses differential geometry to transform between logical coordinates \(\hat{x} = (r, \theta, \zeta) \in [0,1]^3\) and physical coordinates \(x = (x, y, z) \in \Omega \subset \mathbb{R}^3\) via a mapping function \(\Phi: [0,1]^3 \to \Omega\).

Geometric Mapping

The transformation is defined by a mapping function \(\Phi(\hat{x})\) that maps logical coordinates to physical coordinates. The Jacobian matrix \(D\Phi(\hat{x})\) and its determinant \(\det(D\Phi(\hat{x}))\) play crucial roles:

  • Jacobian matrix: \(D\Phi(\hat{x}) = \frac{\partial \Phi}{\partial \hat{x}} \in \mathbb{R}^{3 \times 3}\)

  • Jacobian determinant: \(J(\hat{x}) = \det(D\Phi(\hat{x}))\)

  • Metric tensor: \(G(\hat{x}) = D\Phi(\hat{x})^T D\Phi(\hat{x}) \in \mathbb{R}^{3 \times 3}\)

  • Inverse metric: \(G^{-1}(\hat{x}) = (D\Phi(\hat{x})^T D\Phi(\hat{x}))^{-1}\)

Pullback and Pushforward Operations

Differential forms transform between logical and physical domains using pullback and pushforward operations. These operations ensure that physical laws (such as \(\operatorname{div} \mathbf{B} = 0\)) are preserved under coordinate transformations.

Pushforward (\(\Phi_*\)) transforms forms from logical to physical domain. Note that pushforward is evaluated at logical coordinates \(\hat{x}\), and the result is a form in physical space at \(x = \Phi(\hat{x})\):

For 0-forms (scalar functions):

\[(\Phi_* f)(\Phi(\hat{x})) = f(\hat{x})\]

For 1-forms (vector fields):

\[(\Phi_* \mathbf{v})(\Phi(\hat{x})) = (D\Phi(\hat{x})^{-1})^T \mathbf{v}(\hat{x})\]

For 2-forms (area forms, e.g., magnetic field \(\mathbf{B}\)):

\[(\Phi_* \mathbf{B})(\Phi(\hat{x})) = \frac{D\Phi(\hat{x}) \mathbf{B}(\hat{x})}{\det(D\Phi(\hat{x}))}\]

For 3-forms (volume forms):

\[(\Phi_* \rho)(\Phi(\hat{x})) = \frac{\rho(\hat{x})}{\det(D\Phi(\hat{x}))}\]

Pullback (\(\Phi^*\)) transforms forms from physical to logical domain:

For 0-forms (scalar functions):

\[(\Phi^* f)(\hat{x}) = f(\Phi(\hat{x}))\]

For 1-forms (vector fields):

\[(\Phi^* \mathbf{v})(\hat{x}) = D\Phi(\hat{x})^T \mathbf{v}(\Phi(\hat{x}))\]

For 2-forms (area forms):

\[(\Phi^* \mathbf{B})(\hat{x}) = D\Phi(\hat{x})^{-1} \mathbf{B}(\Phi(\hat{x})) \det(D\Phi(\hat{x}))\]

For 3-forms (volume forms):

\[(\Phi^* \rho)(\hat{x}) = \rho(\Phi(\hat{x})) \det(D\Phi(\hat{x}))\]

Projection with Pullback

When projecting a function \(B_0: [0,1]^3 \to \mathbb{R}^3\) (given in logical coordinates) onto the discrete 2-form space, we pull the problem back to the logical domain. The Galerkin projection in physical space would be:

\[\sum_i \mathtt{B}_i \int_\Omega (\Phi_* \hat{\Lambda}_i^2)(x) \cdot (\Phi_* \hat{\Lambda}_j^2)(x) \, \mathrm{d}x = \int_\Omega B_0(\Phi^{-1}(x)) \cdot (\Phi_* \hat{\Lambda}_j^2)(x) \, \mathrm{d}x \quad \forall j\]

where \(\hat{\Lambda}_i^2\) are the 2-form basis functions in logical coordinates, and \(\Phi_*\) denotes pushforward.

Pulling back to the logical domain using the change of variables \(x = \Phi(\hat{x})\), \(\mathrm{d}x = \det(D\Phi(\hat{x})) \, \mathrm{d}\hat{x}\), this becomes:

\[\sum_i \mathtt{B}_i \int_{[0,1]^3} \hat{\Lambda}_i^2(\hat{x}) \cdot \frac{D\Phi(\hat{x})^T D\Phi(\hat{x})}{\det(D\Phi(\hat{x}))} \hat{\Lambda}_j^2(\hat{x}) \, \mathrm{d}\hat{x} = \int_{[0,1]^3} B_0(\hat{x}) \cdot D\Phi(\hat{x})^T \hat{\Lambda}_j^2(\hat{x}) \, \mathrm{d}\hat{x} \quad \forall j\]

where we used the pushforward formula for 2-forms and the fact that \((\Phi_* \hat{\Lambda}_j^2)(\Phi(\hat{x})) = D\Phi(\hat{x}) \hat{\Lambda}_j^2(\hat{x}) / \det(D\Phi(\hat{x}))\).

In matrix form:

\[M_2 \, \mathtt{B} = \Pi^2(B_0)\]

where: - \(M_2 \in \mathbb{R}^{N_2 \times N_2}\) is the 2-form mass matrix with entries \((M_2)_{ij} = \int \hat{\Lambda}_i^2(\hat{x}) \cdot G(\hat{x}) \hat{\Lambda}_j^2(\hat{x}) / \det(D\Phi(\hat{x})) \, \mathrm{d}\hat{x}\) - \(\Pi^2: L^2([0,1]^3; \mathbb{R}^3) \to \mathbb{R}^{N_2}\) is the 2-form projection operator - \(\mathtt{B} \in \mathbb{R}^{N_2}\) are the degrees of freedom

Mass Matrix with Pullback

The mass matrix for k-forms incorporates the geometric transformation:

For 0-forms:

\[(M_0)_{ij} = \int \Lambda_0^i(\hat{x}) \Lambda_0^j(\hat{x}) \det(D\Phi(\hat{x})) \, \mathrm{d}\hat{x}\]

For 1-forms:

\[(M_1)_{ij} = \int \Lambda_1^i(\hat{x}) \cdot G^{-1}(\hat{x}) \Lambda_1^j(\hat{x}) \det(D\Phi(\hat{x})) \, \mathrm{d}\hat{x}\]

For 2-forms:

\[(M_2)_{ij} = \int \Lambda_2^i(\hat{x}) \cdot G(\hat{x}) \Lambda_2^j(\hat{x}) \frac{1}{\det(D\Phi(\hat{x}))} \, \mathrm{d}\hat{x}\]

For 3-forms:

\[(M_3)_{ij} = \int \Lambda_3^i(\hat{x}) \Lambda_3^j(\hat{x}) \frac{1}{\det(D\Phi(\hat{x}))} \, \mathrm{d}\hat{x}\]

Field Line Integration

Field lines are integrated in the logical domain. The magnetic field equation in physical space:

\[\frac{\mathrm{d}}{\mathrm{d}t} x_t = \frac{\mathbf{B}(x_t)}{|\mathbf{B}(x_t)|}\]

where \(\mathbf{B}(x_t)\) is the magnetic field vector at physical point \(x_t\).

Transforming to logical coordinates using \(x_t = \Phi(\hat{x}_t)\) and the chain rule:

\[\frac{\mathrm{d}}{\mathrm{d}t} \hat{x}_t = D\Phi(\hat{x}_t)^{-1} \frac{\mathrm{d}}{\mathrm{d}t} x_t = D\Phi(\hat{x}_t)^{-1} \frac{\mathbf{B}(\Phi(\hat{x}_t))}{|\mathbf{B}(\Phi(\hat{x}_t))|}\]

Using the pushforward relation for 2-forms, \(\mathbf{B}(\Phi(\hat{x})) = D\Phi(\hat{x}) \hat{\mathbf{B}}(\hat{x}) / \det(D\Phi(\hat{x}))\), where \(\hat{\mathbf{B}}(\hat{x})\) is the magnetic field coefficient vector evaluated at logical coordinates. The magnitude is:

\[|\mathbf{B}(\Phi(\hat{x}))| = \frac{|D\Phi(\hat{x}) \hat{\mathbf{B}}(\hat{x})|}{\det(D\Phi(\hat{x}))}\]

Therefore, the field line equation in logical coordinates becomes:

\[\frac{\mathrm{d}}{\mathrm{d}t} \hat{x}_t = \frac{\hat{\mathbf{B}}(\hat{x}_t)}{|D\Phi(\hat{x}_t) \hat{\mathbf{B}}(\hat{x}_t)|}\]

where \(\hat{\mathbf{B}}(\hat{x})\) is obtained by evaluating the discrete 2-form basis functions at \(\hat{x}\) and multiplying by the degrees of freedom \(B_h\).

Inverse Mapping

To map from physical coordinates back to logical coordinates (e.g., for visualization or diagnostics), MRX uses Newton’s method to solve \(\Phi(\hat{x}) = y\) for \(\hat{x}\) given \(y\). An approximate inverse mapping is used as an initial guess for the Newton iteration.