CylinderSegment speed #581
-
Using the CylinderSegment shape with not full circle section angles I have noticed a significant drop in computational speed and increase in RAM consumption when evaluating the B field (compared to when full circle is evaluated). Is that normal/expected? In the example below the magnet_Full is a full torus (phi1=0, phi2=360) and magnet_Segment is the same except it is just a section (phi1=15, phi2=75):
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi @martinusus In the case of the full cylinder the computation makes use of the core function The main reason behind this is, that the segement field relies on the incomplete elliptic integrals, while the full cylinder field makes use only of complete elliptics or cel functions, which are much faster to compute. While we plan to have a closer look on the cylinder segment computation in terms of performance this will take quite a while. You could also try to make use of the upcoming I hope this helps ! sincerely, |
Beta Was this translation helpful? Give feedback.
Hi @martinusus
In the case of the full cylinder the computation makes use of the core function
magpy.core.magnet_cylinder_field()
and uses a cut-out operation as described here. We are doing this because, as you have noticed, the full-cylinder computation is much faster (~1-5 us) than the actual cylinder segment computationmagpy.core.magnet_cylinder_segment_field()
which takes ~ 50-100 us.The main reason behind this is, that the segement field relies on the incomplete elliptic integrals, while the full cylinder field makes use only of complete elliptics or cel functions, which are much faster to compute.
While we plan to have a closer look on the cylinder segment computation in terms of…