capytaine 2.3__cp312-cp312-macosx_14_0_arm64.whl → 3.0.0a1__cp312-cp312-macosx_14_0_arm64.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.
- capytaine/.dylibs/libgcc_s.1.1.dylib +0 -0
- capytaine/.dylibs/libgfortran.5.dylib +0 -0
- capytaine/.dylibs/libquadmath.0.dylib +0 -0
- capytaine/__about__.py +7 -2
- capytaine/__init__.py +8 -12
- capytaine/bem/engines.py +234 -354
- capytaine/bem/problems_and_results.py +30 -21
- capytaine/bem/solver.py +205 -81
- capytaine/bodies/bodies.py +279 -862
- capytaine/bodies/dofs.py +136 -9
- capytaine/bodies/hydrostatics.py +540 -0
- capytaine/bodies/multibodies.py +216 -0
- capytaine/green_functions/{libs/Delhommeau_float32.cpython-312-darwin.so → Delhommeau_float32.cpython-312-darwin.so} +0 -0
- capytaine/green_functions/{libs/Delhommeau_float64.cpython-312-darwin.so → Delhommeau_float64.cpython-312-darwin.so} +0 -0
- capytaine/green_functions/abstract_green_function.py +2 -2
- capytaine/green_functions/delhommeau.py +50 -31
- capytaine/green_functions/hams.py +19 -13
- capytaine/io/legacy.py +3 -103
- capytaine/io/xarray.py +15 -10
- capytaine/meshes/__init__.py +2 -6
- capytaine/meshes/abstract_meshes.py +375 -0
- capytaine/meshes/clean.py +302 -0
- capytaine/meshes/clip.py +347 -0
- capytaine/meshes/export.py +89 -0
- capytaine/meshes/geometry.py +244 -394
- capytaine/meshes/io.py +433 -0
- capytaine/meshes/meshes.py +621 -676
- capytaine/meshes/predefined/cylinders.py +22 -56
- capytaine/meshes/predefined/rectangles.py +26 -85
- capytaine/meshes/predefined/spheres.py +4 -11
- capytaine/meshes/quality.py +118 -407
- capytaine/meshes/surface_integrals.py +48 -29
- capytaine/meshes/symmetric_meshes.py +641 -0
- capytaine/meshes/visualization.py +353 -0
- capytaine/post_pro/free_surfaces.py +1 -4
- capytaine/post_pro/kochin.py +10 -10
- capytaine/tools/block_circulant_matrices.py +275 -0
- capytaine/tools/lists_of_points.py +2 -2
- capytaine/tools/memory_monitor.py +45 -0
- capytaine/tools/symbolic_multiplication.py +31 -5
- capytaine/tools/timer.py +68 -42
- {capytaine-2.3.dist-info → capytaine-3.0.0a1.dist-info}/METADATA +8 -14
- capytaine-3.0.0a1.dist-info/RECORD +65 -0
- capytaine-3.0.0a1.dist-info/WHEEL +6 -0
- capytaine/bodies/predefined/__init__.py +0 -6
- capytaine/bodies/predefined/cylinders.py +0 -151
- capytaine/bodies/predefined/rectangles.py +0 -111
- capytaine/bodies/predefined/spheres.py +0 -70
- capytaine/green_functions/FinGreen3D/.gitignore +0 -1
- capytaine/green_functions/FinGreen3D/FinGreen3D.f90 +0 -3589
- capytaine/green_functions/FinGreen3D/LICENSE +0 -165
- capytaine/green_functions/FinGreen3D/Makefile +0 -16
- capytaine/green_functions/FinGreen3D/README.md +0 -24
- capytaine/green_functions/FinGreen3D/test_program.f90 +0 -39
- capytaine/green_functions/LiangWuNoblesse/.gitignore +0 -1
- capytaine/green_functions/LiangWuNoblesse/LICENSE +0 -504
- capytaine/green_functions/LiangWuNoblesse/LiangWuNoblesseWaveTerm.f90 +0 -751
- capytaine/green_functions/LiangWuNoblesse/Makefile +0 -18
- capytaine/green_functions/LiangWuNoblesse/README.md +0 -2
- capytaine/green_functions/LiangWuNoblesse/test_program.f90 +0 -28
- capytaine/green_functions/libs/__init__.py +0 -0
- capytaine/io/mesh_loaders.py +0 -1086
- capytaine/io/mesh_writers.py +0 -692
- capytaine/io/meshio.py +0 -38
- capytaine/matrices/__init__.py +0 -16
- capytaine/matrices/block.py +0 -592
- capytaine/matrices/block_toeplitz.py +0 -325
- capytaine/matrices/builders.py +0 -89
- capytaine/matrices/linear_solvers.py +0 -232
- capytaine/matrices/low_rank.py +0 -395
- capytaine/meshes/clipper.py +0 -465
- capytaine/meshes/collections.py +0 -334
- capytaine/meshes/mesh_like_protocol.py +0 -37
- capytaine/meshes/properties.py +0 -276
- capytaine/meshes/quadratures.py +0 -80
- capytaine/meshes/symmetric.py +0 -392
- capytaine/tools/lru_cache.py +0 -49
- capytaine/ui/vtk/__init__.py +0 -3
- capytaine/ui/vtk/animation.py +0 -329
- capytaine/ui/vtk/body_viewer.py +0 -28
- capytaine/ui/vtk/helpers.py +0 -82
- capytaine/ui/vtk/mesh_viewer.py +0 -461
- capytaine-2.3.dist-info/RECORD +0 -92
- capytaine-2.3.dist-info/WHEEL +0 -4
- {capytaine-2.3.dist-info → capytaine-3.0.0a1.dist-info}/LICENSE +0 -0
- {capytaine-2.3.dist-info → capytaine-3.0.0a1.dist-info}/entry_points.txt +0 -0
|
@@ -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)
|
|
@@ -11,7 +11,6 @@ output of the form `SymbolicMultiplication("0", np.array(...))`
|
|
|
11
11
|
import numpy as np
|
|
12
12
|
from functools import wraps, total_ordering
|
|
13
13
|
|
|
14
|
-
@total_ordering
|
|
15
14
|
class SymbolicMultiplication:
|
|
16
15
|
def __init__(self, symbol, value=1.0):
|
|
17
16
|
self.symbol = symbol
|
|
@@ -25,11 +24,23 @@ class SymbolicMultiplication:
|
|
|
25
24
|
__array_priority__ = 1.0
|
|
26
25
|
|
|
27
26
|
def __array_function__(self, func, types, *args, **kwargs):
|
|
28
|
-
|
|
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:
|
|
29
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))
|
|
30
38
|
else:
|
|
31
39
|
return NotImplemented
|
|
32
40
|
|
|
41
|
+
def astype(self, proper_type):
|
|
42
|
+
return SymbolicMultiplication(self.symbol, proper_type(self.value))
|
|
43
|
+
|
|
33
44
|
def __str__(self):
|
|
34
45
|
return f"{self.symbol}×{self.value}"
|
|
35
46
|
|
|
@@ -82,11 +93,26 @@ class SymbolicMultiplication:
|
|
|
82
93
|
def __getitem__(self, item):
|
|
83
94
|
return SymbolicMultiplication(self.symbol, self.value[item])
|
|
84
95
|
|
|
85
|
-
def
|
|
86
|
-
|
|
96
|
+
def __setitem__(self, item, val):
|
|
97
|
+
if isinstance(val, SymbolicMultiplication) and self.symbol == val.symbol:
|
|
98
|
+
self.value.__setitem__(item, val.value)
|
|
99
|
+
else:
|
|
100
|
+
raise NotImplementedError
|
|
87
101
|
|
|
88
102
|
def __lt__(self, x):
|
|
89
|
-
return
|
|
103
|
+
return self._concretize() < x
|
|
104
|
+
|
|
105
|
+
def __le__(self, x):
|
|
106
|
+
return self._concretize() <= x
|
|
107
|
+
|
|
108
|
+
def __eq__(self, x):
|
|
109
|
+
return self._concretize() == x
|
|
110
|
+
|
|
111
|
+
def __ge__(self, x):
|
|
112
|
+
return self._concretize() >= x
|
|
113
|
+
|
|
114
|
+
def __gt__(self, x):
|
|
115
|
+
return self._concretize() > x
|
|
90
116
|
|
|
91
117
|
def __hash__(self):
|
|
92
118
|
return hash((self.symbol, self.value))
|
capytaine/tools/timer.py
CHANGED
|
@@ -2,63 +2,89 @@
|
|
|
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
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
sleep(1.0)
|
|
25
|
+
::
|
|
26
|
+
from time import sleep # For testing
|
|
14
27
|
|
|
15
|
-
|
|
28
|
+
timer = Timer()
|
|
16
29
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
sleep(0.5)
|
|
30
|
+
with timer(tag="run 1"):
|
|
31
|
+
sleep(1.0)
|
|
20
32
|
|
|
21
|
-
|
|
22
|
-
print(timer.total) # 1.5...
|
|
23
|
-
my_function()
|
|
24
|
-
print(timer.total) # 2.0...
|
|
33
|
+
print(timer.total) # 1.0...
|
|
25
34
|
|
|
26
|
-
|
|
27
|
-
|
|
35
|
+
@timer.wraps_function(tag="run function")
|
|
36
|
+
def my_function():
|
|
37
|
+
sleep(0.5)
|
|
28
38
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
39
|
+
my_function()
|
|
40
|
+
print(timer.total) # 1.5...
|
|
41
|
+
my_function()
|
|
42
|
+
print(timer.total) # 2.0...
|
|
43
|
+
|
|
44
|
+
with timer(tag="outer"):
|
|
45
|
+
sleep(0.3)
|
|
46
|
+
with timer(tag="inner"):
|
|
47
|
+
sleep(0.3)
|
|
48
|
+
sleep(0.3)
|
|
49
|
+
"""
|
|
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
|
|
34
56
|
|
|
35
57
|
def __repr__(self):
|
|
36
58
|
return f"Timer({self.timings})"
|
|
37
59
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
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])
|
|
41
62
|
|
|
42
|
-
@
|
|
43
|
-
def
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
else:
|
|
51
|
-
return self.total/self.nb_timings
|
|
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})
|
|
52
71
|
|
|
53
|
-
def
|
|
54
|
-
|
|
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
|
|
55
81
|
|
|
56
|
-
def
|
|
57
|
-
self.timings
|
|
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)
|
|
58
87
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
with self:
|
|
63
|
-
return f(*args, **kwargs)
|
|
64
|
-
return wrapped_f
|
|
88
|
+
@property
|
|
89
|
+
def total(self):
|
|
90
|
+
return self.as_dataframe()['timing'].sum()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: capytaine
|
|
3
|
-
Version:
|
|
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
|
|
@@ -689,26 +689,20 @@ Requires-Python: >=3.8
|
|
|
689
689
|
Requires-Dist: numpy>=1.20; python_version >= "3.9"
|
|
690
690
|
Requires-Dist: numpy>=1.24; python_version == "3.8"
|
|
691
691
|
Requires-Dist: scipy
|
|
692
|
-
Requires-Dist: pandas
|
|
692
|
+
Requires-Dist: pandas<3,>=1.3
|
|
693
693
|
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
|
-
Provides-Extra: more-optional
|
|
702
|
-
Requires-Dist: pygmsh; extra == "more-optional"
|
|
703
|
-
Requires-Dist: gmsh; extra == "more-optional"
|
|
704
|
-
Provides-Extra: test
|
|
705
|
-
Requires-Dist: pytest; extra == "test"
|
|
706
|
-
Requires-Dist: capytaine[optional]; extra == "test"
|
|
707
|
-
Provides-Extra: docs
|
|
708
|
-
Requires-Dist: sphinx; extra == "docs"
|
|
709
|
-
Requires-Dist: sphinx-toolbox; extra == "docs"
|
|
710
|
-
Requires-Dist: sphinxcontrib-proof; extra == "docs"
|
|
711
|
-
Requires-Dist: sphinxcontrib-mermaid; extra == "docs"
|
|
712
706
|
Description-Content-Type: text/markdown
|
|
713
707
|
|
|
714
708
|
# Capytaine: a linear potential flow BEM solver with Python.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
capytaine/__init__.py,sha256=fdEfZXF2pwTyT-VFiscWbiF_6fGpzyr5_o4P7tYasaY,1388
|
|
2
|
+
capytaine/__about__.py,sha256=9VGrAFJZe20ZPHFLE3a1LY5mmo_yvqh0oTZc6uyog_M,510
|
|
3
|
+
capytaine/ui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
capytaine/ui/rich.py,sha256=ZfMHUpCSVztNseIGpN2I69ts_Aw_HJ5RnZc0f73av5Q,233
|
|
5
|
+
capytaine/ui/cli.py,sha256=o3MH2OCHXFww1kb2zM9R3qs4jjfkCeeZFRAgnFnb2NE,797
|
|
6
|
+
capytaine/green_functions/Delhommeau_float32.cpython-312-darwin.so,sha256=4HKrQFY2Eqik0u9LbzwCRinl8-2DY5TxT7gXAes1xTw,363136
|
|
7
|
+
capytaine/green_functions/__init__.py,sha256=527Pd0SIqwR64-d4sT-_jyE89XU-PLgFL0et96ChAIo,107
|
|
8
|
+
capytaine/green_functions/Delhommeau_float64.cpython-312-darwin.so,sha256=J-tyT7Q7bzr_t-bk5SwEuDcJCUa8G-Byw2EpvQ7cfaA,399680
|
|
9
|
+
capytaine/green_functions/delhommeau.py,sha256=tAwJSFIlUh4Lxb3x2xRCJb496KTlTeOe00p3HY8q-kQ,24284
|
|
10
|
+
capytaine/green_functions/hams.py,sha256=HApi_OGay2cVt1nJxtZ849eEEsz4tK9ktxNNj2hrWo8,8267
|
|
11
|
+
capytaine/green_functions/abstract_green_function.py,sha256=gHwhzVB2KyDpjy5LTb80Hb2FOBmoKtpmPHCcMBlsEk4,2839
|
|
12
|
+
capytaine/bodies/dofs.py,sha256=WFT4snSkUFxxrdHsfxGAj5wc6aLWbqz8gLblhIlRWX8,5227
|
|
13
|
+
capytaine/bodies/bodies.py,sha256=aH3PDEN-ywFo2P8r4oh2zx7mOPRJcIUm8HihdQh1dV0,26102
|
|
14
|
+
capytaine/bodies/__init__.py,sha256=wIYFs14NAWqaHLQWvDGUEZTBWp_kdthKkbOlXHup6LA,157
|
|
15
|
+
capytaine/bodies/hydrostatics.py,sha256=9SUz-xqsizAMAciJhUn7ZT_tg78VZ-4PMNqXTKydgTk,26419
|
|
16
|
+
capytaine/bodies/multibodies.py,sha256=y6np-DpueJLu78ViOBApDWV5NTu86v8koTgI2OA9bb8,7880
|
|
17
|
+
capytaine/tools/cache_on_disk.py,sha256=Cj2J5pNKw9PbIvxUn53swSmuGJoMibZzIvB5Skt52ig,912
|
|
18
|
+
capytaine/tools/timer.py,sha256=2157o0Wm02GW5xHlTJR15gVgtGaGSIzOwR0FcMxmX5M,2602
|
|
19
|
+
capytaine/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
|
+
capytaine/tools/deprecation_handling.py,sha256=_QFNrkreLerm3-LzRZ3l6B_O249PM-fCCAXMsHA7kIU,809
|
|
21
|
+
capytaine/tools/block_circulant_matrices.py,sha256=2fRGtrWNTPtod02xt532p-VKZPJ5vsNa4R0cx0DQvc8,10977
|
|
22
|
+
capytaine/tools/optional_imports.py,sha256=HNjtvNZGxsw-eYmr4ejq001KhLevrvqq7ASAqTOw8W8,860
|
|
23
|
+
capytaine/tools/symbolic_multiplication.py,sha256=d0Ll0HOo8q_cPMt--ZBXQ5TZ4-Tw_VHmjoWz6Wy7r2E,5554
|
|
24
|
+
capytaine/tools/memory_monitor.py,sha256=UNG-yOCXqvCKK2fXbUj9rvVPHQnZk62R1b2EaHMC4YA,1427
|
|
25
|
+
capytaine/tools/lists_of_points.py,sha256=_yaQbBxWw5n61DoqndV21Q35kJhJK7sstc6Hcs_fXeA,1833
|
|
26
|
+
capytaine/tools/prony_decomposition.py,sha256=Eg8CcedPuLKVUA-wpjwXBJsnXjBGZruHVy4jMU2cCSM,5147
|
|
27
|
+
capytaine/bem/solver.py,sha256=z2P7asqt4UruV0LWe61a98f64btqXf1JyhY3xN9Efs4,35121
|
|
28
|
+
capytaine/bem/engines.py,sha256=G_CgTXe4fjrLiS0SiOdg6Ek0MkMUlMR6p1jy8mZW6RM,13125
|
|
29
|
+
capytaine/bem/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
30
|
+
capytaine/bem/problems_and_results.py,sha256=ryv4TDfGna1svW1QiYLnxSD281Ispto4IYIPtCJmIoY,27260
|
|
31
|
+
capytaine/bem/airy_waves.py,sha256=GAhX5xNEgjoOo2uEHXfKCxb2TnmbPBCqW6VWfvzJTM8,3498
|
|
32
|
+
capytaine/io/wamit.py,sha256=dvmthwIZnzOM8L1kq814pilCpQPLeTHvjjgg21hV2po,16028
|
|
33
|
+
capytaine/io/legacy.py,sha256=xWPznKSooZof9FOLLoogDu1ouvGgisx1TixdYazCEWY,10339
|
|
34
|
+
capytaine/io/bemio.py,sha256=WXT7QPJK0t2kgUdI0DOOQG8u5zh_zk9q_PmTXqW1dJE,7334
|
|
35
|
+
capytaine/io/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
36
|
+
capytaine/io/xarray.py,sha256=tbWUoqub56uddHfo0Nv1T6YcymipCo9m74PKgMsM3pY,27343
|
|
37
|
+
capytaine/.dylibs/libgfortran.5.dylib,sha256=6uNZS_KEqHsXxVzZp8qANpYBaOKVUp4PapKX4P8wvhE,1901520
|
|
38
|
+
capytaine/.dylibs/libquadmath.0.dylib,sha256=AtjHD7yn1DtR6T2PA-Ry7z9iJFiYF9eZ4dfkBVTFa6k,363936
|
|
39
|
+
capytaine/.dylibs/libgcc_s.1.1.dylib,sha256=a2klIEBZo0Ns9hxZzfO7_Aur4CtbIedHBYCDc5gRMbg,183040
|
|
40
|
+
capytaine/meshes/clean.py,sha256=xpbCiyEBxziCjEBaUN_izIkLinVGywGnwPT5rrggvF4,9824
|
|
41
|
+
capytaine/meshes/surface_integrals.py,sha256=JqQEIOz9fkMHEOHLva02zwvbS_Ed0q7qzDaVYUCG9wQ,3123
|
|
42
|
+
capytaine/meshes/io.py,sha256=xUU2WV00gcLduoP5db3eOGKgigh0OKdZY5-NGZfjxZg,17093
|
|
43
|
+
capytaine/meshes/abstract_meshes.py,sha256=kQE8phEGs92_HRPOEQiYcBkv8c2ECG06CVLPS_5gyd8,13050
|
|
44
|
+
capytaine/meshes/__init__.py,sha256=5K_nx-RnEGG2NO6o0HEO1YZ-eTFHQl0EL0sqF5UUSCM,102
|
|
45
|
+
capytaine/meshes/export.py,sha256=d3UFsMq0cvM2SIu537aii2kZkQn8GGxIRGO4pVvi2pg,2711
|
|
46
|
+
capytaine/meshes/visualization.py,sha256=HgTxmmar6owCp56eSMTC81pJmS8IwwN_sQE9S7haZbc,12384
|
|
47
|
+
capytaine/meshes/meshes.py,sha256=OPFa8d7QmQBmnn17nxjI7eoHfqhH2sgotv9aul-nleY,29805
|
|
48
|
+
capytaine/meshes/geometry.py,sha256=7rnVK87TFL8KrQ7fYfwaYQb6t2ME1beFG-Mb-HQjJjs,8833
|
|
49
|
+
capytaine/meshes/clip.py,sha256=QM3qWCBDAMacOywx5WugHM9aRYRXr7kNdtVxaw_FDw8,10729
|
|
50
|
+
capytaine/meshes/quality.py,sha256=D5EtbtBFiLccEeO89tfjBl17uipOeffOPoubQ4ZH5_4,4870
|
|
51
|
+
capytaine/meshes/symmetric_meshes.py,sha256=APRMDAZOHg-mNGLVSxpy7kyaeZJt1h2zfqwTOys2E_Y,24732
|
|
52
|
+
capytaine/meshes/predefined/rectangles.py,sha256=cjq_lOP43udVxxtvYGmMNuyHZChQlh_gZi9_Y6RMWh0,9471
|
|
53
|
+
capytaine/meshes/predefined/spheres.py,sha256=HgZpWV__gA5P5yCjCPpF7OdtW_FE7v5hjRwQHdhD_-g,1939
|
|
54
|
+
capytaine/meshes/predefined/__init__.py,sha256=uc2b-3UJi_4NnTkk6wRlbq5UTKOyRU7JTpMDdlUrjiY,365
|
|
55
|
+
capytaine/meshes/predefined/cylinders.py,sha256=ETG3P_44YFQucrsKGmLoSScvi3FQ3OXBF16QUYg39Og,13412
|
|
56
|
+
capytaine/post_pro/rao.py,sha256=kLePr2sbh38f-ydjQTIyeRuoDDqEootqwLSt575aGik,2293
|
|
57
|
+
capytaine/post_pro/free_surfaces.py,sha256=pNf3uBMJ7snD9I0dWRqZmLSVoPcH0vEc3jbwwL2kCOA,3016
|
|
58
|
+
capytaine/post_pro/__init__.py,sha256=fi9BE68OzphGjf08HYGcCPmZLJYnD-wHjz86QEXkBn8,274
|
|
59
|
+
capytaine/post_pro/kochin.py,sha256=8Dmc7Xt0qTPRzXjzZYfMywVdPa_eSRQxfrKEmDZhSpI,2067
|
|
60
|
+
capytaine/post_pro/impedance.py,sha256=gNMKkSyD4qN55_PrTZhrtsh2XsAbC3ciFCWtvpJLKLM,3492
|
|
61
|
+
capytaine-3.0.0a1.dist-info/RECORD,,
|
|
62
|
+
capytaine-3.0.0a1.dist-info/LICENSE,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
|
|
63
|
+
capytaine-3.0.0a1.dist-info/WHEEL,sha256=JnJiRvkXFaFU4HlzyoqCApZ07jy6hpFKd_LkfBpWZzk,122
|
|
64
|
+
capytaine-3.0.0a1.dist-info/entry_points.txt,sha256=R72-je8lc6ELm8ftt7lJ7f1aalnQs5BWYrGDBMexHII,53
|
|
65
|
+
capytaine-3.0.0a1.dist-info/METADATA,sha256=4YdZOR22xCmwIHWLYxDSR21K5JLNhiUGdOCEsDYI-NI,45296
|
|
@@ -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
|