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):
For 1-forms (vector fields):
For 2-forms (area forms, e.g., magnetic field \(\mathbf{B}\)):
For 3-forms (volume forms):
Pullback (\(\Phi^*\)) transforms forms from physical to logical domain:
For 0-forms (scalar functions):
For 1-forms (vector fields):
For 2-forms (area forms):
For 3-forms (volume forms):
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:
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:
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:
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:
For 1-forms:
For 2-forms:
For 3-forms:
Field Line Integration
Field lines are integrated in the logical domain. The magnetic field equation in physical space:
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:
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:
Therefore, the field line equation in logical coordinates becomes:
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.