Boundary Element¶
Fields¶
cfsem.flux_density_triangle_mesh ¶
flux_density_triangle_mesh(
obs: NDArray[float64],
nodes: NDArray[float64],
triangles: NDArray[int64],
s: NDArray[float64],
par: bool = True,
quad: str = "dunavant3",
) -> Array3xN
Biot-Savart law calculation for B-field contribution from a triangle mesh with one stream-function value per node.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
obs
|
NDArray[float64]
|
[m] observation points with shape |
required |
nodes
|
NDArray[float64]
|
[m] mesh node coordinates with shape |
required |
triangles
|
NDArray[int64]
|
node indices with shape |
required |
s
|
NDArray[float64]
|
[A] nodal stream-function values with shape |
required |
par
|
bool
|
Whether to use CPU parallelism |
True
|
quad
|
str
|
Triangle quadrature rule, one of |
'dunavant3'
|
Returns:
| Type | Description |
|---|---|
Array3xN
|
[T] (Bx, By, Bz) magnetic flux density at observation points |
Source code in cfsem/bindings.py
cfsem.vector_potential_triangle_mesh ¶
vector_potential_triangle_mesh(
obs: NDArray[float64],
nodes: NDArray[float64],
triangles: NDArray[int64],
s: NDArray[float64],
par: bool = True,
quad: str = "dunavant3",
) -> Array3xN
Vector potential calculation for A-field contribution from a triangle mesh with one stream-function value per node.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
obs
|
NDArray[float64]
|
[m] observation points with shape |
required |
nodes
|
NDArray[float64]
|
[m] mesh node coordinates with shape |
required |
triangles
|
NDArray[int64]
|
node indices with shape |
required |
s
|
NDArray[float64]
|
[A] nodal stream-function values with shape |
required |
par
|
bool
|
Whether to use CPU parallelism |
True
|
quad
|
str
|
Triangle quadrature rule, one of |
'dunavant3'
|
Returns:
| Type | Description |
|---|---|
Array3xN
|
[Wb/m] or [V-s/m] (Ax, Ay, Az) magnetic vector potential at observation points |
Source code in cfsem/bindings.py
Field Mappings¶
cfsem.flux_density_triangle_mesh_mapping ¶
flux_density_triangle_mesh_mapping(
obs: NDArray[float64],
nodes: NDArray[float64],
triangles: NDArray[int64],
par: bool = True,
quad: str = "dunavant3",
) -> tuple[
NDArray[float64], NDArray[float64], NDArray[float64]
]
Assemble the dense source-node to target-point B-field mapping for a triangle mesh.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
obs
|
NDArray[float64]
|
[m] observation points with shape |
required |
nodes
|
NDArray[float64]
|
[m] mesh node coordinates with shape |
required |
triangles
|
NDArray[int64]
|
node indices with shape |
required |
par
|
bool
|
Whether to use CPU parallelism |
True
|
quad
|
str
|
Triangle quadrature rule, one of |
'dunavant3'
|
Returns:
| Type | Description |
|---|---|
tuple[NDArray[float64], NDArray[float64], NDArray[float64]]
|
[T/A] |
Source code in cfsem/bindings.py
cfsem.vector_potential_triangle_mesh_mapping ¶
vector_potential_triangle_mesh_mapping(
obs: NDArray[float64],
nodes: NDArray[float64],
triangles: NDArray[int64],
par: bool = True,
quad: str = "dunavant3",
) -> tuple[
NDArray[float64], NDArray[float64], NDArray[float64]
]
Assemble the dense source-node to target-point A-field mapping for a triangle mesh.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
obs
|
NDArray[float64]
|
[m] observation points with shape |
required |
nodes
|
NDArray[float64]
|
[m] mesh node coordinates with shape |
required |
triangles
|
NDArray[int64]
|
node indices with shape |
required |
par
|
bool
|
Whether to use CPU parallelism |
True
|
quad
|
str
|
Triangle quadrature rule, one of |
'dunavant3'
|
Returns:
| Type | Description |
|---|---|
tuple[NDArray[float64], NDArray[float64], NDArray[float64]]
|
[Vs/(mA)] |
Source code in cfsem/bindings.py
Mesh Utilities¶
cfsem.triangle_mesh_current_density ¶
triangle_mesh_current_density(
nodes: NDArray[float64],
triangles: NDArray[int64],
s: NDArray[float64],
) -> NDArray[float64]
Extract the constant physical surface current density on each triangle of a mesh.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nodes
|
NDArray[float64]
|
[m] mesh node coordinates with shape |
required |
triangles
|
NDArray[int64]
|
node indices with shape |
required |
s
|
NDArray[float64]
|
[A] nodal stream-function values with shape |
required |
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
[A/m] triangle-wise surface current density with shape |
Source code in cfsem/bindings.py
cfsem.triangle_mesh_quadrature_points ¶
triangle_mesh_quadrature_points(
nodes: NDArray[float64],
triangles: NDArray[int64],
quad: str = "dunavant3",
) -> tuple[NDArray[float64], NDArray[float64]]
Extract physical quadrature-point coordinates and area weights for each triangle.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nodes
|
NDArray[float64]
|
[m] mesh node coordinates with shape |
required |
triangles
|
NDArray[int64]
|
node indices with shape |
required |
quad
|
str
|
Triangle quadrature rule, one of |
'dunavant3'
|
Returns:
| Name | Type | Description |
|---|---|---|
points |
NDArray[float64]
|
[m] quadrature-point coordinates with shape |
weights |
NDArray[float64]
|
[m^2] physical quadrature weights with shape |
Source code in cfsem/bindings.py
Inductance¶
cfsem.triangle_mesh_inductance_matrix ¶
triangle_mesh_inductance_matrix(
nodes: NDArray[float64],
triangles: NDArray[int64],
par: bool = True,
quad: str = "dunavant3",
) -> NDArray[float64]
Assemble the dense nodal inductance matrix for a triangle stream-function mesh.
If par=True and the per-worker scratch matrices cannot be allocated, the
implementation falls back to the serial path instead of failing outright.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nodes
|
NDArray[float64]
|
[m] mesh node coordinates with shape |
required |
triangles
|
NDArray[int64]
|
node indices with shape |
required |
par
|
bool
|
Whether to use CPU parallelism |
True
|
quad
|
str
|
Triangle quadrature rule, one of |
'dunavant3'
|
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
[H] dense nodal inductance matrix with shape |
Source code in cfsem/bindings.py
cfsem.triangle_mesh_inductance_mapping_from_linear_filaments ¶
triangle_mesh_inductance_mapping_from_linear_filaments(
xyzfil: Array3xN,
dlxyzfil: Array3xN,
nodes_tgt: NDArray[float64],
triangles_tgt: NDArray[int64],
wire_radius: float | NDArray[float64] = 0.0,
par: bool = True,
quad: str = "dunavant3",
) -> NDArray[float64]
Assemble the source-current to target-node inductance mapping from linear filaments.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xyzfil
|
Array3xN
|
[m] x,y,z filament start coordinates |
required |
dlxyzfil
|
Array3xN
|
[m] x,y,z filament segment deltas |
required |
nodes_tgt
|
NDArray[float64]
|
[m] target mesh node coordinates with shape |
required |
triangles_tgt
|
NDArray[int64]
|
target node indices with shape |
required |
wire_radius
|
float | NDArray[float64]
|
[m] filament radius, scalar or array of length |
0.0
|
par
|
bool
|
Whether to use CPU parallelism |
True
|
quad
|
str
|
Triangle quadrature rule, one of |
'dunavant3'
|
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
[H] mapping matrix with shape |
Source code in cfsem/bindings.py
cfsem.triangle_mesh_inductance_mapping_from_circular_filaments ¶
triangle_mesh_inductance_mapping_from_circular_filaments(
rfil: NDArray[float64],
zfil: NDArray[float64],
nodes_tgt: NDArray[float64],
triangles_tgt: NDArray[int64],
par: bool = True,
quad: str = "dunavant3",
) -> NDArray[float64]
Assemble the source-current to target-node inductance mapping from circular filaments.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rfil
|
NDArray[float64]
|
[m] circular filament radii |
required |
zfil
|
NDArray[float64]
|
[m] circular filament axial coordinates |
required |
nodes_tgt
|
NDArray[float64]
|
[m] target mesh node coordinates with shape |
required |
triangles_tgt
|
NDArray[int64]
|
target node indices with shape |
required |
par
|
bool
|
Whether to use CPU parallelism |
True
|
quad
|
str
|
Triangle quadrature rule, one of |
'dunavant3'
|
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
[H] mapping matrix with shape |
Source code in cfsem/bindings.py
cfsem.triangle_mesh_flux_linkage_mapping_from_dipoles ¶
triangle_mesh_flux_linkage_mapping_from_dipoles(
loc: Array3xN,
moment_dir: Array3xN,
nodes_tgt: NDArray[float64],
triangles_tgt: NDArray[int64],
outer_radius: float | NDArray[float64] = 0.0,
par: bool = True,
quad: str = "dunavant3",
) -> NDArray[float64]
Assemble the source-amplitude to target-node flux-linkage mapping from dipoles.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
loc
|
Array3xN
|
[m] dipole locations |
required |
moment_dir
|
Array3xN
|
dipole moment direction vectors |
required |
nodes_tgt
|
NDArray[float64]
|
[m] target mesh node coordinates with shape |
required |
triangles_tgt
|
NDArray[int64]
|
target node indices with shape |
required |
outer_radius
|
float | NDArray[float64]
|
[m] dipole finite-core radius, scalar or array of length |
0.0
|
par
|
bool
|
Whether to use CPU parallelism |
True
|
quad
|
str
|
Triangle quadrature rule, one of |
'dunavant3'
|
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
mapping matrix with shape |
Source code in cfsem/bindings.py
Force¶
cfsem.triangle_mesh_force_mapping ¶
triangle_mesh_force_mapping(
nodes_src: NDArray[float64],
triangles_src: NDArray[int64],
nodes_tgt: NDArray[float64],
triangles_tgt: NDArray[int64],
s_tgt: NDArray[float64],
par: bool = True,
quad: str = "dunavant3",
) -> tuple[
NDArray[float64], NDArray[float64], NDArray[float64]
]
Assemble the frozen-target source-node to target-triangle force mapping between two meshes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nodes_src
|
NDArray[float64]
|
[m] source mesh node coordinates with shape |
required |
triangles_src
|
NDArray[int64]
|
source node indices with shape |
required |
nodes_tgt
|
NDArray[float64]
|
[m] target mesh node coordinates with shape |
required |
triangles_tgt
|
NDArray[int64]
|
target node indices with shape |
required |
s_tgt
|
NDArray[float64]
|
[A] fixed target nodal current-potential values with shape |
required |
par
|
bool
|
Whether to use CPU parallelism |
True
|
quad
|
str
|
Triangle quadrature rule, one of |
'dunavant3'
|
Returns:
| Type | Description |
|---|---|
tuple[NDArray[float64], NDArray[float64], NDArray[float64]]
|
[N/A] |
Source code in cfsem/bindings.py
cfsem.triangle_mesh_self_force_mapping ¶
triangle_mesh_self_force_mapping(
nodes: NDArray[float64],
triangles: NDArray[int64],
s: NDArray[float64],
par: bool = True,
quad: str = "dunavant3",
) -> tuple[
NDArray[float64], NDArray[float64], NDArray[float64]
]
Assemble the self-excluded frozen-target source-node to target-triangle force mapping.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nodes
|
NDArray[float64]
|
[m] mesh node coordinates with shape |
required |
triangles
|
NDArray[int64]
|
node indices with shape |
required |
s
|
NDArray[float64]
|
[A] fixed nodal current-potential values with shape |
required |
par
|
bool
|
Whether to use CPU parallelism |
True
|
quad
|
str
|
Triangle quadrature rule, one of |
'dunavant3'
|
Returns:
| Type | Description |
|---|---|
tuple[NDArray[float64], NDArray[float64], NDArray[float64]]
|
[N/A] |
Source code in cfsem/bindings.py
cfsem.triangle_mesh_force_mapping_from_linear_filaments ¶
triangle_mesh_force_mapping_from_linear_filaments(
xyzfil: Array3xN,
dlxyzfil: Array3xN,
nodes_tgt: NDArray[float64],
triangles_tgt: NDArray[int64],
s_tgt: NDArray[float64],
wire_radius: float | NDArray[float64] = 0.0,
par: bool = True,
quad: str = "dunavant3",
) -> tuple[
NDArray[float64], NDArray[float64], NDArray[float64]
]
Assemble the frozen-target source-current to target-triangle force mapping from linear filaments.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xyzfil
|
Array3xN
|
[m] x,y,z filament start coordinates |
required |
dlxyzfil
|
Array3xN
|
[m] x,y,z filament segment deltas |
required |
nodes_tgt
|
NDArray[float64]
|
[m] target mesh node coordinates with shape |
required |
triangles_tgt
|
NDArray[int64]
|
target node indices with shape |
required |
s_tgt
|
NDArray[float64]
|
[A] fixed target nodal current-potential values with shape |
required |
wire_radius
|
float | NDArray[float64]
|
[m] filament radius, scalar or array of length |
0.0
|
par
|
bool
|
Whether to use CPU parallelism |
True
|
quad
|
str
|
Triangle quadrature rule, one of |
'dunavant3'
|
Returns:
| Type | Description |
|---|---|
tuple[NDArray[float64], NDArray[float64], NDArray[float64]]
|
[N/A] |
Source code in cfsem/bindings.py
cfsem.triangle_mesh_force_mapping_from_circular_filaments ¶
triangle_mesh_force_mapping_from_circular_filaments(
rfil: NDArray[float64],
zfil: NDArray[float64],
nodes_tgt: NDArray[float64],
triangles_tgt: NDArray[int64],
s_tgt: NDArray[float64],
par: bool = True,
quad: str = "dunavant3",
) -> tuple[
NDArray[float64], NDArray[float64], NDArray[float64]
]
Assemble the frozen-target source-current to target-triangle force mapping from circular filaments.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rfil
|
NDArray[float64]
|
[m] circular filament radii |
required |
zfil
|
NDArray[float64]
|
[m] circular filament axial coordinates |
required |
nodes_tgt
|
NDArray[float64]
|
[m] target mesh node coordinates with shape |
required |
triangles_tgt
|
NDArray[int64]
|
target node indices with shape |
required |
s_tgt
|
NDArray[float64]
|
[A] fixed target nodal current-potential values with shape |
required |
par
|
bool
|
Whether to use CPU parallelism |
True
|
quad
|
str
|
Triangle quadrature rule, one of |
'dunavant3'
|
Returns:
| Type | Description |
|---|---|
tuple[NDArray[float64], NDArray[float64], NDArray[float64]]
|
[N/A] |
Source code in cfsem/bindings.py
cfsem.triangle_mesh_force_mapping_from_dipoles ¶
triangle_mesh_force_mapping_from_dipoles(
loc: Array3xN,
moment_dir: Array3xN,
nodes_tgt: NDArray[float64],
triangles_tgt: NDArray[int64],
s_tgt: NDArray[float64],
par: bool = True,
outer_radius: NDArray[float64] | None = None,
quad: str = "dunavant3",
) -> tuple[
NDArray[float64], NDArray[float64], NDArray[float64]
]
Assemble the frozen-target source-amplitude to target-triangle force mapping from dipoles.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
loc
|
Array3xN
|
[m] x,y,z dipole locations |
required |
moment_dir
|
Array3xN
|
dipole moment direction vectors, linear in scalar source amplitudes |
required |
nodes_tgt
|
NDArray[float64]
|
[m] target mesh node coordinates with shape |
required |
triangles_tgt
|
NDArray[int64]
|
target node indices with shape |
required |
s_tgt
|
NDArray[float64]
|
[A] fixed target nodal current-potential values with shape |
required |
par
|
bool
|
Whether to use CPU parallelism |
True
|
outer_radius
|
NDArray[float64] | None
|
[m] radius inside which to defer to magnetized sphere calc. Defaults to zeroes. |
None
|
quad
|
str
|
Triangle quadrature rule, one of |
'dunavant3'
|
Returns:
| Type | Description |
|---|---|
tuple[NDArray[float64], NDArray[float64], NDArray[float64]]
|
[N/source_amplitude] |