DESC
DESC copied to clipboard
Combine near axis constraints into fewer number of `Objectives`
Right now when you get_NAE_constraints it returns a whole bunch of individual FixSumXModes objects, it would be cleaner if they were all packaged into a single object like FixNAEX, where you could instantiate it directly giving the target as some particular QSC equilibrium.
@dpanici bumping this as once #604 is merged in, NAE constrained solves will print a ton of objective errors on completion...
We could probably make a simple kind of hacky thing like
class FixNearAxis():
def __init__(self, eq, naeq, ...):
def build(self):
cons = get_near_axis_constraints(self.eq, self.naeq)
for con in cons:
con.build()
self.A = np.stack([con.A for con in cons])
self.target = np.stack([con.target for con in cons
Make FixNearAxisR and FixNearAxisZ objectives which can take in an order to fix (0 = axis only, 1 = O(rho) etc), a DESC eq, and then the target can be one of None (in which case it fixes the current eq's near-axis behavior to the specified order), qsc where it fixes it to the given pyQSC eq, or target_array which is a user-specified target for the NAE behavior (needs to be correct size which is something like for order 1: 3 * eq,N I think