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