-
Notifications
You must be signed in to change notification settings - Fork 14
Description
Dear FerroX developers,
Thank you so much for developing and sharing this amazing simulation tool! I'm currently studying the codebase of FerroX
as a beginner in phase-field simulations, and I’ve been trying to better understand how local and global coordinate systems are handled—especially in the context of polycrystalline structures.
In particular, I'm a bit confused about the following: When computing the divergence of the polarization, I see that the local polarization vector (p,q,r)
, defined in the local crystal frame, is rotated into the global coordinate system before taking derivatives. This makes sense to me, since spatial derivatives (e.g., ∂/∂x) are defined on the global mesh. For example:
RHS(i,j,k) = - (R_11*DPDx(pOld_p, ...) + R_12*DPDy(pOld_p, ...) + R_13*DPDz(pOld_p, ...)
+ R_21*DPDx(pOld_q, ...) + R_22*DPDy(pOld_q, ...) + R_23*DPDz(pOld_q, ...)
+ R_31*DPDx(pOld_r, ...) + R_32*DPDy(pOld_r, ...) + R_33*DPDz(pOld_r, ...));
However, in the part where the electric field is computed from the potential, I noticed that the gradient
Ep_arr(i,j,k) = - (R_11*DFDx(phi, ...) + R_12*DFDy(phi, ...) + R_13*DphiDz(...));
Eq_arr(i,j,k) = - (R_21*DFDx(phi, ...) + R_22*DFDy(phi, ...) + R_23*DphiDz(...));
Er_arr(i,j,k) = - (R_31*DFDx(phi, ...) + R_32*DFDy(phi, ...) + R_33*DphiDz(...));
This corresponds to:
Since the electric field is later used to compute the TDGL driving force, which (I assume) is evaluated in the global frame, I’m wondering why it is rotated to the local frame here. Is it possible that I misunderstood the coordinate conventions? Or is there a deeper reason why the electric field must be expressed in the local frame for the subsequent evolution?
I’d really appreciate any clarification—thank you again for your patient work and for maintaining such a valuable open-source project!