freegsnke.build_machine module
Functions that build tokamak objects in FreeGSNKE (from file or otherwise).
Copyright 2025 UKAEA, UKRI-STFC, and The Authors, as per the COPYRIGHT and README files.
This file is part of FreeGSNKE.
FreeGSNKE is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
FreeGSNKE is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
FreeGSNKE is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
You should have received a copy of the GNU Lesser General Public License along with FreeGSNKE. If not, see <http://www.gnu.org/licenses/>.
- freegsnke.build_machine.add_active_coil(tokamak: Machine, coil_name: str, active_coil_data: dict, *, strict_overlap_check: bool = False) Machine[source]
Add one new active coil/circuit to an existing tokamak object, in place.
The new coil is inserted immediately before any passive structures, so that the active/passive partition of
tokamak.coils_list(everything beforetokamak.n_active_coilsis active, everything after is passive) stays contiguous. Only the new coil’s resistance/inductance matrix row/column are calculated; entries for existing coils are reused.- Parameters:
tokamak (Machine) – Existing tokamak object to update in place.
coil_name (str) – Label for the new active coil/circuit.
active_coil_data (dict) – Machine-description entry for the new active coil/circuit (same format as one entry of the active-coils dictionary).
strict_overlap_check (bool, optional) – If True, reject overlaps with ValueError. By default, warn and continue. Invalid geometry always raises.
- Returns:
The same tokamak object, updated in place.
- Return type:
- Raises:
ValueError – If a coil/passive-structure with the given label already exists, or the new geometry contains overlapping coil elements in strict mode.
Notes
This updates only machine-level state. If the machine is attached to an equilibrium, use
freegsnke.equilibrium_update.Equilibrium.add_active_coil()so that equilibrium-level Greens functions are extended as well. Existing nonlinear solver objects should be reinstantiated after a geometry change because they cache machine-dependent matrices and mode decompositions, whose dimensionality will itself have changed.
- freegsnke.build_machine.add_passive_structure(tokamak: Machine, passive_data: dict, name: str | None = None, refine_mode: str = 'G', *, strict_overlap_check: bool = False) Machine[source]
Add one new passive structure to an existing tokamak object, in place.
Only the resistance/inductance matrix row/column for the new passive structure are calculated; entries for existing coils are reused.
- Parameters:
tokamak (Machine) – Existing tokamak object to update in place.
passive_data (dict) – Machine-description entry for the new passive structure (same format as one item of the passive-coils list).
name (str, optional) – Label for the new passive structure. If omitted,
passive_data["name"]is used, and if that is also absent a default of the formf"passive_{tokamak.n_passive_coils}"is used.refine_mode (str, optional) – Refinement mode for extended (polygonal) passive structures. Defaults to
"G".strict_overlap_check (bool, optional) – If True, reject overlaps with ValueError. By default, warn and continue. Invalid geometry always raises.
- Returns:
The same tokamak object, updated in place.
- Return type:
- Raises:
ValueError – If a coil/passive-structure with the resolved label already exists, or the new geometry overlaps another coil element in strict mode.
Notes
This updates only machine-level state. If the machine is attached to an equilibrium, use
freegsnke.equilibrium_update.Equilibrium.add_passive_structure()so that equilibrium-level Greens functions are extended as well. Existing nonlinear solver objects should be reinstantiated after a geometry change because they cache machine-dependent matrices and mode decompositions, whose dimensionality will itself have changed.
- freegsnke.build_machine.apply_tokamak_components(tokamak: Machine, components: dict, preserve_currents: bool = True, rebuild_R_and_M: bool = True) Machine[source]
Apply a built machine description to an existing tokamak object.
- Parameters:
tokamak (Machine) – Tokamak object to update in place.
components (dict) – Output from
build_tokamak_components().preserve_currents (bool, optional) – If True, currents for coils with matching labels are copied across to the updated machine description.
rebuild_R_and_M (bool, optional) – Recalculate resistance and inductance matrices after updating geometry.
- Returns:
The same object, updated in place.
- Return type:
Notes
This updates only the machine object. If the machine is already attached to an equilibrium, use
freegsnke.equilibrium_update.Equilibrium.update_machine_description()so that equilibrium-level Greens functions and limiter masks are refreshed as well. Existing nonlinear solver objects should be reinstantiated after a geometry change because they cache machine-dependent matrices and mode data.
- freegsnke.build_machine.build_active_coil_component(coil_name: str, active_coil_data: dict) tuple[tuple[str, object], dict][source]
Build one active coil/circuit and its FreeGSNKE metadata.
This helper accepts the value normally stored under
coil_namein the active-coil machine-description dictionary. It reuses the same builders as full tokamak construction, so single coils and compound active circuits are interpreted identically in whole-machine and one-coil update paths.- Parameters:
coil_name (str) – Label of the active coil/circuit to build.
active_coil_data (dict) – Machine-description entry for this active coil/circuit.
- Returns:
((coil_name, coil_or_circuit), coil_metadata)where the first item is suitable for insertion intotokamak.coilsand the second is the correspondingtokamak.coils_dict[coil_name]entry.- Return type:
tuple
- Raises:
ValueError – If the supplied data cannot be converted into exactly one active coil/circuit with the requested label.
- freegsnke.build_machine.build_active_coil_dict(active_coils: dict) dict[source]
Create vectorised version of the active coil properties in a dictionary for use throughout FreeGSNKE.
- Parameters:
active_coils (dict) – Dictionary containing the active coil data.
- Returns:
coils_dict – Dictionary with vectorised properties of all active coils.
- Return type:
dict
- freegsnke.build_machine.build_actives(active_coils: dict) list[tuple[str, Circuit]][source]
Build active coils and circuits using the native MultiCoil and Circuit classes.
- Parameters:
active_coils (dict) – Dictionary containing the active coil data.
- Returns:
coils – List of
(name, Circuit)pairs to be ingested by FreeGSNKE. Entries that cannot be built are skipped after printing a message.- Return type:
list of tuple
- freegsnke.build_machine.build_passive_structure_component(name: str, passive_data: dict, refine_mode: str = 'G') tuple[tuple[str, object], dict][source]
Build one passive structure and its FreeGSNKE metadata.
This helper accepts one item of the passive-coils machine-description list (a
"name"key is not required;namealways takes precedence). It reusesbuild_passives()so a single passive structure is built exactly as it would be within a full machine build.- Parameters:
name (str) – Label for the passive structure.
passive_data (dict) – Machine-description entry for this passive structure.
refine_mode (str, optional) – Refinement mode for extended (polygonal) passive structures. Defaults to
"G".
- Returns:
((name, coil_or_passive_structure), coil_metadata)where the first item is suitable for insertion intotokamak.coilsand the second is the correspondingtokamak.coils_dict[name]entry.- Return type:
tuple
- Raises:
ValueError – If the supplied data cannot be converted into exactly one passive structure with the requested label.
- freegsnke.build_machine.build_passives(passive_coils: list[dict], coil_circuits: list[tuple[str, object]], coils_dict: dict, coil_names: list[str], refine_mode: str) tuple[list[tuple[str, object]], dict, list[str]][source]
Build the passive structures in FreeGSNKE using the PassiveStructure function.
- Parameters:
passive_coils (list of dict) – Passive structure descriptions. Entries with more than one vertex are built as polygons (
PassiveStructure), otherwise as single filaments (Coil).coil_circuits (list of tuple) – List of
(name, coil)pairs; passives are appended in place.coils_dict (dict) – Dictionary of coil metadata; passive entries are added in place.
coil_names (list of str) – List of circuit/coil names; passive names are appended in place.
refine_mode (str) – Refinement mode for extended passive structures (input as polygons): “G” for grid, “LH” for a Latin Hypercube implementation.
- Returns:
coil_circuits (list of tuple) – List of
(name, coil)pairs including the passives.coils_dict (dict) – Dictionary of coil metadata including the passives.
coil_names (list of str) – List of circuit/coil names including the passives.
- freegsnke.build_machine.build_tokamak_components(active_coils_data: dict | None = None, passive_coils_data: list | None = None, limiter_data: list | None = None, wall_data: list | None = None, magnetic_probe_data: dict | None = None, active_coils_path: str | None = None, passive_coils_path: str | None = None, limiter_path: str | None = None, wall_path: str | None = None, magnetic_probe_path: str | None = None, refine_mode: str = 'G', *, strict_overlap_check: bool = False, _defer_overlap_warning: bool = False) dict[source]
Build the reusable pieces of a FreeGSNKE machine description.
This is shared by initial tokamak construction and in-place machine updates, so direct dictionaries and pickle-backed descriptions are handled identically.
At minimum, active coil data and limiter data must be provided, either as dictionaries/lists or as pickle paths. Passive structures, wall, and magnetic probes are optional and follow the same defaults as
tokamak().- Parameters:
active_coils_data (dict, optional) – Dictionary containing the active coil description.
passive_coils_data (list, optional) – List containing passive structure descriptions. If omitted, no passive structures are added.
limiter_data (list, optional) – List of limiter boundary points.
wall_data (list, optional) – List of wall boundary points. If omitted, the limiter is used as the wall.
magnetic_probe_data (dict, optional) – Dictionary containing magnetic probe descriptions.
active_coils_path (str, optional) – Path to a pickle file containing the active coil description.
passive_coils_path (str, optional) – Path to a pickle file containing passive structure descriptions.
limiter_path (str, optional) – Path to a pickle file containing limiter boundary points.
wall_path (str, optional) – Path to a pickle file containing wall boundary points.
magnetic_probe_path (str, optional) – Path to a pickle file containing magnetic probe descriptions.
refine_mode (str, optional) – Refinement mode for extended passive structures. Defaults to
"G".strict_overlap_check (bool, optional) – If True, reject overlaps with ValueError. By default, warn and continue. Invalid geometry always raises.
- Returns:
Dictionary containing FreeGSNKE coil circuits, wall and limiter objects, FreeGSNKE coil metadata, coil counts, and the probe object needed to initialise or update a
freegsnke.machine_update.Machine.- Return type:
dict
- freegsnke.build_machine.check_for_overlapping_elements(active_data, passive_data, area_tolerance=1e-06)[source]
Find overlapping pairs among active and passive machine elements.
- Parameters:
active_data (dict) – Active-coil descriptions keyed by coil or circuit name. Each value is either a winding entry with centre coordinates
RandZand rectangular dimensionsdRanddZ, or a dictionary of such entries keyed by sub-coil name. Coordinates and dimensions are in metres.passive_data (list of dict) – Passive-structure descriptions. Single-point entries use rectangles centred at
RandZ, sized bydRanddZ. Multiple points define polygon vertices, regardless of dimension metadata. Coordinates and dimensions are in metres. Optionalnamevalues identify structures; unnamed entries usepassive_{index}with a zero-based index.area_tolerance (float, optional) – Maximum intersection area, in square metres, ignored when checking overlaps. Must be finite and non-negative. Defaults to
1e-6.
- Returns:
Labels for each overlapping pair. Multi-winding active entries include a zero-based winding index in their label; sub-coils use
circuit.subcoillabels. Active-active pairs come first, followed by passive-passive and active-passive pairs. Empty if no overlaps exist.- Return type:
list[tuple[str, str]]
- Raises:
KeyError – If a geometry entry is missing required coordinate keys.
TypeError – If coordinates, dimensions, or the tolerance cannot be converted to the required numeric types.
ValueError – If the tolerance is invalid, numeric conversion fails, or geometry is invalid, including mismatched or non-finite coordinates, missing or non-positive dimensions, or an invalid polygon.
Notes
Checks all pairs, including windings and sub-coils within active circuits. Only intersection areas strictly greater than
area_tolerancecount as overlaps; touching edges are allowed. Overlaps are returned, not raised as exceptions.
- freegsnke.build_machine.check_for_overlapping_single_element(element, active_data, passive_data, exclude_name=None, area_tolerance=1e-06, *, active=False)[source]
Find overlaps between one candidate entry and existing machine elements.
- Parameters:
element (dict) – Candidate winding or passive-structure entry. Passive entries with multiple coordinates define a polygon, regardless of dimension metadata. Single-point passives and active windings use centred rectangles. Coordinates and dimensions are in metres. The optional
namedefaults to"candidate". A dictionary of sub-coils is not accepted.active_data (dict) – Existing active-coil descriptions keyed by coil or circuit name, in the format accepted by
check_for_overlapping_elements().passive_data (list of dict) – Existing passive-structure descriptions, in the format accepted by
check_for_overlapping_elements().exclude_name (str, optional) – Existing label to ignore when validating a replacement. Active labels matching this name or starting with
exclude_name + "."orexclude_name + "["are excluded, including sub-coils and windings. Passive labels are excluded only on an exact match. Defaults to None.area_tolerance (float, optional) – Maximum intersection area, in square metres, ignored when checking overlaps. Must be finite and non-negative. Defaults to
1e-6.active (bool, optional) – Set True for an active winding entry, whose coordinates are winding centres rather than polygon vertices. Defaults to False (passive).
- Returns:
Pairs of
(candidate_label, existing_label)for each overlapping winding or passive structure. Candidate labels include a zero-based winding index when there are multiple rectangles. Empty if no overlaps exist.- Return type:
list[tuple[str, str]]
- Raises:
KeyError – If a geometry entry is missing required coordinate keys.
TypeError – If coordinates, dimensions, or the tolerance cannot be converted to the required numeric types.
ValueError – If the tolerance is invalid, numeric conversion fails, or geometry is invalid, including mismatched or non-finite coordinates, missing or non-positive dimensions, or an invalid polygon.
Notes
Checks only candidate-versus-existing pairs. It does not check for internal overlaps within the candidate or between existing elements. Only intersection areas strictly greater than
area_tolerancecount as overlaps; touching edges are allowed. Overlaps are returned, not raised as exceptions.
- freegsnke.build_machine.copy_tokamak(tokamak: Machine) Machine[source]
Create a copy of a tokamak Machine object with controlled deep/shallow copying.
This function duplicates the core Machine object while carefully controlling which internal structures are shared and which are copied. It is intended to produce a new independent tokamak instance suitable for simulation branching or parameter variation.
- Copy behaviour:
Uses tokamak.copy() as the base object copy.
Performs shallow copies of coil container structures.
Copies selected numerical arrays using copy_into.
Shares some reference-type attributes (e.g. probes).
- Parameters:
tokamak (Machine) – Original tokamak machine object to be copied.
- Returns:
New tokamak instance with copied geometry and selected attributes.
- Return type:
Notes
coils_dict is shallow-copied (dictionary structure copied, values shared).
coils_list is shallow-copied (list container copied, objects shared).
coil_resist, coil_self_ind, and current_vec are copied using copy_into (typically deep or array-level copy depending on implementation).
Cached machine-description data and update metadata are copied so direct machine-description updates remain available on the new object.
probes is shared by reference (not copied).
This function does not guarantee full independence of all mutable substructures unless copy_into enforces deep copying.
- freegsnke.build_machine.load_data_dicts(active_coils_data: dict | None = None, passive_coils_data: list | None = None, limiter_data: list | None = None, wall_data: list | None = None, active_coils_path: str | None = None, passive_coils_path: str | None = None, limiter_path: str | None = None, wall_path: str | None = None) tuple[dict, list, list, list][source]
Load the standardised input data required to build the tokamak machine.
These dictionaries/lists can either be provided directly or loaded from pickle files. For each item, at most one of the data and the path may be given. Active coils and the limiter are required; the passives default to an empty list and the wall defaults to the limiter.
- Parameters:
active_coils_data (dict, optional) – Dictionary containing the active coil data.
passive_coils_data (list, optional) – List containing the passive structure data.
limiter_data (list, optional) – List of limiter boundary points (dicts with “R” and “Z”).
wall_data (list, optional) – List of wall boundary points (dicts with “R” and “Z”).
active_coils_path (str, optional) – Path to the pickle file containing the active coil data.
passive_coils_path (str, optional) – Path to the pickle file containing the passive structure data.
limiter_path (str, optional) – Path to the pickle file containing the limiter data.
wall_path (str, optional) – Path to the pickle file containing the wall data.
- Returns:
active_coils_data (dict) – Dictionary containing active coil data.
passive_coils_data (list) – List containing passive structure data.
limiter_data (list) – List of limiter boundary points.
wall_data (list) – List of wall boundary points.
- Raises:
ValueError – If both the data and the path are given for any item, or if neither is given for the (required) active coils or limiter.
- freegsnke.build_machine.remove_active_coil(tokamak: Machine, coil_name: str) Machine[source]
Remove one active coil/circuit from an existing tokamak object, in place.
Only the removed coil’s resistance/inductance matrix row/column are dropped; entries for the remaining coils are reused.
- Parameters:
tokamak (Machine) – Existing tokamak object to update in place.
coil_name (str) – Existing active coil/circuit label to remove.
- Returns:
The same tokamak object, updated in place.
- Return type:
- Raises:
ValueError – If
coil_nameis not an existing active coil/circuit label.
Notes
This updates only machine-level state. If the machine is attached to an equilibrium, use
freegsnke.equilibrium_update.Equilibrium.remove_active_coil()so that equilibrium-level Greens functions are shrunk as well. Existing nonlinear solver objects should be reinstantiated after a geometry change because they cache machine-dependent matrices and mode decompositions, whose dimensionality will itself have changed.
- freegsnke.build_machine.remove_passive_structure(tokamak: Machine, name: str) Machine[source]
Remove one passive structure from an existing tokamak object, in place.
Only the resistance/inductance matrix row/column for the removed passive structure are dropped; entries for the remaining coils are reused.
- Parameters:
tokamak (Machine) – Existing tokamak object to update in place.
name (str) – Existing passive-structure label to remove.
- Returns:
The same tokamak object, updated in place.
- Return type:
- Raises:
ValueError – If
nameis not an existing passive-structure label.
Notes
This updates only machine-level state. If the machine is attached to an equilibrium, use
freegsnke.equilibrium_update.Equilibrium.remove_passive_structure()so that equilibrium-level Greens functions are shrunk as well. Existing nonlinear solver objects should be reinstantiated after a geometry change because they cache machine-dependent matrices and mode decompositions, whose dimensionality will itself have changed.
- freegsnke.build_machine.tokamak(active_coils_data: dict | None = None, passive_coils_data: list | None = None, limiter_data: list | None = None, wall_data: list | None = None, magnetic_probe_data: dict | None = None, active_coils_path: str | None = None, passive_coils_path: str | None = None, limiter_path: str | None = None, wall_path: str | None = None, magnetic_probe_path: str | None = None, refine_mode: str = 'G', *, strict_overlap_check: bool = False) Machine[source]
Build a tokamak machine from the standardised input data.
These dictionaries/lists/arrays can either be provided directly or loaded from pickle files.
At minimum, the tokamak requires active coil data and a limiter (to contain the plasma). The passives, the wall, and the magnetic probes are optional.
- Parameters:
active_coils_data (dict, optional) – Dictionary containing the active coil data.
passive_coils_data (list, optional) – List containing the passive structure data.
limiter_data (list, optional) – List of limiter boundary points (dicts with “R” and “Z”).
wall_data (list, optional) – List of wall boundary points (dicts with “R” and “Z”).
magnetic_probe_data (dict, optional) – Dictionary containing the magnetic probes data.
active_coils_path (str, optional) – Path to the pickle file containing the active coil data.
passive_coils_path (str, optional) – Path to the pickle file containing the passive structure data.
limiter_path (str, optional) – Path to the pickle file containing the limiter data.
wall_path (str, optional) – Path to the pickle file containing the wall data.
magnetic_probe_path (str, optional) – Path to the pickle file containing the magnetic probe data.
refine_mode (str, optional) – Choose the refinement mode for extended passive structures (input as polygons), by default ‘G’ for ‘grid’ (use ‘LH’ for alternative mode using a Latin Hypercube implementation).
strict_overlap_check (bool, optional) – If True, reject overlaps with ValueError. By default, warn and continue. Invalid geometry always raises.
- Returns:
Object containing the tokamak machine description.
- Return type:
- freegsnke.build_machine.update_active_coil(tokamak: Machine, coil_name: str, active_coil_data: dict, preserve_current: bool = True, *, strict_overlap_check: bool = False) Machine[source]
Update one active coil/circuit on an existing tokamak object.
Only the named active coil object, its
coils_dictmetadata, cached raw machine-description entry, and the affected resistance/inductance matrix entries are updated. Passive structures, limiter/wall objects, magnetic probe descriptions, and unchanged coil objects are left in place.- Parameters:
tokamak (Machine) – Existing tokamak object to update in place.
coil_name (str) – Existing active coil/circuit label to replace.
active_coil_data (dict) – Machine-description entry for
coil_name.preserve_current (bool, optional) – If True, the old current on
coil_nameis copied onto the replacement coil/circuit. Defaults to True.strict_overlap_check (bool, optional) – If True, reject overlaps with ValueError. By default, warn and continue. Invalid geometry always raises.
- Returns:
The same tokamak object, updated in place.
- Return type:
- Raises:
ValueError – If
coil_nameis not an existing active coil/circuit label, or the replacement geometry overlaps another element in strict mode.
Notes
This updates only machine-level state. If the machine is attached to an equilibrium, use
freegsnke.equilibrium_update.Equilibrium.update_active_coil()so that equilibrium-level Greens functions are refreshed as well. Existing nonlinear solver objects should be reinstantiated after a geometry change because they cache machine-dependent matrices and mode decompositions.
- freegsnke.build_machine.update_passive_structure(tokamak: Machine, name: str, passive_data: dict, preserve_current: bool = True, refine_mode: str = 'G', *, strict_overlap_check: bool = False) Machine[source]
Update one passive structure on an existing tokamak object, in place.
Only the named passive-structure object, its
coils_dictmetadata, and the resistance/inductance matrix entries it affects are recalculated. Active coils, other passive structures, limiter/wall objects, and magnetic probe descriptions are left in place. This does not change the set or ordering of passive structures; useadd_passive_structure()orremove_passive_structure()for that.- Parameters:
tokamak (Machine) – Existing tokamak object to update in place.
name (str) – Existing passive-structure label to replace.
passive_data (dict) – Machine-description entry for
name(same format as one item of the passive-coils list).preserve_current (bool, optional) – If True, the old current on
nameis copied onto the replacement passive structure. Defaults to True.refine_mode (str, optional) – Refinement mode for extended (polygonal) passive structures. Defaults to
"G".strict_overlap_check (bool, optional) – If True, reject overlaps with ValueError. By default, warn and continue. Invalid geometry always raises.
- Returns:
The same tokamak object, updated in place.
- Return type:
- Raises:
ValueError – If
nameis not an existing passive-structure label, or the replacement geometry overlaps another coil element in strict mode.
Notes
This updates only machine-level state. If the machine is attached to an equilibrium, use
freegsnke.equilibrium_update.Equilibrium.update_passive_structure()so that equilibrium-level Greens functions are refreshed as well. Existing nonlinear solver objects should be reinstantiated after a geometry change because they cache machine-dependent matrices and mode decompositions.
- freegsnke.build_machine.update_tokamak(tokamak: Machine, active_coils_data: dict | None = None, passive_coils_data: list | None = None, limiter_data: list | None = None, wall_data: list | None = None, magnetic_probe_data: dict | None = None, active_coils_path: str | None = None, passive_coils_path: str | None = None, limiter_path: str | None = None, wall_path: str | None = None, magnetic_probe_path: str | None = None, refine_mode: str = 'G', preserve_currents: bool = True, *, strict_overlap_check: bool = False) Machine[source]
Update an existing tokamak from direct data dictionaries or pickle paths.
This is the functional equivalent of
freegsnke.machine_update.Machine.set_machine_description(). It accepts the same machine-description inputs astokamak(), rebuilds the coil/circuit objects and coil metadata, and recalculates the resistance and inductance matrices on the existing machine object.- Parameters:
tokamak (Machine) – Existing tokamak object to update in place.
active_coils_data (dict, optional) – Dictionary containing the active coil description.
passive_coils_data (list, optional) – List containing passive structure descriptions.
limiter_data (list, optional) – List of limiter boundary points.
wall_data (list, optional) – List of wall boundary points.
magnetic_probe_data (dict, optional) – Dictionary containing magnetic probe descriptions.
active_coils_path (str, optional) – Path to a pickle file containing the active coil description.
passive_coils_path (str, optional) – Path to a pickle file containing passive structure descriptions.
limiter_path (str, optional) – Path to a pickle file containing limiter boundary points.
wall_path (str, optional) – Path to a pickle file containing wall boundary points.
magnetic_probe_path (str, optional) – Path to a pickle file containing magnetic probe descriptions.
refine_mode (str, optional) – Refinement mode for extended passive structures. Defaults to
"G".preserve_currents (bool, optional) – If True, currents for labels that are present in both the old and new machine descriptions are copied onto the updated coil objects.
strict_overlap_check (bool, optional) – If True, reject overlaps with ValueError. By default, warn and continue. Invalid geometry always raises.
- Returns:
The same tokamak object, updated in place.
- Return type: