Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
5fc5151
add volume
OrtnerMichael Jul 21, 2025
d6c31ae
add tests
OrtnerMichael Jul 21, 2025
4d1b491
rename testfile
OrtnerMichael Jul 21, 2025
8379d7d
lint
OrtnerMichael Jul 21, 2025
4ee67c5
pylint
OrtnerMichael Jul 21, 2025
64f1a35
nox
OrtnerMichael Jul 21, 2025
4a6a042
add to changelog
OrtnerMichael Jul 21, 2025
8832ba7
style: pre-commit fixes
pre-commit-ci[bot] Jul 21, 2025
ef88616
implement in baseGeo
OrtnerMichael Jul 23, 2025
8795381
pylint
OrtnerMichael Jul 23, 2025
c9395a1
centroid implementation
OrtnerMichael Jul 23, 2025
efe6d35
add tests
OrtnerMichael Jul 23, 2025
8e71c57
fixed tests
OrtnerMichael Jul 23, 2025
50cf95e
nox lint
OrtnerMichael Jul 23, 2025
3db904e
pylint
OrtnerMichael Jul 23, 2025
299098b
style: pre-commit fixes
pre-commit-ci[bot] Jul 23, 2025
c4e7d81
centroid to changelog
OrtnerMichael Jul 23, 2025
c094ad3
Merge branch 'volume' of https://github.com/magpylib/magpylib into vo…
OrtnerMichael Jul 23, 2025
4e7ddef
first step
OrtnerMichael Jul 24, 2025
46d7e79
WIP
OrtnerMichael Jul 25, 2025
3d1fefd
FT working first time
OrtnerMichael Jul 28, 2025
971c348
working even better now
OrtnerMichael Jul 28, 2025
52f50e5
magnet force looking good
OrtnerMichael Jul 29, 2025
2cd913c
first working current codes
OrtnerMichael Jul 29, 2025
41e2d31
adding dipole
OrtnerMichael Jul 30, 2025
0cd2f08
dipole fix
OrtnerMichael Jul 30, 2025
0ab619d
add sphere
OrtnerMichael Jul 30, 2025
0d1a617
computation proofed by tests
OrtnerMichael Jul 30, 2025
7a13b2e
remove print
OrtnerMichael Jul 30, 2025
dca5830
temp broadcasting solution
OrtnerMichael Jul 31, 2025
2e880dd
cylinder segment force
OrtnerMichael Jul 31, 2025
c298669
sphere fix, add tetra, HCP mesh (not very good)
OrtnerMichael Jul 31, 2025
38b3d9d
HCP mesh + tetra
OrtnerMichael Jul 31, 2025
c6e382a
fixing tetra meshing issues
OrtnerMichael Jul 31, 2025
94c655d
adding trimesh :)
OrtnerMichael Jul 31, 2025
8dc8f9b
improve and complete meshings and tests
OrtnerMichael Jul 31, 2025
328610c
Collection now works as target
OrtnerMichael Aug 1, 2025
54515c5
meshing and checking workflow
OrtnerMichael Aug 1, 2025
898978c
fixing meshing docstrings
OrtnerMichael Aug 1, 2025
eaf6d69
add meshreport to getFT
OrtnerMichael Aug 1, 2025
856b469
improve meshing
OrtnerMichael Aug 2, 2025
96a2381
temp tests
OrtnerMichael Aug 2, 2025
b66804a
tests + Polyline fix
OrtnerMichael Aug 2, 2025
1faf3f6
wip
OrtnerMichael Aug 3, 2025
826289d
Merge branch 'main' of https://github.com/magpylib/magpylib into forc…
OrtnerMichael Aug 3, 2025
6eab063
add _centroid, fix tests
OrtnerMichael Aug 3, 2025
99204fb
wip
OrtnerMichael Aug 3, 2025
becee71
WIP ;|
OrtnerMichael Aug 9, 2025
e120d5f
first working path WIP
OrtnerMichael Aug 9, 2025
f329faa
WIP
OrtnerMichael Aug 10, 2025
87432f7
improve getFT flow
OrtnerMichael Aug 11, 2025
7f49d2b
WIP path tests, flow improve
OrtnerMichael Aug 11, 2025
49726bf
WIP reshapeing
OrtnerMichael Aug 11, 2025
2cc2cdd
wip advanced indexing
OrtnerMichael Aug 11, 2025
c89a0c2
WIP imprve getFT flow
OrtnerMichael Aug 11, 2025
c3a06ab
WIP nightmare :(
OrtnerMichael Aug 12, 2025
460c7a3
WIP F***
OrtnerMichael Aug 13, 2025
bdeec20
WIP fail#3
OrtnerMichael Aug 14, 2025
49b0999
WIP omg its working
OrtnerMichael Aug 14, 2025
1c3ee44
WIP getFT with path FINALLY SEEMS TO WORK ;););)
OrtnerMichael Aug 16, 2025
ef1cbcb
improve tests - improve workflow - looking good
OrtnerMichael Aug 16, 2025
9f435e7
tests
OrtnerMichael Aug 17, 2025
32dd0b9
tests
OrtnerMichael Aug 17, 2025
c22b9b1
bringing sphere back
OrtnerMichael Aug 17, 2025
91a966b
cuboid online
OrtnerMichael Aug 17, 2025
98b746b
brining more tests back online
OrtnerMichael Aug 17, 2025
a53ad29
cylinder online
OrtnerMichael Aug 17, 2025
ca65693
CylinderSegment online
OrtnerMichael Aug 17, 2025
3449070
reintroduce tests
OrtnerMichael Aug 18, 2025
b5d1ac2
tetrahedron online
OrtnerMichael Aug 18, 2025
4e26f2d
reintro TriMesh
OrtnerMichael Aug 18, 2025
e6ae59b
add meshing=1 tests, massive sphere improvement
OrtnerMichael Aug 18, 2025
61cb3c0
complete testing
OrtnerMichael Aug 18, 2025
1a2d1d5
improve pivot workflow
OrtnerMichael Aug 18, 2025
b3bcd48
moving tests to test dir
OrtnerMichael Aug 19, 2025
cbe5f2f
clean up and fix tests
OrtnerMichael Aug 19, 2025
13907f6
clean up field_FT
OrtnerMichael Aug 19, 2025
e98a787
review BaseTarget
OrtnerMichael Aug 19, 2025
991ad30
doc strings
OrtnerMichael Aug 19, 2025
7e5e503
nox tests, nox lint
OrtnerMichael Aug 20, 2025
b1bde0e
nox it
OrtnerMichael Aug 20, 2025
3da1b86
docstring error
OrtnerMichael Aug 20, 2025
832cecc
terminology
OrtnerMichael Aug 20, 2025
67917e6
Merge branch 'main' of https://github.com/magpylib/magpylib into forc…
OrtnerMichael Aug 20, 2025
2700f52
WIP
OrtnerMichael Aug 21, 2025
7f7d212
bugfix meshing validation
OrtnerMichael Aug 21, 2025
698c0a0
WIP
OrtnerMichael Aug 21, 2025
e757177
fix sheet strip centroids
OrtnerMichael Aug 21, 2025
f7a0c52
trisheet force working
OrtnerMichael Aug 21, 2025
910eca5
object docstrings
OrtnerMichael Aug 21, 2025
815fc56
triangle strip now working
OrtnerMichael Aug 22, 2025
ca245e9
style: pre-commit fixes
pre-commit-ci[bot] Aug 22, 2025
ba4b237
style: pre-commit fixes
pre-commit-ci[bot] Aug 23, 2025
905bbe9
major broadcasting bug fixed :0
OrtnerMichael Aug 23, 2025
07cfa81
style: pre-commit fixes
pre-commit-ci[bot] Aug 24, 2025
3e79886
add bug tests, add trisheet tests
OrtnerMichael Aug 24, 2025
837aab3
Merge branch 'force_integration' of https://github.com/magpylib/magpy…
OrtnerMichael Aug 24, 2025
3c0b4e9
nox
OrtnerMichael Aug 24, 2025
bf331ea
Merge branch 'force_integration' of https://github.com/magpylib/magpy…
OrtnerMichael Aug 24, 2025
6ded500
improve getFT, remove current
OrtnerMichael Aug 25, 2025
fcd0417
review improve tests
OrtnerMichael Aug 25, 2025
d884ff2
nox
OrtnerMichael Aug 25, 2025
0a39489
fix macos test
OrtnerMichael Aug 25, 2025
019beb0
add returnmesh parameter
OrtnerMichael Aug 27, 2025
c41eb95
docs update with force ++
OrtnerMichael Sep 5, 2025
0d4fba2
nox lint
OrtnerMichael Sep 5, 2025
0e3129a
nox nox
OrtnerMichael Sep 5, 2025
46720be
changelog
OrtnerMichael Sep 5, 2025
c484347
style: pre-commit fixes
pre-commit-ci[bot] Sep 5, 2025
fb1fc4f
admonition on front page
OrtnerMichael Sep 5, 2025
fd96386
docs review titles, -----, physics & comp,
OrtnerMichael Sep 7, 2025
dff8192
changelog
OrtnerMichael Sep 7, 2025
34e626f
fixing some figures
OrtnerMichael Sep 7, 2025
92e092f
review example magnet colors
OrtnerMichael Sep 7, 2025
5b15d49
review examples_vis_animations
OrtnerMichael Sep 7, 2025
b7be3a4
nox fix
OrtnerMichael Sep 7, 2025
7c969fe
adding dipole_moment property
OrtnerMichael Sep 10, 2025
934c1ff
changelog
OrtnerMichael Sep 10, 2025
6afbebe
style: pre-commit fixes
pre-commit-ci[bot] Sep 10, 2025
519b8c8
separate volume, apply only to relevant classes
OrtnerMichael Sep 10, 2025
029c73f
Merge branch 'force_integration' of https://github.com/magpylib/magpy…
OrtnerMichael Sep 10, 2025
d1d8645
style: pre-commit fixes
pre-commit-ci[bot] Sep 10, 2025
9c152b5
separate dipole moment property, extend only to sensible classes
OrtnerMichael Sep 10, 2025
8983f5c
Merge branch 'force_integration' of https://github.com/magpylib/magpy…
OrtnerMichael Sep 10, 2025
ad797c5
nox fixes
OrtnerMichael Sep 10, 2025
9cecf1e
Scipy/Numpy Docstyle
OrtnerMichael Sep 10, 2025
f216950
Merge branch 'main' of https://github.com/magpylib/magpylib into forc…
Alexboiboi Sep 19, 2025
9ad4b06
Remove unnecessary dependency 'magpylib-force' from docs requirements
Alexboiboi Sep 19, 2025
4714825
linting: update test_force.py to ignore torque values in force tests
Alexboiboi Sep 19, 2025
fef8e38
docs: add image alt text for WIP
Alexboiboi Sep 19, 2025
b282888
docs: standardize parameter naming from `returnmesh` to `return_mesh`…
Alexboiboi Sep 19, 2025
58dce50
Merge branch 'main' of https://github.com/magpylib/magpylib into forc…
OrtnerMichael Sep 24, 2025
de95d18
style: pre-commit fixes
pre-commit-ci[bot] Sep 24, 2025
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
Prev Previous commit
Next Next commit
computation proofed by tests
  • Loading branch information
OrtnerMichael committed Jul 30, 2025
commit 0d1a6173711c26139254afb4af2046511a54df3a
3 changes: 2 additions & 1 deletion src/magpylib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from magpylib._src.defaults.defaults_classes import default_settings as defaults
from magpylib._src.defaults.defaults_utility import SUPPORTED_PLOTTING_BACKENDS
from magpylib._src.display.display import show, show_context
from magpylib._src.fields import getB, getH, getJ, getM
from magpylib._src.fields import getB, getH, getJ, getM, getFT
from magpylib._src.obj_classes.class_Collection import Collection
from magpylib._src.obj_classes.class_Sensor import Sensor

Expand All @@ -28,6 +28,7 @@
"getH",
"getJ",
"getM",
"getFT",
"graphics",
"magnet",
"misc",
Expand Down
3 changes: 2 additions & 1 deletion src/magpylib/_src/fields/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""_src.fields"""

__all__ = ["getB", "getH", "getJ", "getM"]
__all__ = ["getB", "getH", "getJ", "getM", "getFT"]

# create interface to outside of package
from magpylib._src.fields.field_wrap_BH import getB, getH, getJ, getM
from magpylib._src.fields.field_FT import getFT
6 changes: 3 additions & 3 deletions src/magpylib/_src/fields/field_FT.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,12 +275,12 @@ def getFT(sources, targets, pivot="centroid", eps=1e-5, squeeze=True):

force = np.einsum('ijk,ik->ij', DB, MOM) # numpy only
#force = np.sum(DB * MOM[:, np.newaxis, :], axis=2) # array API
torque = np.cross(B, MOM)
torque = np.cross(MOM, B)

# Add pivot point contribution to torque
if pivot is not None:
PIV = np.tile(np.repeat(pivot[mask_magnet], mesh_sizes_mag, axis=0), (n_sources, 1))
torque -= np.cross(POS - PIV, force)
torque += np.cross(POS - PIV, force)

# Sum over mesh cells
idx_starts_all = np.concatenate([idx_starts + n_mesh_mag*j for j in range(n_sources)])
Expand Down Expand Up @@ -330,7 +330,7 @@ def getFT(sources, targets, pivot="centroid", eps=1e-5, squeeze=True):
# Add pivot point contribution to torque
if pivot is not None:
PIV = np.tile(np.repeat(pivot[mask_current], mesh_sizes_cur, axis=0), (n_sources, 1))
torque -= np.cross(POS - PIV, force)
torque += np.cross(POS - PIV, force)

# Sum over mesh cells
idx_starts_all = np.concatenate([idx_starts + n_mesh_cur*j for j in range(n_sources)])
Expand Down