Skip to content

Commit

Permalink
allow QuadraticFlux to take multiple fields
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-dudt committed Aug 19, 2024
1 parent e53ce01 commit 6758a3c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions desc/objectives/_coils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1175,12 +1175,11 @@ def __init__(
self._source_grid = source_grid
self._eval_grid = eval_grid
self._eq = eq
self._field = field
self._field = [field] if not isinstance(field, list) else field
self._field_grid = field_grid
self._vacuum = vacuum
things = [field]
super().__init__(
things=things,
things=self._field,
target=target,
bounds=bounds,
weight=weight,
Expand All @@ -1200,6 +1199,8 @@ def build(self, use_jit=True, verbose=1):
Level of output.
"""
from desc.magnetic_fields import SumMagneticField

eq = self._eq

if self._eval_grid is None:
Expand Down Expand Up @@ -1241,7 +1242,7 @@ def build(self, use_jit=True, verbose=1):
)

self._constants = {
"field": self._field,
"field": SumMagneticField(self._field),
"field_grid": self._field_grid,
"quad_weights": w,
"eval_data": eval_data,
Expand All @@ -1258,7 +1259,7 @@ def build(self, use_jit=True, verbose=1):

super().build(use_jit=use_jit, verbose=verbose)

def compute(self, field_params, constants=None):
def compute(self, *field_params, constants=None):
"""Compute boundary force error.
Parameters
Expand Down

0 comments on commit 6758a3c

Please sign in to comment.