Skip to content

Conversation

@cemitch99
Copy link
Member

@cemitch99 cemitch99 commented Nov 18, 2025

This PR adds the update of the spin vector in a (linear) Quad element.

  • add spin helper class
  • add spin push operator in Quad.H
  • add benchmark example
  • update Python bindings
  • update documentation
  • initialize gyromagnetic anomaly value
  • add user-facing option to turn spin tracking on or off

This relies on PR#1226.

@cemitch99 cemitch99 requested review from ax3l and qianglbl November 18, 2025 01:01
using namespace amrex::literals; // for _prt

// Compute quaternion coefficients
amrex::ParticleReal angle = std::sqrt(lambdax*lambdax+lambday*lambday+lambdaz*lambdaz);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the angle ever be zero (e.g., for m_k == 0)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it can. I handle that case in lines 55-57 below.

*/
template<typename T_Real=amrex::ParticleReal, typename T_IdCpu=uint64_t>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
void operator() (
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to a named function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants