PlasmaControl / DESC

Stellarator Equilibrium and Optimization Suite
MIT License
87 stars 22 forks source link

Add `external_field` argument to `QuadraticFlux` and other normal field objectives #1164

Open dpanici opened 1 month ago

dpanici commented 1 month ago

If I want to say optimize a modular coilset in the presence of a background ToroidalField, currently we would have to do so with a SumMagneticField object, passing in the coils and the TF. however, our coil objectives cannot handle a SumMagneticField object so we would be unable to penalize coil coil distance or curvature or anything like that.

If we add in a external_field argument to these objectives that can take in a static external field, we would avoid these issues.

A longer term fix would be to get the coil objectives to work with objects where the field is not given solely by coilsets.

dpanici commented 1 month ago

Modify pytree function in coil objectives to only use the coilsets in the passed-in magnetic field object