capytaine 2.3.1__cp38-cp38-win_amd64.whl → 3.0.0a1__cp38-cp38-win_amd64.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.
Files changed (89) hide show
  1. capytaine/__about__.py +7 -2
  2. capytaine/__init__.py +10 -14
  3. capytaine/bem/engines.py +234 -354
  4. capytaine/bem/problems_and_results.py +14 -13
  5. capytaine/bem/solver.py +204 -80
  6. capytaine/bodies/bodies.py +278 -869
  7. capytaine/bodies/dofs.py +136 -9
  8. capytaine/bodies/hydrostatics.py +540 -0
  9. capytaine/bodies/multibodies.py +216 -0
  10. capytaine/green_functions/{libs/Delhommeau_float32.cp38-win_amd64.dll.a → Delhommeau_float32.cp38-win_amd64.dll.a} +0 -0
  11. capytaine/green_functions/Delhommeau_float32.cp38-win_amd64.pyd +0 -0
  12. capytaine/green_functions/{libs/Delhommeau_float64.cp38-win_amd64.dll.a → Delhommeau_float64.cp38-win_amd64.dll.a} +0 -0
  13. capytaine/green_functions/Delhommeau_float64.cp38-win_amd64.pyd +0 -0
  14. capytaine/green_functions/abstract_green_function.py +2 -2
  15. capytaine/green_functions/delhommeau.py +31 -16
  16. capytaine/green_functions/hams.py +19 -13
  17. capytaine/io/legacy.py +3 -103
  18. capytaine/io/xarray.py +11 -6
  19. capytaine/meshes/__init__.py +2 -6
  20. capytaine/meshes/abstract_meshes.py +375 -0
  21. capytaine/meshes/clean.py +302 -0
  22. capytaine/meshes/clip.py +347 -0
  23. capytaine/meshes/export.py +89 -0
  24. capytaine/meshes/geometry.py +244 -394
  25. capytaine/meshes/io.py +433 -0
  26. capytaine/meshes/meshes.py +617 -681
  27. capytaine/meshes/predefined/cylinders.py +22 -56
  28. capytaine/meshes/predefined/rectangles.py +26 -85
  29. capytaine/meshes/predefined/spheres.py +4 -11
  30. capytaine/meshes/quality.py +118 -407
  31. capytaine/meshes/surface_integrals.py +48 -29
  32. capytaine/meshes/symmetric_meshes.py +641 -0
  33. capytaine/meshes/visualization.py +353 -0
  34. capytaine/post_pro/free_surfaces.py +1 -4
  35. capytaine/post_pro/kochin.py +10 -10
  36. capytaine/tools/block_circulant_matrices.py +275 -0
  37. capytaine/tools/lists_of_points.py +2 -2
  38. capytaine/tools/memory_monitor.py +45 -0
  39. capytaine/tools/symbolic_multiplication.py +13 -1
  40. capytaine/tools/timer.py +58 -34
  41. capytaine-3.0.0a1.dist-info/DELVEWHEEL +2 -0
  42. {capytaine-2.3.1.dist-info → capytaine-3.0.0a1.dist-info}/METADATA +7 -2
  43. capytaine-3.0.0a1.dist-info/RECORD +71 -0
  44. capytaine/bodies/predefined/__init__.py +0 -6
  45. capytaine/bodies/predefined/cylinders.py +0 -151
  46. capytaine/bodies/predefined/rectangles.py +0 -111
  47. capytaine/bodies/predefined/spheres.py +0 -70
  48. capytaine/green_functions/FinGreen3D/.gitignore +0 -1
  49. capytaine/green_functions/FinGreen3D/FinGreen3D.f90 +0 -3589
  50. capytaine/green_functions/FinGreen3D/LICENSE +0 -165
  51. capytaine/green_functions/FinGreen3D/Makefile +0 -16
  52. capytaine/green_functions/FinGreen3D/README.md +0 -24
  53. capytaine/green_functions/FinGreen3D/test_program.f90 +0 -39
  54. capytaine/green_functions/LiangWuNoblesse/.gitignore +0 -1
  55. capytaine/green_functions/LiangWuNoblesse/LICENSE +0 -504
  56. capytaine/green_functions/LiangWuNoblesse/LiangWuNoblesseWaveTerm.f90 +0 -751
  57. capytaine/green_functions/LiangWuNoblesse/Makefile +0 -16
  58. capytaine/green_functions/LiangWuNoblesse/README.md +0 -2
  59. capytaine/green_functions/LiangWuNoblesse/test_program.f90 +0 -28
  60. capytaine/green_functions/libs/Delhommeau_float32.cp38-win_amd64.pyd +0 -0
  61. capytaine/green_functions/libs/Delhommeau_float64.cp38-win_amd64.pyd +0 -0
  62. capytaine/green_functions/libs/__init__.py +0 -0
  63. capytaine/io/mesh_loaders.py +0 -1086
  64. capytaine/io/mesh_writers.py +0 -692
  65. capytaine/io/meshio.py +0 -38
  66. capytaine/matrices/__init__.py +0 -16
  67. capytaine/matrices/block.py +0 -592
  68. capytaine/matrices/block_toeplitz.py +0 -325
  69. capytaine/matrices/builders.py +0 -89
  70. capytaine/matrices/linear_solvers.py +0 -232
  71. capytaine/matrices/low_rank.py +0 -395
  72. capytaine/meshes/clipper.py +0 -465
  73. capytaine/meshes/collections.py +0 -342
  74. capytaine/meshes/mesh_like_protocol.py +0 -37
  75. capytaine/meshes/properties.py +0 -276
  76. capytaine/meshes/quadratures.py +0 -80
  77. capytaine/meshes/symmetric.py +0 -462
  78. capytaine/tools/lru_cache.py +0 -49
  79. capytaine/ui/vtk/__init__.py +0 -3
  80. capytaine/ui/vtk/animation.py +0 -329
  81. capytaine/ui/vtk/body_viewer.py +0 -28
  82. capytaine/ui/vtk/helpers.py +0 -82
  83. capytaine/ui/vtk/mesh_viewer.py +0 -461
  84. capytaine-2.3.1.dist-info/DELVEWHEEL +0 -2
  85. capytaine-2.3.1.dist-info/RECORD +0 -98
  86. {capytaine-2.3.1.dist-info → capytaine-3.0.0a1.dist-info}/LICENSE +0 -0
  87. {capytaine-2.3.1.dist-info → capytaine-3.0.0a1.dist-info}/WHEEL +0 -0
  88. {capytaine-2.3.1.dist-info → capytaine-3.0.0a1.dist-info}/entry_points.txt +0 -0
  89. capytaine.libs/{.load-order-capytaine-2.3.1 → .load-order-capytaine-3.0.0a1} +2 -2
@@ -0,0 +1,45 @@
1
+ import logging
2
+ import time
3
+ from threading import Thread
4
+
5
+ from capytaine.tools.optional_imports import silently_import_optional_dependency
6
+
7
+ LOG = logging.getLogger(__name__)
8
+
9
+ class MemoryMonitor(Thread):
10
+ """Monitor the memory usage in a separate thread.
11
+ from : https://joblib.readthedocs.io/en/stable/auto_examples/parallel_generator.html#sphx-glr-auto-examples-parallel-generator-py
12
+ """
13
+
14
+ def __init__(self):
15
+ super().__init__()
16
+ self.stop = False
17
+ self.memory_buffer = [0]
18
+ self.psutil = silently_import_optional_dependency("psutil")
19
+ self.start()
20
+
21
+ def get_memory(self):
22
+ "Get memory of a process and its children."
23
+ p = self.psutil.Process()
24
+ memory = p.memory_info().rss
25
+ for c in p.children():
26
+ try:
27
+ memory += c.memory_info().rss
28
+ except self.psutil.NoSuchProcess:
29
+ pass
30
+ return memory
31
+
32
+ def run(self):
33
+ if self.psutil is not None:
34
+ memory_start = self.get_memory()
35
+ while not self.stop:
36
+ self.memory_buffer.append(self.get_memory() - memory_start)
37
+ time.sleep(0.2)
38
+
39
+ def get_memory_peak(self):
40
+ self.stop = True
41
+ super().join()
42
+ if self.psutil is None:
43
+ return None
44
+ else:
45
+ return round(max(self.memory_buffer) / 1e9, 2)
@@ -24,11 +24,23 @@ class SymbolicMultiplication:
24
24
  __array_priority__ = 1.0
25
25
 
26
26
  def __array_function__(self, func, types, *args, **kwargs):
27
- if func in {np.real, np.imag, np.sum}:
27
+ actual_args = args[0] # args = (actual_args, kwargs) for some reason
28
+ if func in {np.real, np.imag, np.sum} and len(actual_args) == 1 and len(kwargs) == 0:
28
29
  return SymbolicMultiplication(self.symbol, func(self.value))
30
+ elif (
31
+ func in {np.einsum} and
32
+ len([a for a in actual_args if isinstance(a, SymbolicMultiplication)]) == 1 and
33
+ "out" not in kwargs
34
+ ):
35
+ # Einsum with one of the array being wrapped in SymbolicMultiplication
36
+ unwrapped = [a.value if isinstance(a, SymbolicMultiplication) else a for a in actual_args]
37
+ return SymbolicMultiplication(self.symbol, func(*unwrapped, **kwargs))
29
38
  else:
30
39
  return NotImplemented
31
40
 
41
+ def astype(self, proper_type):
42
+ return SymbolicMultiplication(self.symbol, proper_type(self.value))
43
+
32
44
  def __str__(self):
33
45
  return f"{self.symbol}×{self.value}"
34
46
 
capytaine/tools/timer.py CHANGED
@@ -2,21 +2,37 @@
2
2
 
3
3
  from functools import wraps
4
4
  import time
5
+ import contextlib
6
+
7
+ import pandas as pd
5
8
 
6
9
  class Timer:
7
- """A simple timer class that can be used as context manager or as decorator using `wraps_function` method
10
+ """A timer class that can be used as context manager or as decorator using `wraps_function` method.
11
+ Several timing measurement can be nested.
12
+
13
+ Attributes
14
+ ----------
15
+ timings: List[Dict]]
16
+ List of records of each timing measurement.
17
+ The record is a dict with a 'timing' key and any number of other metadata keys.
18
+ default_tags: Optional[Dict]
19
+ Tags added to all the timing measurements.
20
+ _start_times: List[float]
21
+ Start times of the ongoing timing measurements.
8
22
 
9
23
  Example
10
24
  -------
11
25
  ::
26
+ from time import sleep # For testing
12
27
 
13
28
  timer = Timer()
14
- with timer:
29
+
30
+ with timer(tag="run 1"):
15
31
  sleep(1.0)
16
32
 
17
33
  print(timer.total) # 1.0...
18
34
 
19
- @timer.wraps_function
35
+ @timer.wraps_function(tag="run function")
20
36
  def my_function():
21
37
  sleep(0.5)
22
38
 
@@ -25,42 +41,50 @@ class Timer:
25
41
  my_function()
26
42
  print(timer.total) # 2.0...
27
43
 
28
- print(timer.timings) # [1.0, 0.5, 0.5]
44
+ with timer(tag="outer"):
45
+ sleep(0.3)
46
+ with timer(tag="inner"):
47
+ sleep(0.3)
48
+ sleep(0.3)
29
49
  """
30
-
31
- def __init__(self, timings=None):
32
- if timings is None:
33
- self.timings = []
34
- else:
35
- self.timings = timings
50
+ def __init__(self, *, default_tags=None):
51
+ self.timings = []
52
+ if default_tags is None:
53
+ default_tags = {}
54
+ self.default_tags = default_tags
55
+ self._start_times = [] # Starting time of ongoing sub-timers
36
56
 
37
57
  def __repr__(self):
38
58
  return f"Timer({self.timings})"
39
59
 
40
- @property
41
- def nb_timings(self):
42
- return len(self.timings)
60
+ def add_data_from_other_timer(self, other, **supplementary_tags):
61
+ self.timings.extend([{**t, **supplementary_tags} for t in other.timings])
62
+
63
+ @contextlib.contextmanager
64
+ def __call__(self, **tags):
65
+ self._start_times.append(time.perf_counter())
66
+ try:
67
+ yield
68
+ finally:
69
+ timing = time.perf_counter() - self._start_times.pop()
70
+ self.timings.append({'timing': timing, **tags, **self.default_tags})
71
+
72
+ def wraps_function(self, **tags):
73
+ def wrapper(f):
74
+ @wraps(f)
75
+ def wrapped_f(*args, **kwargs):
76
+ with self(**tags):
77
+ out = f(*args, **kwargs)
78
+ return out
79
+ return wrapped_f
80
+ return wrapper
81
+
82
+ def as_dataframe(self):
83
+ if len(self.timings) == 0:
84
+ return pd.DataFrame([{'timing': 0.0}])
85
+ else:
86
+ return pd.DataFrame(self.timings)
43
87
 
44
88
  @property
45
89
  def total(self):
46
- return sum(self.timings)
47
-
48
- @property
49
- def mean(self):
50
- if self.nb_timings == 0:
51
- return float('nan')
52
- else:
53
- return self.total/self.nb_timings
54
-
55
- def __enter__(self):
56
- self.start_time = time.perf_counter()
57
-
58
- def __exit__(self, *exc):
59
- self.timings.append(time.perf_counter() - self.start_time)
60
-
61
- def wraps_function(self, f):
62
- @wraps(f)
63
- def wrapped_f(*args, **kwargs):
64
- with self:
65
- return f(*args, **kwargs)
66
- return wrapped_f
90
+ return self.as_dataframe()['timing'].sum()
@@ -0,0 +1,2 @@
1
+ Version: 1.10.0
2
+ Arguments: ['C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-uhvuakq8\\cp38-win_amd64\\build\\venv\\Scripts\\delvewheel', 'repair', '-w', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-uhvuakq8\\cp38-win_amd64\\repaired_wheel', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-uhvuakq8\\cp38-win_amd64\\built_wheel\\capytaine-3.0.0a1-cp38-cp38-win_amd64.whl', '--no-mangle-all']
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: capytaine
3
- Version: 2.3.1
3
+ Version: 3.0.0a1
4
4
  Summary: Python BEM solver for linear potential flow, based on Nemoh
5
5
  Author-Email: Matthieu Ancellin <matthieu.ancellin@mews-labs.com>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -694,10 +694,15 @@ Requires-Dist: xarray
694
694
  Requires-Dist: rich
695
695
  Provides-Extra: optional
696
696
  Requires-Dist: matplotlib; extra == "optional"
697
+ Requires-Dist: vtk; extra == "optional"
698
+ Requires-Dist: pyvista; extra == "optional"
699
+ Requires-Dist: psutil; extra == "optional"
697
700
  Requires-Dist: joblib>=1.3; extra == "optional"
701
+ Requires-Dist: threadpoolctl; extra == "optional"
698
702
  Requires-Dist: meshio; extra == "optional"
703
+ Requires-Dist: trimesh; extra == "optional"
704
+ Requires-Dist: h5py; extra == "optional"
699
705
  Requires-Dist: netcdf4; extra == "optional"
700
- Requires-Dist: vtk; extra == "optional"
701
706
  Description-Content-Type: text/markdown
702
707
 
703
708
  # Capytaine: a linear potential flow BEM solver with Python.
@@ -0,0 +1,71 @@
1
+ capytaine/__about__.py,sha256=N1rct3EFkKfBSBht-zW5loFBCdFB1jGik3zuFVwnbNE,531
2
+ capytaine/__init__.py,sha256=30NRY2G56_fmJNza_i9ZSxsgX5fY3iLQF86AG_vZCIk,2994
3
+ capytaine/bem/airy_waves.py,sha256=vap1Qmdo-m1lZ-WLj_5TJY2v3_bNJNtJ_04OkJX83fA,3609
4
+ capytaine/bem/engines.py,sha256=6gTGplr-rjqvy5T7QllKAdeXziTQmgfl2I4qgNjer0g,13446
5
+ capytaine/bem/problems_and_results.py,sha256=_sxvhu42xLZShUyuObdlWL6K06Q0W16uLLlg06pB-aE,27861
6
+ capytaine/bem/solver.py,sha256=f3gsBjFeBJOEsrWEe17E91wnYP8OB8K7fW85yDrJWmM,35839
7
+ capytaine/bem/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
+ capytaine/bodies/bodies.py,sha256=my08UHz_Q8YV9pwMsjKHwpbguUZOeBBKjgZYfZfsYeA,26732
9
+ capytaine/bodies/dofs.py,sha256=qlctn6tjFXyz_rNNOkdSvjIzZDMwnI_6jFg312lc2E4,5373
10
+ capytaine/bodies/hydrostatics.py,sha256=v310PVAWsOBF2tpl5iRpQ0bA6q86bxkrhjE8pGRTCWY,26959
11
+ capytaine/bodies/multibodies.py,sha256=6-zOfIsvGZowIoOyLcy6wV4l6TBpTKFlp8bTEkTvnLk,8096
12
+ capytaine/bodies/__init__.py,sha256=1157LRyNMo7TFZOMvlsC7NPPSMflsZVPfMxeLyNUQkU,161
13
+ capytaine/green_functions/abstract_green_function.py,sha256=ShrFVMJpyYJKqhaOIHdtcD3ijtyTY8vwiszqibAjJTE,2903
14
+ capytaine/green_functions/delhommeau.py,sha256=r5_ZA6RMZj31biU5lpvb9UKWEL5XFTkCjBCgcJf47XQ,24806
15
+ capytaine/green_functions/Delhommeau_float32.cp38-win_amd64.dll.a,sha256=LwEJFcQMLbq7RoHT2FgG_rFTsjKPlTClWZBV03i25Ls,1876
16
+ capytaine/green_functions/Delhommeau_float32.cp38-win_amd64.pyd,sha256=m-MzZuAKwxqlNtBQiof5kx4iaN8FtptHPWnifknRv6k,415441
17
+ capytaine/green_functions/Delhommeau_float64.cp38-win_amd64.dll.a,sha256=tDicYpdZyeZDTSnI3u7IOXa-OKzFItCkvfrA8XjBsKY,1876
18
+ capytaine/green_functions/Delhommeau_float64.cp38-win_amd64.pyd,sha256=QzxFg54lrQWLlJ-3mfv9bQfA1H7TdoaO9goQgroUrKQ,473344
19
+ capytaine/green_functions/hams.py,sha256=ozpcpgSOyUjUefi0gz8LmmUPrDPDLfuSHCFcvgwLgIU,8477
20
+ capytaine/green_functions/__init__.py,sha256=Rvl4Xv0MbD9NOpcnYkiSpeD097l_SQX8C5r-9CvdIZs,109
21
+ capytaine/io/bemio.py,sha256=_UKSNaI-uuT3ICSEpBRSHhWqN3cFjuBab2t-EJLRtxU,7487
22
+ capytaine/io/legacy.py,sha256=T7ngTuIyy2NqdVhCw5teVXASV37u_yi6VgBz5smAOrU,10567
23
+ capytaine/io/wamit.py,sha256=ZCYQBPa2vBWLadtZP9Gkvrq_GpYdhxs4ekPLFDHTHRQ,16507
24
+ capytaine/io/xarray.py,sha256=90J6YTCuo5Seg-BaTt5yr1HTNed-WyF9u7WK_kE_AZo,28016
25
+ capytaine/io/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
+ capytaine/meshes/abstract_meshes.py,sha256=lqJgl3tDHVJJQsTdpgXShr_RB7sdkqAAzQ2LV6AQIpE,13425
27
+ capytaine/meshes/clean.py,sha256=yRreBMov00S1H1Wv6QWGIb52S62RuM12SST4ZPrdu6Q,10126
28
+ capytaine/meshes/clip.py,sha256=cp00yHhz44imXViac0OHl7r5YoyrTrECfIvwsRHgKNw,11076
29
+ capytaine/meshes/export.py,sha256=PBVIRy0YycophUdo0Rg0QRmr0_E8pEsvaAqQXkz6gMI,2800
30
+ capytaine/meshes/geometry.py,sha256=CA6gShq_mxCwHU5cy2NVdZLy8z5XouC51tvN4yqkOh0,9092
31
+ capytaine/meshes/io.py,sha256=uSC2O_NWMn1JPFXhxIXejlEpUO6BgXdR5juJs2yT8z0,17526
32
+ capytaine/meshes/meshes.py,sha256=p_JKofdKTy22ojGGeW-BlwOz0hVvoVzdKucxHZ4SDoE,30631
33
+ capytaine/meshes/quality.py,sha256=R22XkQIdi7JZ_IiMuH48jGhzCtno_rLE2H8HMOU1oBI,5029
34
+ capytaine/meshes/surface_integrals.py,sha256=CLCLI1ru-OTookMOmqJH4mDsLYjc4_NOMhYwEebXzp8,3205
35
+ capytaine/meshes/symmetric_meshes.py,sha256=1pDQDGq6lXHsOuz4nW_uw06nhaKWEbe28-nR773lSZQ,25373
36
+ capytaine/meshes/visualization.py,sha256=ZB1Zdy5tW8Hhq1gASZgE3tTHrCh6COvMoB2Ehr35vMo,12737
37
+ capytaine/meshes/__init__.py,sha256=9yIl9gwugHHojSfbrZyyhmLSWOAWu7-siefZUMw3BWA,104
38
+ capytaine/meshes/predefined/cylinders.py,sha256=bne74x5m-GIddgGO7amLx8HvG9qL8ArWF8oLViCxeIo,13692
39
+ capytaine/meshes/predefined/rectangles.py,sha256=XkOxKZcbGr7kkwYWeM4lq4LmlJhZ5Y7zJkQGA3eQSAY,9673
40
+ capytaine/meshes/predefined/spheres.py,sha256=PqH5hmoAz4KA6xRuh6KwpvUHApAY11d0q2urjLPzHRI,1994
41
+ capytaine/meshes/predefined/__init__.py,sha256=BQJOD_GolXloY8Lww0Orhhi0F5m838urQl_-MbsfKLI,371
42
+ capytaine/post_pro/free_surfaces.py,sha256=tsNJjDAc8c52NyfTtsU7jN8zcgLzTjblUxL8YuR-08s,3101
43
+ capytaine/post_pro/impedance.py,sha256=Or2rzFQDewXc0aeO1_Q_B3Sy0sR_hK6afW1VcVe6zT4,3584
44
+ capytaine/post_pro/kochin.py,sha256=Q1_QTGFD2a1xx4VcQP6mmZL--a2DcIZzuyURUnpHkY0,2121
45
+ capytaine/post_pro/rao.py,sha256=vyrNCCInAAsVZHsM3agsk35-PLelcMLAV25LsAUJwlQ,2353
46
+ capytaine/post_pro/__init__.py,sha256=Q5cAAosHI_X24h6mALZvfJWGUobCxWyB4lSMHFMDX4M,280
47
+ capytaine/tools/block_circulant_matrices.py,sha256=GqGFnKmmaCSNLu-XMCpcopcJnV2Gko4oxE0cjbQVuxU,11252
48
+ capytaine/tools/cache_on_disk.py,sha256=LwUaMkvd-Z46EXeVyYhGQpeNve5PVpM2qj0ESUHXYRs,938
49
+ capytaine/tools/deprecation_handling.py,sha256=oewPgemWDwbZ9of3uPS5k_RZ4kBldHtHYvjbX2PgerY,827
50
+ capytaine/tools/lists_of_points.py,sha256=h-Z_ZiqGFWf0sJKEcCEVrAq9qplCoZ40WxIjv5XRntc,1885
51
+ capytaine/tools/memory_monitor.py,sha256=UNG-yOCXqvCKK2fXbUj9rvVPHQnZk62R1b2EaHMC4YA,1427
52
+ capytaine/tools/optional_imports.py,sha256=L2_6h1My2jjl7GHL0_hmHsjOE8hRWFrs0eiq_OIDTH8,887
53
+ capytaine/tools/prony_decomposition.py,sha256=_iqHEhop8oBREz0zY35WXV-UkPw1QHbQhP6L_BrtCQM,5297
54
+ capytaine/tools/symbolic_multiplication.py,sha256=bFdXAczzp75xQH1oF_oqw62R9veoix1puRskisr5Clg,5715
55
+ capytaine/tools/timer.py,sha256=Xywoy31LRQ6uUO9dTvhgs_O0i1pvhdsJjqDmT7cfXPM,2692
56
+ capytaine/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
57
+ capytaine/ui/cli.py,sha256=DLgsJdmMASM70BqN7bbNQxBkiHKReJDJqgf4E9mr_yk,825
58
+ capytaine/ui/rich.py,sha256=kxI4CVa4ycJBloEHvLpLqrEArkLT4wAdcPKhbEw2hcY,238
59
+ capytaine/ui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
60
+ capytaine-3.0.0a1.dist-info/DELVEWHEEL,sha256=so9sJLktN_Ft6np-uHr73csoXUzqjF_AOUgI_HkJtIk,418
61
+ capytaine-3.0.0a1.dist-info/entry_points.txt,sha256=R72-je8lc6ELm8ftt7lJ7f1aalnQs5BWYrGDBMexHII,53
62
+ capytaine-3.0.0a1.dist-info/LICENSE,sha256=Czg9WmPaZE9ijZnDOXbqZIftiaqlnwsyV5kt6sEXHms,35821
63
+ capytaine-3.0.0a1.dist-info/METADATA,sha256=4YdZOR22xCmwIHWLYxDSR21K5JLNhiUGdOCEsDYI-NI,45296
64
+ capytaine-3.0.0a1.dist-info/RECORD,,
65
+ capytaine-3.0.0a1.dist-info/WHEEL,sha256=vIXzP6jLUy4sdmrQppnovVBqmdfNCkEM0I7EHxeJ-zs,83
66
+ capytaine.libs/.load-order-capytaine-3.0.0a1,sha256=YYuCKmrWPemHmg120B5f_dwt8FsCfw_UupZYRCgbCNo,89
67
+ capytaine.libs/libgcc_s_seh-1.dll,sha256=q2m46g2pAq7jvn1d0qbVW6WqyOpxQ6KtnAdh5r3gCxY,111616
68
+ capytaine.libs/libgfortran-5.dll,sha256=wLLASxjhj_hbogJghmWeKSyi6w4L9h8xR04-iS1Ejq4,3118080
69
+ capytaine.libs/libgomp-1.dll,sha256=yCJD_z8GQ7Hi7iXgwG2hkjFAOqf-KeE45YnavaKCpf8,280576
70
+ capytaine.libs/libquadmath-0.dll,sha256=vIpjCdqsQ0SQ3J3DscTl99gInyZO6VayFN2xrTg0d3s,362496
71
+ capytaine.libs/libwinpthread-1.dll,sha256=EOuEmPH-j0Z0z_whHcbHQU6FHiCOyfNp9_-IhdgmQUY,54784
@@ -1,6 +0,0 @@
1
- # Copyright (C) 2017-2019 Matthieu Ancellin
2
- # See LICENSE file at <https://github.com/mancellin/capytaine>
3
-
4
- from capytaine.bodies.predefined.spheres import Sphere
5
- from capytaine.bodies.predefined.cylinders import HorizontalCylinder, VerticalCylinder
6
- from capytaine.bodies.predefined.rectangles import Rectangle, RectangularParallelepiped
@@ -1,151 +0,0 @@
1
- """Legacy interfaces to predefined meshes"""
2
- # Copyright (C) 2017-2022 Matthieu Ancellin
3
- # See LICENSE file at <https://github.com/capytaine/capytaine>
4
-
5
- import logging
6
- import numpy as np
7
-
8
- from capytaine.meshes.predefined import mesh_disk, mesh_vertical_cylinder, mesh_horizontal_cylinder
9
- from capytaine.meshes.meshes import Mesh
10
- from capytaine.bodies.bodies import FloatingBody
11
-
12
- LOG = logging.getLogger(__name__)
13
-
14
-
15
- ##########
16
- # Disk #
17
- ##########
18
-
19
- class Disk(FloatingBody):
20
- """(One-sided) disk.
21
- Deprecated: please prefer capytaine.meshes.predefined.mesh_disk()
22
-
23
- Parameters
24
- ----------
25
- radius : float, optional
26
- radius of the disk
27
- resolution : 2-ple of int, optional
28
- number of panels along a radius and around the disk
29
- center : 3-ple or array of shape (3,), optional
30
- position of the geometric center of the disk
31
- normal: 3-ple of floats, optional
32
- normal vector, default: along x axis
33
- axial_symmetry : bool, optional
34
- if True, use the axial symmetry to speed up the computations
35
- reflection_symmetry : bool, optional
36
- if True, use the reflection symmetry to speed up the computations
37
- name : str, optional
38
- a string naming the floating body
39
- """
40
-
41
- def __init__(self, radius=1.0, resolution=(3, 5),
42
- center=(0, 0, 0), normal=(1, 0, 0),
43
- reflection_symmetry=False, axial_symmetry=False,
44
- name=None):
45
- LOG.warning("Deprecation warning: The class Disk() is deprecated. "
46
- "Please prefer the function capytaine.meshes.predefined.mesh_disk()")
47
-
48
- if name is None:
49
- name = f"disk_{next(Mesh._ids)}"
50
-
51
- self.radius = float(radius)
52
- self.geometric_center = np.asarray(center, dtype=float)
53
- mesh = mesh_disk(radius=radius, center=center, normal=normal, resolution=resolution,
54
- reflection_symmetry=reflection_symmetry, axial_symmetry=axial_symmetry, name=f"{name}_mesh")
55
- FloatingBody.__init__(self, mesh=mesh, name=name)
56
-
57
-
58
- ##############
59
- # Cylinder #
60
- ##############
61
-
62
- class HorizontalCylinder(FloatingBody):
63
- """Horizontal cylinder
64
- Deprecated: please prefer capytaine.meshes.predefined.mesh_horizontal_cylinder()
65
-
66
- Parameters
67
- ----------
68
- length : float, optional
69
- length of the cylinder
70
- radius : float, optional
71
- radius of the cylinder
72
- center : 3-ple or array of shape (3,), optional
73
- position of the geometric center of the cylinder
74
- nx : int, optional
75
- number of circular slices
76
- ntheta : int, optional
77
- number of panels along a circular slice of the cylinder
78
- nr : int, optional
79
- number of panels along a radius on the extremities of the cylinder
80
- reflection_symmetry : bool, optional
81
- if True, returns a ReflectionSymmetricMesh
82
- translation_symmetry : bool, optional
83
- if True, uses a TranslationalSymmetricMesh internally for the main part of the cylinder
84
- name : str, optional
85
- a string naming the floating body
86
- """
87
-
88
- def __init__(self, length=10.0, radius=1.0, center=(0, 0, 0),
89
- nx=10, ntheta=10, nr=2,
90
- reflection_symmetry=True, translation_symmetry=False,
91
- clever=None,
92
- name=None):
93
-
94
- LOG.warning("Deprecation warning: The class HorizontalCylinder() is deprecated. "
95
- "Please prefer the function capytaine.meshes.predefined.mesh_horizontal_cylinder()")
96
-
97
- self.length = length
98
- self.radius = radius
99
- self.geometric_center = np.asarray(center, dtype=float)
100
-
101
- if name is None:
102
- name = f"cylinder_{next(Mesh._ids)}"
103
-
104
- mesh = mesh_horizontal_cylinder(length=length, radius=radius, center=center,
105
- resolution=(nr, ntheta, nx), reflection_symmetry=reflection_symmetry,
106
- translation_symmetry=translation_symmetry, name=f"{name}_mesh")
107
- FloatingBody.__init__(self, mesh=mesh, name=name)
108
-
109
-
110
- class VerticalCylinder(FloatingBody):
111
- """Vertical cylinder.
112
- Deprecated: please prefer capytaine.meshes.predefined.mesh_vertical_cylinder()
113
-
114
- Parameters
115
- ----------
116
- length : float, optional
117
- length of the cylinder
118
- radius : float, optional
119
- radius of the cylinder
120
- center : 3-ple or array of shape (3,), optional
121
- position of the geometric center of the cylinder
122
- nx : int, optional
123
- number of circular slices
124
- ntheta : int, optional
125
- number of panels along a circular slice of the cylinder
126
- nr : int, optional
127
- number of panels along a radius on the extremities of the cylinder
128
- clever : bool, optional
129
- if True, uses the mesh symmetries
130
- name : str, optional
131
- a string naming the floating body
132
- """
133
-
134
- def __init__(self, length=10.0, radius=1.0, center=(0, 0, 0),
135
- nx=10, ntheta=10, nr=2,
136
- clever=True, name=None):
137
- LOG.warning("Deprecation warning: The class VerticalCylinder() is deprecated. "
138
- "Please prefer the function capytaine.meshes.predefined.mesh_vertical_cylinder()")
139
-
140
- self.length = length
141
- self.radius = radius
142
- self.geometric_center = np.asarray(center, dtype=float)
143
-
144
- if name is None:
145
- name = f"cylinder_{next(Mesh._ids)}"
146
-
147
- mesh = mesh_vertical_cylinder(length=length, radius=radius, center=center,
148
- resolution=(nr, ntheta, nx), reflection_symmetry=False,
149
- axial_symmetry=clever, name=f"{name}_mesh")
150
-
151
- FloatingBody.__init__(self, mesh=mesh, name=name)
@@ -1,111 +0,0 @@
1
- """Legacy interfaces to predefined meshes"""
2
- # Copyright (C) 2017-2022 Matthieu Ancellin
3
- # See LICENSE file at <https://github.com/capytaine/capytaine>
4
-
5
- import logging
6
- import numpy as np
7
-
8
- from capytaine.meshes.predefined import mesh_rectangle, mesh_parallelepiped
9
- from capytaine.meshes.meshes import Mesh
10
- from capytaine.bodies.bodies import FloatingBody
11
-
12
- LOG = logging.getLogger(__name__)
13
-
14
-
15
- class Rectangle(FloatingBody):
16
- """One-sided vertical rectangle (along y and z).
17
-
18
- By default, the normals are oriented in the positive y direction.
19
-
20
- Parameters
21
- ----------
22
- size : couple of floats, optional
23
- dimensions of the rectangle (width and height)
24
- resolution : couple of ints, optional
25
- number of faces along each of the two directions
26
- center : 3-ple of floats, optional
27
- position of the geometric center of the rectangle, default: (0, 0, 0)
28
- normal: 3-ple of floats, optional
29
- normal vector, default: along x axis
30
- translational_symmetry : bool, optional
31
- if True, use the translation symmetry to speed up the computations
32
- reflection_symmetry : bool, optional
33
- if True, use the reflection symmetry to speed up the computations
34
- name : string, optional
35
- a name for the body
36
- """
37
-
38
- def __init__(self, size=(5.0, 5.0), resolution=(5, 5),
39
- center=(0, 0, 0), normal=(1, 0, 0),
40
- translational_symmetry=False, reflection_symmetry=False, name=None):
41
-
42
- LOG.warning("Deprecation warning: The class Rectangle() is deprecated. "
43
- "Please prefer the function capytaine.meshes.predefined.mesh_rectangle()")
44
-
45
- self.size = np.asarray(size, dtype=float)
46
- self.geometric_center = np.asarray(center, dtype=float)
47
-
48
- if name is None:
49
- name = f"rectangle_{next(Mesh._ids)}"
50
-
51
- mesh = mesh_rectangle(size=size, resolution=resolution, center=center, normal=normal,
52
- translation_symmetry=translational_symmetry, reflection_symmetry=reflection_symmetry,
53
- name=f"{name}_mesh")
54
- FloatingBody.__init__(self, mesh=mesh, name=name)
55
-
56
-
57
- class RectangularParallelepiped(FloatingBody):
58
- """Six rectangles forming a parallelepiped.
59
-
60
- Parameters
61
- ----------
62
- size : 3-ple of floats, optional
63
- dimensions of the parallelepiped (width, thickness, height) for coordinates (x, y, z).
64
- resolution : 3-ple of ints, optional
65
- number of faces along the three directions
66
- center : 3-ple of floats, optional
67
- coordinates of the geometric center of the parallelepiped
68
- top: bool, optional
69
- whether or not to close the parallelepiped on the top
70
- bottom: bool, optional
71
- whether or not to close the parallelepiped on the bottom
72
- reflection_symmetry : bool, optional
73
- use xOz and yOz symmetry plane to generate the mesh
74
- translational_symmetry : bool, optional
75
- if True, use the translation symmetry in the x direction to speed up the computations.
76
- To use the translation symmetry in the y direction, create a x-symmetric body and then rotate it by pi/2.
77
- name : string, optional
78
- a name for the body
79
- """
80
-
81
- def __init__(self,
82
- size=(1.0, 1.0, 1.0), resolution=(4, 4, 4),
83
- center=(0, 0, 0),
84
- top=True, bottom=True,
85
- reflection_symmetry=False,
86
- translational_symmetry=False,
87
- name=None):
88
-
89
- LOG.warning("Deprecation warning: The class RectangularParallelepiped() is deprecated. "
90
- "Please prefer the function capytaine.meshes.predefined.mesh_parallelepiped()")
91
-
92
- if name is None:
93
- name = f"rectangular_parallelepiped_{next(Mesh._ids)}"
94
-
95
- missing_sides = set()
96
- if not top: missing_sides.add("top")
97
- if not bottom: missing_sides.add("bottom")
98
-
99
- mesh = mesh_parallelepiped(size=size, resolution=resolution, center=center,
100
- missing_sides=missing_sides,
101
- translation_symmetry=translational_symmetry, reflection_symmetry=reflection_symmetry,
102
- name=f"{name}_mesh")
103
-
104
- self.geometric_center = np.asarray(center, dtype=float)
105
-
106
- FloatingBody.__init__(self, mesh=mesh, name=name)
107
-
108
- class OpenRectangularParallelepiped(RectangularParallelepiped):
109
- def __init__(self, *args, **kwargs):
110
- RectangularParallelepiped.__init__(self, top=False, bottom=False, *args, **kwargs)
111
- # Kept mostly for legacy
@@ -1,70 +0,0 @@
1
- """Generate spherical bodies."""
2
- # Copyright (C) 2017-2022 Matthieu Ancellin
3
- # See LICENSE file at <https://github.com/capytaine/capytaine>
4
-
5
- import logging
6
-
7
- import numpy as np
8
-
9
- from capytaine.meshes import Mesh
10
- from capytaine.meshes.predefined import mesh_sphere
11
- from capytaine.bodies.bodies import FloatingBody
12
-
13
- LOG = logging.getLogger(__name__)
14
-
15
-
16
- class Sphere(FloatingBody):
17
- """Sphere
18
- Deprecated: please prefer capytaine.meshes.predefined.mesh_sphere()
19
-
20
- Parameters
21
- ----------
22
- radius : float
23
- radius of the sphere
24
- center : 3-ple or array of shape (3,)
25
- position of the geometric center of the sphere
26
- ntheta : int
27
- number of panels along a meridian (or number of parallels-1)
28
- nphi : int
29
- number of panels along a parallel (or number of meridians-1)
30
- axial_symmetry : bool
31
- if True, use the axial symmetry to build the mesh (default: True)
32
- clip_free_surface : bool
33
- if True, only mesh the part of the sphere where z < 0 (default: False),
34
- can be used with center to obtain any clipped sphere,
35
- if True, then ntheta is the number of parallel below the free surface.
36
- name : string
37
- a name identifying the sphere (default: "sphere_id" where id is an unique integer).
38
- """
39
-
40
- def __init__(self, *, radius=1.0, center=(0, 0, 0),
41
- ntheta=10, nphi=10, clip_free_surface=False,
42
- axial_symmetry=True, clever=None,
43
- name=None):
44
-
45
- LOG.warning("Deprecation warning: The class Sphere() is deprecated. "
46
- "Please prefer the function capytaine.meshes.predefined.mesh_sphere()")
47
-
48
- if clever is not None:
49
- LOG.warning("Deprecation warning: `clever` argument for Sphere is deprecated. "
50
- "Use `axial_symmetry` instead.")
51
-
52
- if name is None:
53
- name = f"sphere_{next(Mesh._ids)}"
54
-
55
- if clip_free_surface:
56
- if center[2] < -radius: # fully immersed
57
- pass
58
- elif center[2] < radius:
59
- ntheta = int(ntheta*np.pi/np.arccos(center[2]/radius))
60
- else:
61
- raise ValueError("Impossible to mesh the immersed hull of a sphere completely out of the water")
62
-
63
- mesh = mesh_sphere(radius=radius, center=center, resolution=(ntheta, nphi), axial_symmetry=axial_symmetry, name=f"{name}_mesh")
64
-
65
- if clip_free_surface:
66
- mesh.keep_immersed_part()
67
-
68
- self.radius = radius
69
- self.geometric_center = np.array(center, dtype=float)
70
- FloatingBody.__init__(self, mesh=mesh, name=name)
@@ -1 +0,0 @@
1
- build/