emerge 0.6.10__py3-none-any.whl → 0.6.11__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of emerge might be problematic. Click here for more details.

emerge/__init__.py CHANGED
@@ -18,7 +18,7 @@ along with this program; if not, see
18
18
  """
19
19
  import os
20
20
 
21
- __version__ = "0.6.10"
21
+ __version__ = "0.6.11"
22
22
 
23
23
  ############################################################
24
24
  # HANDLE ENVIRONMENT VARIABLES #
emerge/_emerge/bc.py CHANGED
@@ -53,7 +53,7 @@ class BoundaryCondition:
53
53
 
54
54
 
55
55
  if isinstance(assignment, GeoObject):
56
- assignment = assignment.select
56
+ assignment = assignment.selection
57
57
 
58
58
  self.selection: Selection = assignment
59
59
  self.tags: list[int] = self.selection.tags
@@ -250,7 +250,7 @@ class GeoObject:
250
250
  return self.material._metal
251
251
 
252
252
  @property
253
- def select(self) -> Selection:
253
+ def selection(self) -> Selection:
254
254
  '''Returns a corresponding Face/Domain or Edge Selection object'''
255
255
  if self.dim==1:
256
256
  return EdgeSelection(self.tags)
@@ -517,14 +517,14 @@ class GeoVolume(GeoObject):
517
517
  self.tags = [tag,]
518
518
 
519
519
  @property
520
- def select(self) -> DomainSelection:
520
+ def selection(self) -> DomainSelection:
521
521
  return DomainSelection(self.tags)
522
522
 
523
523
  class GeoPoint(GeoObject):
524
524
  dim = 0
525
525
 
526
526
  @property
527
- def select(self) -> PointSelection:
527
+ def selection(self) -> PointSelection:
528
528
  return PointSelection(self.tags)
529
529
 
530
530
  def __init__(self, tag: int | list[int]):
@@ -540,7 +540,7 @@ class GeoEdge(GeoObject):
540
540
  dim = 1
541
541
 
542
542
  @property
543
- def select(self) -> EdgeSelection:
543
+ def selection(self) -> EdgeSelection:
544
544
  return EdgeSelection(self.tags)
545
545
 
546
546
  def __init__(self, tag: int | list[int]):
@@ -558,7 +558,7 @@ class GeoSurface(GeoObject):
558
558
  dim = 2
559
559
 
560
560
  @property
561
- def select(self) -> FaceSelection:
561
+ def selection(self) -> FaceSelection:
562
562
  return FaceSelection(self.tags)
563
563
 
564
564
  def __init__(self, tag: int | list[int]):
@@ -311,22 +311,25 @@ class Microwave3D:
311
311
 
312
312
  if points.size==0:
313
313
  raise SimulationError(f'The lumped port {port} has no nodes associated with it')
314
+
314
315
  xs = self.mesh.nodes[0,points]
315
316
  ys = self.mesh.nodes[1,points]
316
317
  zs = self.mesh.nodes[2,points]
317
318
 
318
319
  dotprod = xs*field_axis[0] + ys*field_axis[1] + zs*field_axis[2]
319
320
 
320
- start_id = points[np.argwhere(dotprod == np.min(dotprod))]
321
+ start_id = np.argwhere(dotprod == np.min(dotprod)).flatten()
322
+
323
+ xs = xs[start_id]
324
+ ys = ys[start_id]
325
+ zs = zs[start_id]
321
326
 
322
- start = _pick_central(self.mesh.nodes[:,start_id.flatten()])
323
- logger.info(f'Starting node = {_dimstring(start)}')
324
- end = start + port.Vdirection.np*port.height
325
-
326
-
327
- port.vintline = Line.from_points(start, end, 21)
328
327
 
329
- logger.info(f'Ending node = {_dimstring(end)}')
328
+ for x,y,z in zip(xs, ys, zs):
329
+ start = np.array([x,y,z])
330
+ end = start + port.Vdirection.np*port.height
331
+ port.vintline.append(Line.from_points(start, end, 21))
332
+ logger.trace(f'Port[{port.port_number}] integration line {start} -> {end}.')
330
333
 
331
334
  port.v_integration = True
332
335
 
@@ -1003,7 +1006,8 @@ class Microwave3D:
1003
1006
  if bc.Z0 is None:
1004
1007
  raise SimulationError('Trying to compute the impedance of a boundary condition with no characteristic impedance.')
1005
1008
 
1006
- V = bc.vintline.line_integral(fieldfunction)
1009
+ Voltages = [line.line_integral(fieldfunction) for line in bc.vintline]
1010
+ V = sum(Voltages)/len(Voltages)
1007
1011
 
1008
1012
  if bc.active:
1009
1013
  if bc.voltage is None:
@@ -834,7 +834,7 @@ class LumpedPort(PortBC):
834
834
  # logger.info('Constructing coordinate system from normal port')
835
835
  # self.cs = Axis(self.selection.normal).construct_cs() # type: ignore
836
836
  self.cs = GCS
837
- self.vintline: Line | None = None
837
+ self.vintline: list[Line] = []
838
838
  self.v_integration = True
839
839
 
840
840
  @property
@@ -145,7 +145,7 @@ def _norm(x, y, z):
145
145
 
146
146
  def _select(obj: GeoObject | Selection) -> Selection:
147
147
  if isinstance(obj, GeoObject):
148
- return obj.select
148
+ return obj.selection
149
149
  return obj
150
150
 
151
151
  def _merge(lst: list[GeoObject | Selection]) -> Selection:
@@ -186,7 +186,7 @@ def _norm(x, y, z):
186
186
 
187
187
  def _select(obj: GeoObject | Selection) -> Selection:
188
188
  if isinstance(obj, GeoObject):
189
- return obj.select
189
+ return obj.selection
190
190
  return obj
191
191
 
192
192
  def _merge(lst: Iterable[GeoObject | Selection]) -> Selection:
@@ -523,18 +523,19 @@ class PVDisplay(BaseDisplay):
523
523
  d = _min_distance(xf, yf, zf)
524
524
 
525
525
  if port.vintline is not None:
526
- xs, ys, zs = port.vintline.cpoint
527
- p_line = pv.Line(
528
- pointa=(xs[0], ys[0], zs[0]),
529
- pointb=(xs[-1], ys[-1], zs[-1]),
530
- )
531
- self._plot.add_mesh(
532
- p_line,
533
- color='red',
534
- pickable=False,
535
- line_width=3.0,
536
- )
537
-
526
+ for line in port.vintline:
527
+ xs, ys, zs = line.cpoint
528
+ p_line = pv.Line(
529
+ pointa=(xs[0], ys[0], zs[0]),
530
+ pointb=(xs[-1], ys[-1], zs[-1]),
531
+ )
532
+ self._plot.add_mesh(
533
+ p_line,
534
+ color='red',
535
+ pickable=False,
536
+ line_width=3.0,
537
+ )
538
+
538
539
  if k0 is None:
539
540
  if isinstance(port, ModalPort):
540
541
  k0 = port.get_mode(0).k0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: emerge
3
- Version: 0.6.10
3
+ Version: 0.6.11
4
4
  Summary: An open source EM FEM simulator in Python
5
5
  Project-URL: Homepage, https://github.com/FennisRobert/EMerge
6
6
  Project-URL: Issues, https://github.com/FennisRobert/EMerge/issues
@@ -1,4 +1,4 @@
1
- emerge/__init__.py,sha256=8FrSyF_ro5TDOwMM76VyItYnpfiK_LOumuCAugk2DiI,2977
1
+ emerge/__init__.py,sha256=8X7w9dvw71aPyXHg5rkdSRVqMzoRNMpw9L1SVhf7tlo,2977
2
2
  emerge/__main__.py,sha256=WVf16sfrOI910QWohrQDaChZdRifMNoS6VKzCT6f3ZA,92
3
3
  emerge/cli.py,sha256=NU1uhwuZ6i50680v3_I4kDZPTHqz74gOYK71UBhb8oE,666
4
4
  emerge/ext.py,sha256=IBoHH5PQFj5pYMfp6r-uMpNNgbSe8c0g9x8qjBzzVmU,223
@@ -7,13 +7,13 @@ emerge/plot.py,sha256=AH2D9rKeWUXlSOlh-pUUfLt0oxVLcqF_piki-BmPEg0,83
7
7
  emerge/pyvista.py,sha256=-Ht2YcZYsh8-dici5ZPNAWwsis6uz5wNj8n8mxv5fog,42
8
8
  emerge/_emerge/__init__.py,sha256=aidfiILy33dt3VyiZ2mgtA87mq-WQ5pXItZUE5wR5ws,703
9
9
  emerge/_emerge/_cache_check.py,sha256=_m9rV-VcaC4uNfETZ2Rp1tkA-gZ5FD3xL3KOHlgdvyA,1547
10
- emerge/_emerge/bc.py,sha256=TeSVNkDgOGaoHw5raTzhUV0ngtyHa33sXAoL2hRn70M,8077
10
+ emerge/_emerge/bc.py,sha256=-fIfUwi1lIZADEbQ2wRJjrEmCVJQdRSOVYM_mzmZRdY,8080
11
11
  emerge/_emerge/const.py,sha256=PTZZTSDOP5NsZ8XnJrKTY2P0tPUhmutBJ1yrm-t7xsI,129
12
12
  emerge/_emerge/coord.py,sha256=BKvyrcnHY-_bgHqysnByy5k9_DK4VVfr9KKkRaawG2E,4371
13
13
  emerge/_emerge/cs.py,sha256=gULfov6s0jODOdQkH6NmGBbG5wvny1-bJU8fdAlpCHo,19730
14
14
  emerge/_emerge/dataset.py,sha256=UcSAJ_siLrOjNBBWRWsS3GUZUpayp63EM6pP6ClwKDI,1534
15
15
  emerge/_emerge/geo2d.py,sha256=e_HkX1GQ2iYrdO0zeEgzVOzfGyU1WGJyjeGBAobOttE,3323
16
- emerge/_emerge/geometry.py,sha256=OcQ0wvritkg7Q8oihQI_hLjDGx7JkFaPwfEeJ3_u3Bs,19987
16
+ emerge/_emerge/geometry.py,sha256=mBe6BALh5XTwhs93SYLJOww3-wr9qBR35VwOLRYdElM,20002
17
17
  emerge/_emerge/howto.py,sha256=c4UxUNpA1tygr3OoR-LH-h0UZv-Tf9K8tpCiAU18BKE,8173
18
18
  emerge/_emerge/logsettings.py,sha256=s8UboFEtB0aIuLB2FSL2WIbw0_kB363iHNIy4uGQi7w,3711
19
19
  emerge/_emerge/material.py,sha256=bVuMyrmts08at4nUc4ttgYHPsY1cLYNKNmJ4RwgR9TY,15462
@@ -50,8 +50,8 @@ emerge/_emerge/mth/pairing.py,sha256=i8bBvTeMmzgF0JdiDNJiTXxx913x4f10777pzD6FJo0
50
50
  emerge/_emerge/physics/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
51
51
  emerge/_emerge/physics/microwave/__init__.py,sha256=QHeILGYWmvbfLl1o9wrTiWLm0evfXDgS0JiikUoMTts,28
52
52
  emerge/_emerge/physics/microwave/adaptive_freq.py,sha256=aWhijhCVAbnuwkru-I1AaRdY20uyozf6OWRIh9r2ijg,9786
53
- emerge/_emerge/physics/microwave/microwave_3d.py,sha256=ocyLCLt6iZ2FlmqLvNCqxSDKdFRirUFRQYGNi8xgyRk,42367
54
- emerge/_emerge/physics/microwave/microwave_bc.py,sha256=YaEkSyOsC9Di7-JItijuRKD60ZA9CmEX8Tu8pViMN90,42114
53
+ emerge/_emerge/physics/microwave/microwave_3d.py,sha256=OHbqEk2ODuKnq0Gc5Fp8STFYinw0bPPJkgie8a9BK0Q,42527
54
+ emerge/_emerge/physics/microwave/microwave_bc.py,sha256=EVIWkDgJSwKCfhkFKAYOjI8o0RjeX3fudmyrjU3h4N8,42111
55
55
  emerge/_emerge/physics/microwave/microwave_data.py,sha256=njeNfw_Is4bc97H-hefi-Bk8NSGMElXk0yzDb4v6mVk,50365
56
56
  emerge/_emerge/physics/microwave/periodic.py,sha256=wYSUgLFVtCLqSG3EDKoCDRU93iPUzBdXzVRdHTRmbpI,3000
57
57
  emerge/_emerge/physics/microwave/port_functions.py,sha256=aVU__AkVk8b1kH2J_oDLF5iNReCxC9nzCtesFSSSSQo,2112
@@ -68,9 +68,9 @@ emerge/_emerge/physics/microwave/assembly/robinbc.py,sha256=syJ-NuHHA0WDQECuaPde
68
68
  emerge/_emerge/plot/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
69
69
  emerge/_emerge/plot/display.py,sha256=TQLlKb-LkaG5ZOSLfxp9KXPlZPRFTxNj1LhVQ-Lp1-s,18476
70
70
  emerge/_emerge/plot/simple_plots.py,sha256=lzAyLpY4yaAgMBgNkpeIxdrdSp5nQH6JmBI_ZfjzuhY,25229
71
- emerge/_emerge/plot/matplotlib/mpldisplay.py,sha256=szKafDrgdAW5Nyc5UOHuJC87n0WGkXYackOVv182TDQ,8671
71
+ emerge/_emerge/plot/matplotlib/mpldisplay.py,sha256=e8V6EhGdCW7nRkSFvjHCcRO5uR-FcD0yHQ1nxPQCbp4,8674
72
72
  emerge/_emerge/plot/pyvista/__init__.py,sha256=CPclatEu6mFnJZzCQk09g6T6Fh20WTbiLAJGSwAnPXU,30
73
- emerge/_emerge/plot/pyvista/display.py,sha256=Y8BT3ML9eeSQw_HLDmi3KCe0xtA8qOahOnCPGgvnM2g,38354
73
+ emerge/_emerge/plot/pyvista/display.py,sha256=vZ7W_FcP1pfENManxUbXxeDSqGYNcqr5qkLv00SQCS4,38435
74
74
  emerge/_emerge/plot/pyvista/display_settings.py,sha256=k4JfiNuaVDpPZrZa0sIuuFFwLvYAWDS17tusUCVHNu0,1036
75
75
  emerge/_emerge/projects/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
76
76
  emerge/_emerge/projects/_gen_base.txt,sha256=DqQz36PZg6v1ovQjHvPjd0t4AIbmikZdb9dmrNYsK3w,598
@@ -78,8 +78,8 @@ emerge/_emerge/projects/_load_base.txt,sha256=bHsZ4okxa9uu8qP4UOxSAeIQzuwpRtN0i7
78
78
  emerge/_emerge/projects/generate_project.py,sha256=TNw-0SpLc82MBq0bd9hB_yqvBZCgmuPonCBsHTp91uk,1450
79
79
  emerge/_emerge/solve_interfaces/cudss_interface.py,sha256=Iszyy7RuuCa_FgfROEyTSSWbmR2LzMUkEcR8klzIKOQ,9915
80
80
  emerge/_emerge/solve_interfaces/pardiso_interface.py,sha256=iVFxToMmIzhj3hcAP-O_MDHKz82ePFIHY1us11kzUBU,15305
81
- emerge-0.6.10.dist-info/METADATA,sha256=tmedxST_2MpgTZXZK7GGc0RMNt_9DjEMKlJjw6IFh0g,3339
82
- emerge-0.6.10.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
83
- emerge-0.6.10.dist-info/entry_points.txt,sha256=8rFvAXticpKg4OTC8JEvAksnduW72KIEskCGG9XnFf8,43
84
- emerge-0.6.10.dist-info/licenses/LICENSE,sha256=VOCXWddrjMN5j7TvnSAOh1Dx7jkugdwq9Lqhycf5inc,17852
85
- emerge-0.6.10.dist-info/RECORD,,
81
+ emerge-0.6.11.dist-info/METADATA,sha256=ZyqP0SMK6dLJX8-UmEr9GDujZhGchs0Nsrg0crwKe18,3339
82
+ emerge-0.6.11.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
83
+ emerge-0.6.11.dist-info/entry_points.txt,sha256=8rFvAXticpKg4OTC8JEvAksnduW72KIEskCGG9XnFf8,43
84
+ emerge-0.6.11.dist-info/licenses/LICENSE,sha256=VOCXWddrjMN5j7TvnSAOh1Dx7jkugdwq9Lqhycf5inc,17852
85
+ emerge-0.6.11.dist-info/RECORD,,