polyhedral-gravity 2.1__cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl → 3.2rc1__cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.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.
@@ -0,0 +1,410 @@
1
+ Metadata-Version: 2.1
2
+ Name: polyhedral-gravity
3
+ Version: 3.2rc1
4
+ Summary: Package to compute full gravity tensor of a given constant density polyhedron for arbitrary points according to the geodetic convention
5
+ Home-page: UNKNOWN
6
+ Author: Jonas Schuhmacher
7
+ Author-email: jonas.schuhmacher@tum.de
8
+ License: GPLv3
9
+ Project-URL: Homepage, https://github.com/esa/polyhedral-gravity-model
10
+ Project-URL: Source, https://github.com/esa/polyhedral-gravity-model
11
+ Project-URL: Documentation, https://esa.github.io/polyhedral-gravity-model/
12
+ Project-URL: Issues, https://github.com/esa/polyhedral-gravity-model/issues
13
+ Project-URL: Changelog, https://github.com/esa/polyhedral-gravity-model/releases
14
+ Platform: UNKNOWN
15
+ Classifier: Development Status :: 5 - Production/Stable
16
+ Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
17
+ Classifier: Programming Language :: C++
18
+ Classifier: Programming Language :: Python
19
+ Classifier: Operating System :: Microsoft :: Windows
20
+ Classifier: Operating System :: MacOS
21
+ Classifier: Operating System :: POSIX :: Linux
22
+ Classifier: Intended Audience :: Science/Research
23
+ Classifier: Topic :: Scientific/Engineering :: Physics
24
+ Requires-Python: >=3.6
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE
27
+
28
+ # polyhedral-gravity-model
29
+
30
+ ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/esa/polyhedral-gravity-model/.github%2Fworkflows%2Fbuild-and-test.yml?logo=GitHub%20Actions&label=Build%20and%20Test)
31
+ ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/esa/polyhedral-gravity-model/.github%2Fworkflows%2Fdocs.yml?logo=GitBook&label=Documentation)
32
+ ![GitHub](https://img.shields.io/github/license/esa/polyhedral-gravity-model)
33
+
34
+ ![PyPI](https://img.shields.io/pypi/v/polyhedral-gravity)
35
+ ![Static Badge](https://img.shields.io/badge/platform-linux--64_%7C_win--64_%7C_osx--64_%7C_linux--arm64_%7C_osx--arm64-lightgrey)
36
+ ![PyPI - Downloads](https://img.shields.io/pypi/dm/polyhedral-gravity)
37
+
38
+ ![Conda](https://img.shields.io/conda/v/conda-forge/polyhedral-gravity-model)
39
+ ![Conda](https://img.shields.io/conda/pn/conda-forge/polyhedral-gravity-model)
40
+ ![Conda](https://img.shields.io/conda/dn/conda-forge/polyhedral-gravity-model)
41
+
42
+
43
+
44
+ ## Table of Contents
45
+
46
+ - [References](#references)
47
+ - [Documentation & Examples](#documentation--examples)
48
+ - [Input & Output (C++ and Python)](#input--output-c-and-python)
49
+ - [Minimal Python Example](#minimal-python-example)
50
+ - [Minimal C++ Example](#minimal-c-example)
51
+ - [Installation](#installation)
52
+ - [With conda](#with-conda)
53
+ - [With pip](#with-pip)
54
+ - [From source](#from-source)
55
+ - [C++ Library & Executable](#c-library--executable)
56
+ - [Building the C++ Library & Executable](#building-the-c-library--executable)
57
+ - [Running the C++ Executable](#running-the-c-executable)
58
+ - [Testing](#testing)
59
+ - [Contributing](#contributing)
60
+
61
+ ## References
62
+
63
+ This code is a validated implementation in C++17 of the Polyhedral Gravity Model
64
+ by Tsoulis et al.. It was created in a collaborative project between
65
+ TU Munich and ESA's Advanced Concepts Team. Please refer to the
66
+ [project report](https://mediatum.ub.tum.de/doc/1695208/1695208.pdf)
67
+ for extensive information about the theoretical background, related work,
68
+ implementation & design decisions, application, verification,
69
+ and runtime measurements of the presented code.
70
+
71
+ The implementation is based on the
72
+ paper [Tsoulis, D., 2012. Analytical computation of the full gravity tensor of a homogeneous arbitrarily shaped polyhedral source using line integrals. Geophysics, 77(2), pp.F1-F11.](http://dx.doi.org/10.1190/geo2010-0334.1)
73
+ and its corresponding implementation in FORTRAN.
74
+
75
+ Supplementary details can be found in the more recent
76
+ paper [TSOULIS, Dimitrios; GAVRIILIDOU, Georgia. A computational review of the line integral analytical formulation of the polyhedral gravity signal. Geophysical Prospecting, 2021, 69. Jg., Nr. 8-9, S. 1745-1760.](https://doi.org/10.1111/1365-2478.13134)
77
+ and its corresponding [implementation in MATLAB](https://github.com/Gavriilidou/GPolyhedron),
78
+ which is strongly based on the former implementation in FORTRAN.
79
+
80
+ ## Documentation & Examples
81
+
82
+ > [!NOTE]
83
+ > The [GitHub Pages](https://esa.github.io/polyhedral-gravity-model) of this project
84
+ contain the full extensive documentation of the C++ Library and Python Interface
85
+ as well as background on the gravity model and advanced settings not detailed here.
86
+
87
+ ## Input & Output (C++ and Python)
88
+
89
+ ### Input
90
+
91
+ The evaluation of the polyhedral gravity model requires the following parameters:
92
+
93
+ | Name |
94
+ |----------------------------------------------------------------------------|
95
+ | Polyhedral Mesh (either as vertices & faces or as polyhedral source files) |
96
+ | Constant Density $\rho$ |
97
+
98
+ The mesh and the constants density's unit must match.
99
+ Have a look the documentation to view the [supported mesh files](https://esa.github.io/polyhedral-gravity-model/quickstart/supported_input.html).
100
+
101
+ ### Output
102
+
103
+ The calculation outputs the following parameters for every Computation Point *P*.
104
+ The units of the respective output depend on the units of the input parameters (mesh and density)!
105
+ Hence, if e.g. your mesh is in $km$, the density must match. Further, output units will be different accordingly.
106
+
107
+ | Name | Unit (if mesh in $[m]$ and $\rho$ in $[kg/m^3]$) | Comment |
108
+ |:----------------------------------------------------------:|:------------------------------------------------:|:-----------------------------------------------------------------:|
109
+ | $V$ | $\frac{m^2}{s^2}$ or $\frac{J}{kg}$ | The potential or also called specific energy |
110
+ | $V_x$, $V_y$, $V_z$ | $\frac{m}{s^2}$ | The gravitational accerleration in the three cartesian directions |
111
+ | $V_{xx}$, $V_{yy}$, $V_{zz}$, $V_{xy}$, $V_{xz}$, $V_{yz}$ | $\frac{1}{s^2}$ | The spatial rate of change of the gravitational accleration |
112
+
113
+
114
+ >[!NOTE]
115
+ >This gravity model's output obeys to the geodesy and geophysics sign conventions.
116
+ Hence, the potential $V$ for a polyhedron with a mass $m > 0$ is defined as **positive**.
117
+ Accordingly, the accelerations are defined as $\textbf{g} = + \nabla V$.
118
+
119
+
120
+ ### Minimal Python Example
121
+
122
+ The following example shows how to use the python interface to compute the gravity
123
+ around a cube:
124
+
125
+ ```python
126
+ import numpy as np
127
+ from polyhedral_gravity import Polyhedron, GravityEvaluable, evaluate, PolyhedronIntegrity, NormalOrientation
128
+
129
+ # We define the cube as a polyhedron with 8 vertices and 12 triangular faces
130
+ # The polyhedron's normals point outwards (see below for checking this)
131
+ # The density is set to 1.0
132
+ cube_vertices = np.array(
133
+ [[-1, -1, -1], [1, -1, -1], [1, 1, -1], [-1, 1, -1],
134
+ [-1, -1, 1], [1, -1, 1], [1, 1, 1], [-1, 1, 1]]
135
+ )
136
+ cube_faces = np.array(
137
+ [[1, 3, 2], [0, 3, 1], [0, 1, 5], [0, 5, 4], [0, 7, 3], [0, 4, 7],
138
+ [1, 2, 6], [1, 6, 5], [2, 3, 6], [3, 7, 6], [4, 5, 6], [4, 6, 7]]
139
+ )
140
+ cube_density = 1.0
141
+ computation_point = np.array([0, 0, 0])
142
+ ```
143
+
144
+ We first define a constant density Polyhedron from `vertices` and `faces`
145
+
146
+ ```python
147
+ cube_polyhedron = Polyhedron(
148
+ polyhedral_source=(cube_vertices, cube_faces),
149
+ density=cube_density,
150
+ )
151
+ ```
152
+
153
+ In case you want to hand over the polyhedron via a [supported file format](https://esa.github.io/polyhedral-gravity-model/quickstart/supported_input.html),
154
+ just replace the `polyhedral_source` argument with *a list of strings*,
155
+ where each string is the path to a supported file format, e.g. `polyhedral_source=["eros.node","eros.face"]` or `polyhedral_source=["eros.mesh"]`.
156
+
157
+ Continuing, the simplest way to compute the gravity is to use the `evaluate` function:
158
+
159
+ ```python
160
+ potential, acceleration, tensor = evaluate(
161
+ polyhedron=cube_polyhedron,
162
+ computation_points=computation_point,
163
+ parallel=True,
164
+ )
165
+ ```
166
+
167
+ The more advanced way is to use the `GravityEvaluable` class. It caches the
168
+ internal data structure and properties which can be reused for multiple
169
+ evaluations. This is especially useful if you want to compute the gravity
170
+ for multiple computation points, but don't know the "future points" in advance.
171
+
172
+ ```python
173
+ evaluable = GravityEvaluable(polyhedron=cube_polyhedron) # stores intermediate computation steps
174
+ potential, acceleration, tensor = evaluable(
175
+ computation_points=computation_point,
176
+ parallel=True,
177
+ )
178
+ # Any future evaluable call after this one will be faster
179
+ ```
180
+
181
+ Note that the `computation_point` could also be (N, 3)-shaped array to compute multiple points at once.
182
+ In this case, the return value of `evaluate(..)` or an `GravityEvaluable` will
183
+ be a list of triplets comprising potential, acceleration, and tensor.
184
+
185
+ The gravity model requires that all the polyhedron's plane unit normals consistently
186
+ point outwards or inwards the polyhedron. You can specify this via the `normal_orientation`.
187
+ This property is - by default - checked when constructing the `Polyhedron`! So, don't worry, it
188
+ is impossible if not **explicitly** disabled to create an invalid `Polyhedron`.
189
+ You can disable/ enable this setting via the optional `integrity_check` flag and can even
190
+ automatically repair the ordering via `HEAL`.
191
+ If you are confident that your mesh is defined correctly (e.g. checked once with the integrity check)
192
+ you can disable this check (via `DISABLE`) to avoid the additional runtime overhead of the check.
193
+
194
+ ```python
195
+ cube_polyhedron = Polyhedron(
196
+ polyhedral_source=(cube_vertices, cube_faces),
197
+ density=cube_density,
198
+ normal_orientation=NormalOrientation.INWARDS, # OUTWARDS (default) or INWARDS
199
+ integrity_check=PolyhedronIntegrity.VERIFY, # VERIFY (default), DISABLE or HEAL
200
+ )
201
+ ```
202
+
203
+ > [!TIP]
204
+ > More examples and plots are depicted in the
205
+ [jupyter notebook](script/polyhedral-gravity.ipynb).
206
+
207
+
208
+ ### Minimal C++ Example
209
+
210
+ The following example shows how to use the C++ library to compute the gravity.
211
+ It works analogously to the Python example above.
212
+
213
+ ```cpp
214
+ // Defining the input like above in the Python example
215
+ std::vector<std::array<double, 3>> vertices = ...
216
+ std::vector<std::array<size_t, 3>> faces = ...
217
+ double density = 1.0;
218
+ // The constant density polyhedron is defined by its vertices & faces
219
+ // It also supports the hand-over of NormalOrientation and PolyhedronIntegrity as optional arguments
220
+ // as above described for the Python Interface
221
+ Polyhedron polyhedron{vertices, faces, density};
222
+ std::vector<std::array<double, 3>> points = ...
223
+ std::array<double, 3> point = points[0];
224
+ bool parallel = true;
225
+ ```
226
+
227
+ The C++ library provides also two ways to compute the gravity. Via
228
+ the free function `evaluate`...
229
+
230
+ ```cpp
231
+ const auto[pot, acc, tensor] = GravityModel::evaluate(polyhedron, point, parallel);
232
+ ```
233
+
234
+ ... or via the `GravityEvaluable` class.
235
+
236
+ ```cpp
237
+ // Instantiation of the GravityEvaluable object
238
+ GravityEvaluable evaluable{polyhedron};
239
+
240
+ // From now, we can evaluate the gravity model for any point with
241
+ const auto[potential, acceleration, tensor] = evaluable(point, parallel);
242
+ // or for multiple points with
243
+ const auto results = evaluable(points, parallel);
244
+ ```
245
+
246
+ Similarly to Python, the C++ implementation also provides mesh checking capabilities.
247
+
248
+ > [!TIP]
249
+ > For reference, have a look at [the main method](./src/main.cpp) of the C++ executable.
250
+
251
+ ## Installation
252
+
253
+ ### With conda
254
+
255
+ The python interface can be easily installed with
256
+ [conda](https://anaconda.org/conda-forge/polyhedral-gravity-model):
257
+
258
+ ```bash
259
+ conda install -c conda-forge polyhedral-gravity-model
260
+ ```
261
+
262
+ ### With pip
263
+
264
+ As a second option, you can also install the python interface with pip from [PyPi](https://pypi.org/project/polyhedral-gravity/).
265
+
266
+ ```bash
267
+ pip install polyhedral-gravity
268
+ ```
269
+
270
+ Binaries for the most common platforms are available on PyPI including
271
+ Windows, Linux and macOS. For macOS and Linux, binaries for
272
+ `x86_64` and `aarch64` are provided.
273
+ In case `pip` uses the source distribution, please make sure that
274
+ you have a C++17 capable compiler and CMake installed.
275
+
276
+ ### From source
277
+
278
+ The project uses the following dependencies,
279
+ all of them are **automatically** set-up via CMake:
280
+
281
+ - GoogleTest (1.13.0 or compatible), only required for testing
282
+ - spdlog (1.11.0 or compatible), required for logging
283
+ - tetgen (1.6 or compatible), required for I/O
284
+ - yaml-cpp (0.7.0 or compatible), required for I/O
285
+ - thrust (2.1.0 or compatible), required for parallelization and utility
286
+ - xsimd (11.1.0 or compatible), required for vectorization of the `atan(..)`
287
+ - pybind11 (2.10.4 or compatible), required for the Python interface, but not the C++ standalone
288
+
289
+ The module will be build using a C++17 capable compiler,
290
+ CMake. Just execute the following command in
291
+ the repository root folder:
292
+
293
+ ```bash
294
+ pip install .
295
+ ```
296
+
297
+ To modify the build options (like parallelization) have a look
298
+ at the [next paragraph](#building-the-c-library--executable). The options
299
+ are modified by setting the environment variables before executing
300
+ the `pip install .` command, e.g.:
301
+
302
+ ```bash
303
+ export POLYHEDRAL_GRAVITY_PARALLELIZATION="TBB"
304
+ pip install .
305
+ ```
306
+
307
+ (Optional: For a faster build you can install all dependencies available
308
+ for your system in your local python environment. That way, they
309
+ won't be fetched from GitHub.)
310
+
311
+ ## C++ Library & Executable
312
+
313
+ ### Building the C++ Library & Executable
314
+
315
+ The program is build by using CMake. So first make sure that you installed
316
+ CMake and then follow these steps:
317
+
318
+ ```bash
319
+ mkdir build
320
+ cd build
321
+ cmake .. <options>
322
+ cmake --build .
323
+ ```
324
+
325
+ The following options are available:
326
+
327
+ | Name (Default) | Options |
328
+ |-------------------------------------------:|:-------------------------------------------------------------------------------------------|
329
+ | POLYHEDRAL_GRAVITY_PARALLELIZATION (`CPP`) | `CPP` = Serial Execution / `OMP` or `TBB` = Parallel Execution with OpenMP or Intel\'s TBB |
330
+ | LOGGING_LEVEL (`2`) | `0` = TRACE/ `1` = DEBUG/ `2` = INFO / `3` = WARN/ `4` = ERROR/ `5` = CRITICAL/ `6` = OFF |
331
+ | USE_LOCAL_TBB (`OFF`) | Use a local installation of `TBB` instead of setting it up via `CMake` |
332
+ | BUILD_POLYHEDRAL_GRAVITY_DOCS (`OFF`) | Build this documentation |
333
+ | BUILD_POLYHEDRAL_GRAVITY_TESTS (`ON`) | Build the Tests |
334
+ | BUILD_POLYHEDRAL_PYTHON_INTERFACE (`ON`) | Build the Python interface |
335
+
336
+ During testing POLYHEDRAL_GRAVITY_PARALLELIZATION=`TBB` has been the most performant.
337
+ It is further not recommend to change the LOGGING_LEVEL to something else than `INFO=2`.
338
+
339
+ The recommended CMake settings using the `TBB` backend would look like this:
340
+
341
+ ```bash
342
+ cmake .. -POLYHEDRAL_GRAVITY_PARALLELIZATION="TBB"
343
+ ```
344
+
345
+ ### Running the C++ Executable
346
+
347
+ After the build, the gravity model can be run by executing:
348
+
349
+ ```bash
350
+ ./polyhedralGravity <YAML-Configuration-File>
351
+ ```
352
+
353
+ where the YAML-Configuration-File contains the required parameters.
354
+ Examples for Configuration Files and Polyhedral Source Files can be
355
+ found in this repository in the folder `/example-config/`.
356
+
357
+ #### Input Configuration File
358
+
359
+ The configuration should look similar to the given example below.
360
+ It is required to specify the source-files of the polyhedron's mesh (more info
361
+ about the supported file in the [documentation](https://esa.github.io/polyhedral-gravity-model/quickstart/supported_input.html)), the density
362
+ of the polyhedron, and the wished computation points where the
363
+ gravity tensor shall be computed.
364
+ Further one must specify the name of the .csv output file.
365
+
366
+ ````yaml
367
+ ---
368
+ gravityModel:
369
+ input:
370
+ polyhedron: #polyhedron source-file(s)
371
+ - "../example-config/data/tsoulis.node" # .node contains the vertices
372
+ - "../example-config/data/tsoulis.face" # .face contains the triangular faces
373
+ density: 2670.0 # constant density, units must match with the mesh (see section below)
374
+ points: # Location of the computation point(s) P
375
+ - [ 0, 0, 0 ] # Here it is situated at the origin
376
+ check_mesh: true # Fully optional, enables mesh autodetect+repair of
377
+ # the polyhedron's vertex ordering (not given: true)
378
+ output:
379
+ filename: "gravity_result.csv" # The name of the output file
380
+
381
+ ````
382
+
383
+ #### Output
384
+
385
+ The executable produces a CSV file containing $V$, $V_x$, $V_y$, $V_z$,
386
+ $V_{xx}$, $V_{yy}$, $V_{zz}$, $V_{xy}$, $V_{xz}$, $V_{yz}$ for every
387
+ computation point *P*.
388
+
389
+ ## Testing
390
+
391
+ The project uses GoogleTest for testing. In oder to execute those
392
+ tests just execute the following command in the build directory:
393
+
394
+ ```bash
395
+ ctest
396
+ ```
397
+
398
+ For the Python test suite, please execute the following command in the repository root folder:
399
+
400
+ ```bash
401
+ pytest
402
+ ```
403
+
404
+ ## Contributing
405
+
406
+ We are happy to accept contributions to the project in the form of
407
+ suggestions, bug reports and pull requests. Please have a look at
408
+ the [contributing guidelines](CONTRIBUTING.md) for more information.
409
+
410
+
@@ -0,0 +1,6 @@
1
+ polyhedral_gravity.cpython-36m-aarch64-linux-gnu.so,sha256=tUm3sUuqSHW2Yzi10HLONva-yBmRUO09goTWoC9Qjy0,1716392
2
+ polyhedral_gravity-3.2rc1.dist-info/LICENSE,sha256=ZJuIRhVUKcE6znMu3JzQKChvng_3yKh9v3v1MtHspHw,36310
3
+ polyhedral_gravity-3.2rc1.dist-info/METADATA,sha256=02Zq7K4NGbATO3xo5zzVUI7gjbnsVFPKfEMwQORFXn8,17494
4
+ polyhedral_gravity-3.2rc1.dist-info/RECORD,,
5
+ polyhedral_gravity-3.2rc1.dist-info/top_level.txt,sha256=bIf9hErNs1GV27AnQWoRTE2j0lRmjhrKI1z-_MTR4Nk,19
6
+ polyhedral_gravity-3.2rc1.dist-info/WHEEL,sha256=ZPo-cudG-FPYxyq1LXmKAMnRyaidvTmBVvSIj1CJfHY,152
@@ -1,18 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: polyhedral-gravity
3
- Version: 2.1
4
- Summary: Package to compute full gravity tensor of a given constant density polyhedron for arbitrary points
5
- Home-page: UNKNOWN
6
- Author: Jonas Schuhmacher
7
- Author-email: jonas.schuhmacher@tum.de
8
- License: GPLv3
9
- Platform: UNKNOWN
10
- Requires-Python: >=3.6
11
- License-File: LICENSE
12
-
13
-
14
- The package polyhedral_gravity provides a simple to use interface for the evaluation of the full gravity
15
- tensor of a constant density polyhedron at given computation points. It is based on a fast, parallelized
16
- backbone in C++ capable of evaluating the gravity at thousands of computation points in the fraction of a second.
17
-
18
-
@@ -1,6 +0,0 @@
1
- polyhedral_gravity.cpython-36m-aarch64-linux-gnu.so,sha256=K8CvKzgifefmSCCkNoP1MOucWmivicdUiJCH7D3EjkQ,1452576
2
- polyhedral_gravity-2.1.dist-info/top_level.txt,sha256=bIf9hErNs1GV27AnQWoRTE2j0lRmjhrKI1z-_MTR4Nk,19
3
- polyhedral_gravity-2.1.dist-info/WHEEL,sha256=ZPo-cudG-FPYxyq1LXmKAMnRyaidvTmBVvSIj1CJfHY,152
4
- polyhedral_gravity-2.1.dist-info/METADATA,sha256=xXIF_vWSX-eaJuCAdZ-0KxmPiO7IlRHtetCexNNrXoQ,686
5
- polyhedral_gravity-2.1.dist-info/RECORD,,
6
- polyhedral_gravity-2.1.dist-info/LICENSE,sha256=ZJuIRhVUKcE6znMu3JzQKChvng_3yKh9v3v1MtHspHw,36310