ngnet
This is an NGnet implementation. It is used for shape representation in the NGnet on/off method[3].
Overview
NGnet is defined as follows (for a two-dimensional coordinate space).
: Weight vector
: Coordinate vector
: Number of Gaussian basis functions in the NGnet
: Center vector of the th Gaussian basis function
: Standard deviation of the th Gaussian basis function
In the NGnet on/off method, optimizing the weight vector changes the distribution of , and the material at each position in the design region is determined from its value.
The original paper defines locations where is greater than 0 as the ON-state material (magnetic core), and locations where it is 0 or less as the OFF-state material (air).
Configurable keyword arguments
coordinate: str... Coordinate system used to construct the NGnet: "Cartesian" or "Polar".sigma: float... Standard deviation of the Gaussian basis functions in the NGnet. The default is1.design_region: list[list[float, float], list[float, float]]... Region used to construct the NGnet (the design region). ForCartesian, specify a rectangular region ; forPolar, specify a sector region .
By default, the Gaussian basis functions that make up the NGnet are automatically arranged to fill design_region, as shown below.
Each circle in the figure represents the placement of a Gaussian basis function, and its radius represents the standard deviation. The figure is output as gaussian.png directly under the EMSOptimizer folder when shape optimization is run.

distance_factor: float... Determines the spacing between Gaussian basis functions. Values below 1 place the functions so that they overlap more. The default is0.8.dimension: str... Dimension in which to arrange the Gaussian basis functions: "2D" or "3D". The default is "2D".eliminate_bases_on_edge: bool... Whether to remove Gaussian basis functions at the region boundaries. The default isFalse.normalize_output: bool... Whether to normalize the NGnet output. WhenFalse,
is used. The default isTrue.fixed_design_region: list[list[float, float], list[float, float]] | null... Force the output outside this range to 1. Specify it in the same way asdesign_region.check_basis_GUI: bool... When True, launch a GUI at startup to inspect the arrangement of the Gaussian basis functions.