Repository navigation
field-line tracing for axisymmetric EQDSK equilibria - #408
abhiyanpaudel wants to merge 13 commits into
Conversation
98705ad to
77b9a6e
Compare
jacobmerson
left a comment
There was a problem hiding this comment.
There are significant code reuse issues.
There was a problem hiding this comment.
#397 merged, I think that addresses all of these issues.
|
|
||
| /// Stage slopes, stage points and stage flags of one RK4 step, allocated once | ||
| /// per trace and reused by every substep. | ||
| struct RK4Workspace |
There was a problem hiding this comment.
@hgangwar am I correct in thinking the timestepping code should support various schemes such as RK4 integration? I'd rather have time integration routines in a single place in PCMS in a consistent fashion.
| }; | ||
|
|
||
| /// Axis-aligned R-Z box of the equilibrium grid, in m. | ||
| struct Box |
There was a problem hiding this comment.
Why are you implementing your own bounding box instead of using the one implemented in utility?
| /// | ||
| /// @details A point whose stages all succeeded and whose new position is in the | ||
| /// box moves; any other valid point is marked invalid and stays where it was. | ||
| void RK4Update(Real h, const Box& box, const Reals& k1R, const Reals& k1Z, |
There was a problem hiding this comment.
At a minimum, we need documentation on what is ok, valid, and all of the inputs as this is not clear from the names. Maybe this is in the hpp file. have not looked there yet.
| /** | ||
| * @brief Positions of a batch of field lines at a list of toroidal angles | ||
| */ | ||
| struct TracedPoints |
There was a problem hiding this comment.
If this is just the starting points. Can we use the PointCloud?
| } | ||
|
|
||
| /// Output buffers of one batched AxisymmetricMagneticField::Evaluate call. | ||
| struct FieldSamples |
There was a problem hiding this comment.
I think field samples should be a "point cloud"
| * reversed together with I_psi first. I is evaluated at psi clamped to the | ||
| * psi_grid range, so it is constant outside that range (vacuum field). | ||
| */ | ||
| class AxisymmetricMagneticField |
There was a problem hiding this comment.
Shouldn't this be handled by constructing a PCMS function space?
|
I think you need derivative support to fully integrate this into PCMS capabilities. I'm experimenting with some approaches to support that here: https://github.com/jacobmerson/pcms/tree/meshfields-gradients . I will prioritize getting that fully fixed, and merged this week. |
AxisymmetricMagneticFieldbuilds psi and I(psi) splines fromEQDSKDatawith an explicit poloidal sign.TraceFieldLinestraces batches of field lines with RK4 in phi, landing exactly on the given stations, andWedgeStationsproduces the stations for cubic wedge layers. Tests compare against the analytic circular-equilibrium solution and check fourth-order convergence.