Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
638d304
add point B measurement error objective
dpanici Dec 8, 2024
c67a9fc
rearrange args
dpanici Dec 8, 2024
194e489
Merge branch 'master' into dp/B-pt-diagnostic
dpanici Dec 10, 2024
4728288
Merge branch 'master' into dp/B-pt-diagnostic
dpanici Apr 7, 2025
57a5865
Merge branch 'master' into dp/B-pt-diagnostic
dpanici May 1, 2025
34b920a
test the surface current part as well
dpanici May 3, 2025
4fe93c4
tighten test and increase test coverage
dpanici May 15, 2025
67f1007
update docstring, apply basis changes
dpanici May 15, 2025
dfb9f0b
fix test
dpanici May 15, 2025
24460c3
Merge branch 'master' into dp/B-pt-diagnostic
dpanici May 16, 2025
d1ef153
fix kwarg name in test
dpanici May 16, 2025
c23d3bd
Merge branch 'dp/B-pt-diagnostic' of github.com:PlasmaControl/DESC in…
dpanici May 16, 2025
58f647f
Merge branch 'master' into dp/B-pt-diagnostic
dpanici May 29, 2025
1835aaf
Update tests/test_objective_funs.py
dpanici May 29, 2025
cc21f8d
normalize directions
dpanici May 29, 2025
1db895a
fix bug
dpanici May 29, 2025
0b823b1
add _print_error attribute so that objectives which are error metrics…
dpanici May 29, 2025
15d7bc0
add some checks in objective
dpanici May 29, 2025
e376157
add simple optimization test
dpanici May 30, 2025
489b80b
Merge branch 'master' into dp/B-pt-diagnostic
dpanici May 30, 2025
939866d
Merge branch 'master' into dp/B-pt-diagnostic
dpanici Jun 17, 2025
0432a91
address comments
dpanici Jun 17, 2025
4292133
Merge branch 'master' into dp/B-pt-diagnostic
dpanici Jul 8, 2025
25970d8
Merge branch 'master' into dp/B-pt-diagnostic
dpanici Aug 1, 2025
1d57758
add static attr to PointBMeasurement
dpanici Aug 1, 2025
3a10953
Merge branch 'master' into dp/B-pt-diagnostic
dpanici Aug 13, 2025
d71fcfb
Merge branch 'master' into dp/B-pt-diagnostic
dpanici Aug 20, 2025
0010556
dont use directions as a static attr
dpanici Aug 22, 2025
6db87d3
Merge branch 'dp/B-pt-diagnostic' of github.com:PlasmaControl/DESC in…
dpanici Aug 22, 2025
3635a4f
Merge branch 'master' into dp/B-pt-diagnostic
dpanici Sep 3, 2025
922751f
Merge branch 'master' into dp/B-pt-diagnostic
dpanici Sep 16, 2025
a053fb0
Merge branch 'master' into dp/B-pt-diagnostic
dpanici Oct 8, 2025
2435569
don't have logic on array _directions:
dpanici Oct 10, 2025
95a94cf
Merge branch 'master' into dp/B-pt-diagnostic
YigitElma Oct 12, 2025
e534d5a
Merge branch 'master' into dp/B-pt-diagnostic
dpanici Oct 17, 2025
6833db5
Merge branch 'master' into dp/B-pt-diagnostic
dpanici Oct 22, 2025
abb8657
fix bug, add chunk size for Bplasma
dpanici Oct 28, 2025
3caa683
Merge branch 'master' into dp/B-pt-diagnostic
dpanici Nov 11, 2025
473ad60
Merge branch 'master' into dp/B-pt-diagnostic
dpanici Dec 13, 2025
8482421
Merge branch 'master' into dp/B-pt-diagnostic
dpanici Jan 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 24 additions & 17 deletions desc/magnetic_fields/_current_potential.py
Original file line number Diff line number Diff line change
Expand Up @@ -1059,6 +1059,7 @@ def _compute_A_or_B_from_CurrentPotentialField(
basis="rpz",
transforms=None,
compute_A_or_B="B",
data=None,
chunk_size=None,
):
"""Compute magnetic field or vector potential at a set of points.
Expand All @@ -1079,6 +1080,11 @@ def _compute_A_or_B_from_CurrentPotentialField(
compute_A_or_B: {"A", "B"}, optional
whether to compute the magnetic vector potential "A" or the magnetic field
"B". Defaults to "B"
data : dict
if provided, do not compute any dependency data, but instead use provided
dictionary corresponding to the source_grid.
data dictionary requires keys `"K", "| e_theta x e_zeta |"` and `"x"`,
with `"K"` and `"x"` in rpz basis.
chunk_size : int or None
Size to split computation into chunks of evaluation points.
If no chunking should be done or the chunk size is the full input
Expand All @@ -1104,23 +1110,24 @@ def _compute_A_or_B_from_CurrentPotentialField(
]
# compute surface current, and store grid quantities
# needed for integration in class
if not params or not transforms:
data = field.compute(
["K", "x"],
grid=source_grid,
basis="rpz",
params=params,
transforms=transforms,
jitable=True,
)
else:
data = compute_fun(
field,
names=["K", "x"],
params=params,
transforms=transforms,
profiles={},
)
if data is None:
if not params or not transforms:
data = field.compute(
["K", "x"],
grid=source_grid,
basis="rpz",
params=params,
transforms=transforms,
jitable=True,
)
else:
data = compute_fun(
field,
names=["K", "x"],
params=params,
transforms=transforms,
profiles={},
)

_rs = data["x"]
_K = data["K"]
Expand Down
1 change: 1 addition & 0 deletions desc/objectives/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
)
from ._power_balance import FusionPower, HeatingPowerISS04
from ._profiles import Pressure, RotationalTransform, Shear, ToroidalCurrent
from ._reconstruction import PointBMeasurement
from ._stability import BallooningStability, MagneticWell, MercierStability
from .getters import (
get_equilibrium_objective,
Expand Down
Loading