Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Short PR focused on optimisations I have made after reviewing the results from profiling with Intel VTune hotspots analysis which provides some metrics for hot functions/paths within the code.
Changelist
inline CoordTransform::cart_to_polar_xy()
which handles conversion to polar coordinates returning only(R,Z)
as the calculation of the anglephi
relies on the expensiveatan2
function. Existing fullcart_to_polar()
function which returns(R,Z,PHI)
still exists and is used in some places where the anglephi
is required such as Cartesian b-field calculationinline CoordTransform::cart_to_polar_phi()
to only returnphi
and not(R,Z)
EquilData::get_psi(R,Z)
to get the value ofpsi
at a particular polar coordinate(R,Z)
instead of having to do a fullpolar_to_flux
transformation as was done previouslyCoordTransform
namespacenew
andfree
times which were identified as a top hotspot in VTune analysis