desc.magnetic_fields.SumMagneticField

class desc.magnetic_fields.SumMagneticField(*fields)Source

Sum of two or more magnetic field sources.

Parameters:

fields (MagneticField) – two or more MagneticFields to add together

Methods

append(value)

S.append(value) -- append value to the end of the sequence

clear()

compute_Bnormal(surface[, eval_grid, ...])

Compute Bnormal from self on the given surface.

compute_magnetic_field(coords[, params, ...])

Compute magnetic field at a set of points.

copy([deepcopy])

Return a (deep)copy of this object.

count(value)

equiv(other)

Compare equivalence between DESC objects.

extend(values)

S.extend(iterable) -- extend sequence by appending elements from the iterable

index(value, [start, [stop]])

Raises ValueError if the value is not present.

insert(i, new_item)

Insert a new field into the sum at position i.

load(load_from[, file_format])

Initialize from file.

pack_params(params)

Convert a list of dictionary of parameters into a single array.

pop([index])

Raise IndexError if list is empty or index is out of range.

remove(value)

S.remove(value) -- remove first occurrence of value.

reverse()

S.reverse() -- reverse IN PLACE

save(file_name[, file_format, file_mode])

Save the object.

save_BNORM_file(surface, fname[, basis_M, ...])

Create BNORM-style .txt file containing Bnormal Fourier coefficients.

save_mgrid(path, Rmin, Rmax, Zmin, Zmax[, ...])

Save the magnetic field to an mgrid NetCDF file in "raw" format.

unpack_params(x)

Convert a single array of concatenated parameters into a dictionary.

Attributes

dim_x

total number of optimizable parameters.

dimensions

list of dictionary of integers of sizes of each parameter.

optimizable_params

string names of parameters that have been declared optimizable.

params_dict

list of dictionary of arrays of optimizable parameters.

x_idx

list of dict of arrays of idx for each param in concatenated array.