polyhedral-gravity 3.3rc1__tar.gz → 3.3.1rc1__tar.gz

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 (58) hide show
  1. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/CMakeLists.txt +9 -1
  2. {polyhedral_gravity-3.3rc1/polyhedral_gravity.egg-info → polyhedral_gravity-3.3.1rc1}/PKG-INFO +26 -25
  3. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/README.md +22 -22
  4. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/cmake/clang_format.cmake +7 -8
  5. polyhedral_gravity-3.3.1rc1/cmake/cmake_format.cmake +25 -0
  6. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/cmake/git.cmake +36 -1
  7. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1/polyhedral_gravity.egg-info}/PKG-INFO +26 -25
  8. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/polyhedral_gravity.egg-info/SOURCES.txt +1 -0
  9. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/setup.py +21 -5
  10. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/src/polyhedralGravity/input/MeshReader.cpp +6 -0
  11. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/src/polyhedralGravity/input/MeshReader.h +3 -1
  12. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/src/polyhedralGravityPython/PolyhedralGravityPython.cpp +5 -2
  13. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/LICENSE +0 -0
  14. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/MANIFEST.in +0 -0
  15. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/cmake/FindSphinx.cmake +0 -0
  16. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/cmake/gtest.cmake +0 -0
  17. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/cmake/pybind11.cmake +0 -0
  18. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/cmake/spdlog.cmake +0 -0
  19. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/cmake/tbb.cmake +0 -0
  20. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/cmake/tetgen.cmake +0 -0
  21. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/cmake/thrust.cmake +0 -0
  22. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/cmake/xsimd.cmake +0 -0
  23. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/cmake/yaml.cmake +0 -0
  24. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/polyhedral_gravity.egg-info/dependency_links.txt +0 -0
  25. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/polyhedral_gravity.egg-info/not-zip-safe +0 -0
  26. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/polyhedral_gravity.egg-info/top_level.txt +0 -0
  27. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/setup.cfg +0 -0
  28. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/src/CMakeLists.txt +0 -0
  29. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/src/main.cpp +0 -0
  30. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/src/polyhedralGravity/CMakeLists.txt +0 -0
  31. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/src/polyhedralGravity/Info.h.in +0 -0
  32. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/src/polyhedralGravity/input/ConfigSource.h +0 -0
  33. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/src/polyhedralGravity/input/TetgenAdapter.cpp +0 -0
  34. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/src/polyhedralGravity/input/TetgenAdapter.h +0 -0
  35. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/src/polyhedralGravity/input/YAMLConfigReader.cpp +0 -0
  36. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/src/polyhedralGravity/input/YAMLConfigReader.h +0 -0
  37. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/src/polyhedralGravity/model/GravityEvaluable.cpp +0 -0
  38. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/src/polyhedralGravity/model/GravityEvaluable.h +0 -0
  39. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/src/polyhedralGravity/model/GravityModel.cpp +0 -0
  40. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/src/polyhedralGravity/model/GravityModel.h +0 -0
  41. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/src/polyhedralGravity/model/GravityModelData.h +0 -0
  42. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/src/polyhedralGravity/model/GravityModelDetail.cpp +0 -0
  43. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/src/polyhedralGravity/model/GravityModelDetail.h +0 -0
  44. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/src/polyhedralGravity/model/Polyhedron.cpp +0 -0
  45. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/src/polyhedralGravity/model/Polyhedron.h +0 -0
  46. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/src/polyhedralGravity/model/PolyhedronDefinitions.cpp +0 -0
  47. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/src/polyhedralGravity/model/PolyhedronDefinitions.h +0 -0
  48. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/src/polyhedralGravity/output/CSVWriter.cpp +0 -0
  49. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/src/polyhedralGravity/output/CSVWriter.h +0 -0
  50. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/src/polyhedralGravity/output/Logging.cpp +0 -0
  51. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/src/polyhedralGravity/output/Logging.h +0 -0
  52. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/src/polyhedralGravity/util/UtilityConstants.h +0 -0
  53. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/src/polyhedralGravity/util/UtilityContainer.h +0 -0
  54. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/src/polyhedralGravity/util/UtilityFloatArithmetic.cpp +0 -0
  55. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/src/polyhedralGravity/util/UtilityFloatArithmetic.h +0 -0
  56. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/src/polyhedralGravity/util/UtilityString.h +0 -0
  57. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/src/polyhedralGravity/util/UtilityThrust.h +0 -0
  58. {polyhedral_gravity-3.3rc1 → polyhedral_gravity-3.3.1rc1}/src/polyhedralGravityPython/CMakeLists.txt +0 -0
@@ -43,11 +43,18 @@ option(BUILD_POLYHEDRAL_GRAVITY_PYTHON_INTERFACE "Set this to on if the python i
43
43
  # Option to build tests or not
44
44
  option(BUILD_POLYHEDRAL_GRAVITY_TESTS "Set to on if the tests should be built (Default: ON)" ON)
45
45
 
46
- IF(_LIBCPP_DISABLE_AVAILABILITY)
46
+ if (_LIBCPP_DISABLE_AVAILABILITY)
47
47
  message(STATUS "Disabling availability macros for libc++")
48
48
  add_definitions(-D_LIBCPP_DISABLE_AVAILABILITY)
49
49
  endif ()
50
50
 
51
+ if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" AND (${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang"))
52
+ # Fixes undefined _VSTD when using Apple Clang 17
53
+ message(STATUS "Using Apple Clang compiler. Defining _VSTD=std.")
54
+ add_definitions(-D_VSTD=std)
55
+ endif()
56
+
57
+
51
58
  # Resolves missing fmt symbols when working with spdlog (bundled via brew/ conda on Arm architecture)
52
59
  # Refer to https://github.com/gabime/spdlog/issues/660
53
60
  add_compile_definitions(FMT_HEADER_ONLY)
@@ -76,6 +83,7 @@ include(spdlog)
76
83
  include(tetgen)
77
84
  include(xsimd)
78
85
  include(clang_format)
86
+ include(cmake_format)
79
87
 
80
88
  ###############################
81
89
  # Thrust Parallelization Set-Up
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: polyhedral_gravity
3
- Version: 3.3rc1
3
+ Version: 3.3.1rc1
4
4
  Summary: Package to compute full gravity tensor of a given constant density polyhedron for arbitrary points according to the geodetic convention
5
5
  Author: Jonas Schuhmacher
6
6
  Author-email: jonas.schuhmacher@tum.de
@@ -19,7 +19,7 @@ Classifier: Operating System :: MacOS
19
19
  Classifier: Operating System :: POSIX :: Linux
20
20
  Classifier: Intended Audience :: Science/Research
21
21
  Classifier: Topic :: Scientific/Engineering :: Physics
22
- Requires-Python: >=3.8
22
+ Requires-Python: >=3.9
23
23
  Description-Content-Type: text/markdown
24
24
  License-File: LICENSE
25
25
  Dynamic: author
@@ -28,6 +28,7 @@ Dynamic: classifier
28
28
  Dynamic: description
29
29
  Dynamic: description-content-type
30
30
  Dynamic: license
31
+ Dynamic: license-file
31
32
  Dynamic: project-url
32
33
  Dynamic: requires-python
33
34
  Dynamic: summary
@@ -104,20 +105,20 @@ The evaluation of the polyhedral gravity model requires the following parameters
104
105
  | Polyhedral Mesh (either as vertices & faces or as polyhedral source files) |
105
106
  | Constant Density $\rho$ |
106
107
 
107
- The mesh and the constants density's unit must match.
108
- Have a look the documentation to view the [supported mesh files](https://esa.github.io/polyhedral-gravity-model/quickstart/supported_input.html).
108
+ The mesh and the constant density's unit must match.
109
+ Have a look at the documentation to view the [supported mesh files](https://esa.github.io/polyhedral-gravity-model/quickstart/supported_input.html).
109
110
 
110
111
  ### Output
111
112
 
112
113
  The calculation outputs the following parameters for every Computation Point *P*.
113
114
  The units of the respective output depend on the units of the input parameters (mesh and density)!
114
- Hence, if e.g. your mesh is in $km$, the density must match. Further, output units will be different accordingly.
115
+ Hence, if e.g., your mesh is in $km$, the density must match. Further, output units will be different accordingly.
115
116
 
116
- | Name | Unit (if mesh in $[m]$ and $\rho$ in $[kg/m^3]$) | Comment |
117
- |:----------------------------------------------------------:|:------------------------------------------------:|:-----------------------------------------------------------------:|
118
- | $V$ | $\frac{m^2}{s^2}$ or $\frac{J}{kg}$ | The potential or also called specific energy |
119
- | $V_x$, $V_y$, $V_z$ | $\frac{m}{s^2}$ | The gravitational accerleration in the three cartesian directions |
120
- | $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 |
117
+ | Name | Unit (if mesh in $[m]$ and $\rho$ in $[kg/m^3]$) | Comment |
118
+ |:----------------------------------------------------------:|:------------------------------------------------:|:----------------------------------------------------------------:|
119
+ | $V$ | $\frac{m^2}{s^2}$ or $\frac{J}{kg}$ | The potential or also called specific energy |
120
+ | $V_x$, $V_y$, $V_z$ | $\frac{m}{s^2}$ | The gravitational acceleration in the three cartesian directions |
121
+ | $V_{xx}$, $V_{yy}$, $V_{zz}$, $V_{xy}$, $V_{xz}$, $V_{yz}$ | $\frac{1}{s^2}$ | The spatial rate of change of the gravitational acceleration |
121
122
 
122
123
 
123
124
  >[!NOTE]
@@ -176,7 +177,7 @@ potential, acceleration, tensor = evaluate(
176
177
  The more advanced way is to use the `GravityEvaluable` class. It caches the
177
178
  internal data structure and properties which can be reused for multiple
178
179
  evaluations. This is especially useful if you want to compute the gravity
179
- for multiple computation points, but don't know the "future points" in advance.
180
+ for multiple computation points but don't know the "future points" in advance.
180
181
 
181
182
  ```python
182
183
  evaluable = GravityEvaluable(polyhedron=cube_polyhedron) # stores intermediate computation steps
@@ -197,7 +198,7 @@ This property is - by default - checked when constructing the `Polyhedron`! So,
197
198
  is impossible if not **explicitly** disabled to create an invalid `Polyhedron`.
198
199
  You can disable/ enable this setting via the optional `integrity_check` flag and can even
199
200
  automatically repair the ordering via `HEAL`.
200
- If you are confident that your mesh is defined correctly (e.g. checked once with the integrity check)
201
+ If you are confident that your mesh is defined correctly (e.g., checked once with the integrity check)
201
202
  you can disable this check (via `DISABLE`) to avoid the additional runtime overhead of the check.
202
203
  Also, you can set the metric unit of the mesh and the density.
203
204
  This also influences the output unit. E.g., Density in $kg/m^3$, Mesh in $m$, then the potential is given in $m^2/s^2$.
@@ -279,8 +280,8 @@ As a second option, you can also install the python interface with pip from [PyP
279
280
  pip install polyhedral-gravity
280
281
  ```
281
282
 
282
- Binaries for the most common platforms are available on PyPI including
283
- Windows, Linux and macOS. For macOS and Linux, binaries for
283
+ Binaries for the most common platforms are available on PyPI, including
284
+ Windows, Linux, and macOS. For macOS and Linux, binaries for
284
285
  `x86_64` and `aarch64` are provided.
285
286
  In case `pip` uses the source distribution, please make sure that
286
287
  you have a C++17 capable compiler and CMake installed.
@@ -288,7 +289,7 @@ you have a C++17 capable compiler and CMake installed.
288
289
  ### From source
289
290
 
290
291
  The project uses the following dependencies,
291
- all of them are **automatically** set-up via CMake:
292
+ all of them are **automatically** set up via CMake:
292
293
 
293
294
  - GoogleTest (1.15.2 or compatible), only required for testing
294
295
  - spdlog (1.13.0 or compatible), required for logging
@@ -298,7 +299,7 @@ all of them are **automatically** set-up via CMake:
298
299
  - xsimd (11.1.0 or compatible), required for vectorization of the `atan(..)`
299
300
  - pybind11 (2.12.0 or compatible), required for the Python interface, but not the C++ standalone
300
301
 
301
- The module will be build using a C++17 capable compiler,
302
+ The module will be built using a C++17 capable compiler,
302
303
  CMake. Just execute the following command in
303
304
  the repository root folder:
304
305
 
@@ -316,7 +317,7 @@ export POLYHEDRAL_GRAVITY_PARALLELIZATION="TBB"
316
317
  pip install .
317
318
  ```
318
319
 
319
- (Optional: For a faster build you can install all dependencies available
320
+ (Optional: For a faster build, you can install all dependencies available
320
321
  for your system in your local python environment. That way, they
321
322
  won't be fetched from GitHub.)
322
323
 
@@ -324,7 +325,7 @@ won't be fetched from GitHub.)
324
325
 
325
326
  ### Building the C++ Library & Executable
326
327
 
327
- The program is build by using CMake. So first make sure that you installed
328
+ The program is built by using CMake. So first make sure that you installed
328
329
  CMake and then follow these steps:
329
330
 
330
331
  ```bash
@@ -345,7 +346,7 @@ The following options are available:
345
346
  | BUILD_POLYHEDRAL_GRAVITY_PYTHON_INTERFACE (`ON`) | Build the Python interface |
346
347
 
347
348
  During testing POLYHEDRAL_GRAVITY_PARALLELIZATION=`TBB` has been the most performant.
348
- It is further not recommend to change the POLYHEDRAL_GRAVITY_LOGGING_LEVEL to something else than `INFO=2`.
349
+ It is further not recommended to change the POLYHEDRAL_GRAVITY_LOGGING_LEVEL to something else than `INFO=2`.
349
350
 
350
351
  The recommended CMake settings using the `TBB` backend would look like this:
351
352
 
@@ -372,7 +373,7 @@ It is required to specify the source-files of the polyhedron's mesh (more info
372
373
  about the supported file in the [documentation](https://esa.github.io/polyhedral-gravity-model/quickstart/supported_input.html)), the density
373
374
  of the polyhedron, and the wished computation points where the
374
375
  gravity tensor shall be computed.
375
- Further one must specify the name of the .csv output file.
376
+ Further, one must specify the name of the .csv output file.
376
377
 
377
378
  ````yaml
378
379
  ---
@@ -381,7 +382,7 @@ gravityModel:
381
382
  polyhedron: # polyhedron source-file(s)
382
383
  - "../example-config/data/tsoulis.node" # .node contains the vertices
383
384
  - "../example-config/data/tsoulis.face" # .face contains the triangular faces
384
- density: 2670.0 # constant density, units must match with the mesh (see section below)
385
+ density: 2670.0 # constant density, units must match with the mesh (see a section below)
385
386
  # Depends on metric_unit: 'km' -> kg/km^3, 'm' -> kg/m^3, 'unitless' -> 'unitless'
386
387
  points: # Location of the computation point(s) P
387
388
  - [ 0, 0, 0 ] # Here it is situated at the origin
@@ -400,8 +401,8 @@ computation point *P*.
400
401
 
401
402
  ## Testing
402
403
 
403
- The project uses GoogleTest for testing. In oder to execute those
404
- tests just execute the following command in the build directory:
404
+ The project uses GoogleTest for testing.
405
+ In order to execute those tests, just execute the following command in the build directory:
405
406
 
406
407
  ```bash
407
408
  ctest
@@ -416,5 +417,5 @@ pytest
416
417
  ## Contributing
417
418
 
418
419
  We are happy to accept contributions to the project in the form of
419
- suggestions, bug reports and pull requests. Please have a look at
420
+ suggestions, bug reports, and pull requests. Please have a look at
420
421
  the [contributing guidelines](CONTRIBUTING.md) for more information.
@@ -76,20 +76,20 @@ The evaluation of the polyhedral gravity model requires the following parameters
76
76
  | Polyhedral Mesh (either as vertices & faces or as polyhedral source files) |
77
77
  | Constant Density $\rho$ |
78
78
 
79
- The mesh and the constants density's unit must match.
80
- Have a look the documentation to view the [supported mesh files](https://esa.github.io/polyhedral-gravity-model/quickstart/supported_input.html).
79
+ The mesh and the constant density's unit must match.
80
+ Have a look at the documentation to view the [supported mesh files](https://esa.github.io/polyhedral-gravity-model/quickstart/supported_input.html).
81
81
 
82
82
  ### Output
83
83
 
84
84
  The calculation outputs the following parameters for every Computation Point *P*.
85
85
  The units of the respective output depend on the units of the input parameters (mesh and density)!
86
- Hence, if e.g. your mesh is in $km$, the density must match. Further, output units will be different accordingly.
86
+ Hence, if e.g., your mesh is in $km$, the density must match. Further, output units will be different accordingly.
87
87
 
88
- | Name | Unit (if mesh in $[m]$ and $\rho$ in $[kg/m^3]$) | Comment |
89
- |:----------------------------------------------------------:|:------------------------------------------------:|:-----------------------------------------------------------------:|
90
- | $V$ | $\frac{m^2}{s^2}$ or $\frac{J}{kg}$ | The potential or also called specific energy |
91
- | $V_x$, $V_y$, $V_z$ | $\frac{m}{s^2}$ | The gravitational accerleration in the three cartesian directions |
92
- | $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 |
88
+ | Name | Unit (if mesh in $[m]$ and $\rho$ in $[kg/m^3]$) | Comment |
89
+ |:----------------------------------------------------------:|:------------------------------------------------:|:----------------------------------------------------------------:|
90
+ | $V$ | $\frac{m^2}{s^2}$ or $\frac{J}{kg}$ | The potential or also called specific energy |
91
+ | $V_x$, $V_y$, $V_z$ | $\frac{m}{s^2}$ | The gravitational acceleration in the three cartesian directions |
92
+ | $V_{xx}$, $V_{yy}$, $V_{zz}$, $V_{xy}$, $V_{xz}$, $V_{yz}$ | $\frac{1}{s^2}$ | The spatial rate of change of the gravitational acceleration |
93
93
 
94
94
 
95
95
  >[!NOTE]
@@ -148,7 +148,7 @@ potential, acceleration, tensor = evaluate(
148
148
  The more advanced way is to use the `GravityEvaluable` class. It caches the
149
149
  internal data structure and properties which can be reused for multiple
150
150
  evaluations. This is especially useful if you want to compute the gravity
151
- for multiple computation points, but don't know the "future points" in advance.
151
+ for multiple computation points but don't know the "future points" in advance.
152
152
 
153
153
  ```python
154
154
  evaluable = GravityEvaluable(polyhedron=cube_polyhedron) # stores intermediate computation steps
@@ -169,7 +169,7 @@ This property is - by default - checked when constructing the `Polyhedron`! So,
169
169
  is impossible if not **explicitly** disabled to create an invalid `Polyhedron`.
170
170
  You can disable/ enable this setting via the optional `integrity_check` flag and can even
171
171
  automatically repair the ordering via `HEAL`.
172
- If you are confident that your mesh is defined correctly (e.g. checked once with the integrity check)
172
+ If you are confident that your mesh is defined correctly (e.g., checked once with the integrity check)
173
173
  you can disable this check (via `DISABLE`) to avoid the additional runtime overhead of the check.
174
174
  Also, you can set the metric unit of the mesh and the density.
175
175
  This also influences the output unit. E.g., Density in $kg/m^3$, Mesh in $m$, then the potential is given in $m^2/s^2$.
@@ -251,8 +251,8 @@ As a second option, you can also install the python interface with pip from [PyP
251
251
  pip install polyhedral-gravity
252
252
  ```
253
253
 
254
- Binaries for the most common platforms are available on PyPI including
255
- Windows, Linux and macOS. For macOS and Linux, binaries for
254
+ Binaries for the most common platforms are available on PyPI, including
255
+ Windows, Linux, and macOS. For macOS and Linux, binaries for
256
256
  `x86_64` and `aarch64` are provided.
257
257
  In case `pip` uses the source distribution, please make sure that
258
258
  you have a C++17 capable compiler and CMake installed.
@@ -260,7 +260,7 @@ you have a C++17 capable compiler and CMake installed.
260
260
  ### From source
261
261
 
262
262
  The project uses the following dependencies,
263
- all of them are **automatically** set-up via CMake:
263
+ all of them are **automatically** set up via CMake:
264
264
 
265
265
  - GoogleTest (1.15.2 or compatible), only required for testing
266
266
  - spdlog (1.13.0 or compatible), required for logging
@@ -270,7 +270,7 @@ all of them are **automatically** set-up via CMake:
270
270
  - xsimd (11.1.0 or compatible), required for vectorization of the `atan(..)`
271
271
  - pybind11 (2.12.0 or compatible), required for the Python interface, but not the C++ standalone
272
272
 
273
- The module will be build using a C++17 capable compiler,
273
+ The module will be built using a C++17 capable compiler,
274
274
  CMake. Just execute the following command in
275
275
  the repository root folder:
276
276
 
@@ -288,7 +288,7 @@ export POLYHEDRAL_GRAVITY_PARALLELIZATION="TBB"
288
288
  pip install .
289
289
  ```
290
290
 
291
- (Optional: For a faster build you can install all dependencies available
291
+ (Optional: For a faster build, you can install all dependencies available
292
292
  for your system in your local python environment. That way, they
293
293
  won't be fetched from GitHub.)
294
294
 
@@ -296,7 +296,7 @@ won't be fetched from GitHub.)
296
296
 
297
297
  ### Building the C++ Library & Executable
298
298
 
299
- The program is build by using CMake. So first make sure that you installed
299
+ The program is built by using CMake. So first make sure that you installed
300
300
  CMake and then follow these steps:
301
301
 
302
302
  ```bash
@@ -317,7 +317,7 @@ The following options are available:
317
317
  | BUILD_POLYHEDRAL_GRAVITY_PYTHON_INTERFACE (`ON`) | Build the Python interface |
318
318
 
319
319
  During testing POLYHEDRAL_GRAVITY_PARALLELIZATION=`TBB` has been the most performant.
320
- It is further not recommend to change the POLYHEDRAL_GRAVITY_LOGGING_LEVEL to something else than `INFO=2`.
320
+ It is further not recommended to change the POLYHEDRAL_GRAVITY_LOGGING_LEVEL to something else than `INFO=2`.
321
321
 
322
322
  The recommended CMake settings using the `TBB` backend would look like this:
323
323
 
@@ -344,7 +344,7 @@ It is required to specify the source-files of the polyhedron's mesh (more info
344
344
  about the supported file in the [documentation](https://esa.github.io/polyhedral-gravity-model/quickstart/supported_input.html)), the density
345
345
  of the polyhedron, and the wished computation points where the
346
346
  gravity tensor shall be computed.
347
- Further one must specify the name of the .csv output file.
347
+ Further, one must specify the name of the .csv output file.
348
348
 
349
349
  ````yaml
350
350
  ---
@@ -353,7 +353,7 @@ gravityModel:
353
353
  polyhedron: # polyhedron source-file(s)
354
354
  - "../example-config/data/tsoulis.node" # .node contains the vertices
355
355
  - "../example-config/data/tsoulis.face" # .face contains the triangular faces
356
- density: 2670.0 # constant density, units must match with the mesh (see section below)
356
+ density: 2670.0 # constant density, units must match with the mesh (see a section below)
357
357
  # Depends on metric_unit: 'km' -> kg/km^3, 'm' -> kg/m^3, 'unitless' -> 'unitless'
358
358
  points: # Location of the computation point(s) P
359
359
  - [ 0, 0, 0 ] # Here it is situated at the origin
@@ -372,8 +372,8 @@ computation point *P*.
372
372
 
373
373
  ## Testing
374
374
 
375
- The project uses GoogleTest for testing. In oder to execute those
376
- tests just execute the following command in the build directory:
375
+ The project uses GoogleTest for testing.
376
+ In order to execute those tests, just execute the following command in the build directory:
377
377
 
378
378
  ```bash
379
379
  ctest
@@ -388,5 +388,5 @@ pytest
388
388
  ## Contributing
389
389
 
390
390
  We are happy to accept contributions to the project in the form of
391
- suggestions, bug reports and pull requests. Please have a look at
391
+ suggestions, bug reports, and pull requests. Please have a look at
392
392
  the [contributing guidelines](CONTRIBUTING.md) for more information.
@@ -1,11 +1,4 @@
1
- file(GLOB_RECURSE CLANG_FORMAT_SRC
2
- "${PROJECT_SOURCE_DIR}/src/*.cpp"
3
- "${PROJECT_SOURCE_DIR}/src/*.h"
4
- "${PROJECT_SOURCE_DIR}/test/*.cpp"
5
- "${PROJECT_SOURCE_DIR}/test/*.h"
6
- )
7
-
8
- # Define a variable for clang-format command
1
+ # Find clang format
9
2
  find_program(CLANG_FORMAT clang-format)
10
3
 
11
4
  # Ensure clang-format was found
@@ -13,6 +6,12 @@ if(NOT CLANG_FORMAT)
13
6
  message(STATUS "clang-format not found. Please install it to use clang-format via CMake")
14
7
  else()
15
8
  message(STATUS "clang-format found. You can format all source files via `cmake --build . --target format`")
9
+ file(GLOB_RECURSE CLANG_FORMAT_SRC
10
+ "${PROJECT_SOURCE_DIR}/src/*.cpp"
11
+ "${PROJECT_SOURCE_DIR}/src/*.h"
12
+ "${PROJECT_SOURCE_DIR}/test/*.cpp"
13
+ "${PROJECT_SOURCE_DIR}/test/*.h"
14
+ )
16
15
  add_custom_command(
17
16
  OUTPUT format_all_files
18
17
  COMMAND ${CLANG_FORMAT} -i ${CLANG_FORMAT_SRC}
@@ -0,0 +1,25 @@
1
+ find_program(CMAKE_FORMAT_EXECUTABLE NAMES cmake-format)
2
+
3
+ if (NOT CMAKE_FORMAT_EXECUTABLE)
4
+ message(STATUS "cmake-format not found. Please install it to use cmake-format via CMake")
5
+ else ()
6
+ message(STATUS "cmake-format found. You can format all source files via `cmake --build . --target format_cmake`")
7
+
8
+ # Create a list of all .cmake files in the project
9
+ file(GLOB_RECURSE CMAKE_FORMAT_FILES
10
+ "${PROJECT_SOURCE_DIR}/*.cmake"
11
+ "${PROJECT_SOURCE_DIR}/CMakeLists.txt"
12
+ )
13
+
14
+ # Add a custom target to format all .cmake files
15
+ add_custom_command(
16
+ OUTPUT format_cmake_files
17
+ COMMAND ${CMAKE_FORMAT_EXECUTABLE} --in-place ${CMAKE_FORMAT_FILES}
18
+ WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
19
+ COMMENT "Formatting all cmake files in the project with cmake-format"
20
+ VERBATIM
21
+ )
22
+ add_custom_target(format_cmake
23
+ DEPENDS format_cmake_files
24
+ )
25
+ endif ()
@@ -1,7 +1,12 @@
1
- find_package(Git QUIET REQUIRED)
1
+ find_package(Git QUIET)
2
2
 
3
3
  function(get_git_commit_hash OUTPUT_VAR)
4
4
  # Run a Git command to get the first 8 characters of the current commit hash
5
+ if(NOT GIT_FOUND OR NOT GIT_EXECUTABLE)
6
+ set(${OUTPUT_VAR} "Unknown" PARENT_SCOPE)
7
+ return()
8
+ endif()
9
+
5
10
  execute_process(
6
11
  COMMAND ${GIT_EXECUTABLE} rev-parse --short=8 HEAD
7
12
  WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
@@ -23,6 +28,11 @@ endfunction()
23
28
 
24
29
  function(is_git_working_tree_clean OUTPUT_VAR)
25
30
  # Run a Git command to check if the working tree is clean
31
+ if(NOT GIT_FOUND OR NOT GIT_EXECUTABLE)
32
+ set(${OUTPUT_VAR} "Unknown" PARENT_SCOPE)
33
+ return()
34
+ endif()
35
+
26
36
  execute_process(
27
37
  COMMAND ${GIT_EXECUTABLE} diff-index --quiet HEAD --
28
38
  WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
@@ -43,4 +53,29 @@ function(is_git_working_tree_clean OUTPUT_VAR)
43
53
  message(WARNING "Error while checking Git working tree: ${GIT_ERROR}")
44
54
  endif()
45
55
  endif()
56
+ endfunction()
57
+
58
+ function(get_git_version_tag OUTPUT_VAR)
59
+ # Runs a git command to return the latest version number (given the most similar git tag)
60
+ if(NOT GIT_FOUND OR NOT GIT_EXECUTABLE)
61
+ set(${OUTPUT_VAR} "Unknown" PARENT_SCOPE)
62
+ return()
63
+ endif()
64
+
65
+ execute_process(
66
+ COMMAND git describe --tags --abbrev=0
67
+ --match v[0-9]*.[0-9]*.[0-9]* # plain
68
+ --match v[0-9]*.[0-9]*.[0-9]*a* # alpha
69
+ --match v[0-9]*.[0-9]*.[0-9]*b* # beta
70
+ --match v[0-9]*.[0-9]*.[0-9]*rc* # release candidate
71
+ --match v[0-9]*.[0-9]*.[0-9]*.post* # post
72
+ --match v[0-9]*.[0-9]*.[0-9]*.dev* # dev
73
+ OUTPUT_VARIABLE GIT_TAG
74
+ ERROR_VARIABLE GIT_TAG_ERR
75
+ RESULT_VARIABLE GIT_TAG_RES
76
+ OUTPUT_STRIP_TRAILING_WHITESPACE
77
+ )
78
+ string(LENGTH ${GIT_TAG} TAG_LENGTH)
79
+ string(SUBSTRING ${GIT_TAG} 1 ${TAG_LENGTH} VERSION_NUMBER)
80
+ set(${OUTPUT_VAR} "${VERSION_NUMBER}" PARENT_SCOPE)
46
81
  endfunction()
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: polyhedral_gravity
3
- Version: 3.3rc1
3
+ Version: 3.3.1rc1
4
4
  Summary: Package to compute full gravity tensor of a given constant density polyhedron for arbitrary points according to the geodetic convention
5
5
  Author: Jonas Schuhmacher
6
6
  Author-email: jonas.schuhmacher@tum.de
@@ -19,7 +19,7 @@ Classifier: Operating System :: MacOS
19
19
  Classifier: Operating System :: POSIX :: Linux
20
20
  Classifier: Intended Audience :: Science/Research
21
21
  Classifier: Topic :: Scientific/Engineering :: Physics
22
- Requires-Python: >=3.8
22
+ Requires-Python: >=3.9
23
23
  Description-Content-Type: text/markdown
24
24
  License-File: LICENSE
25
25
  Dynamic: author
@@ -28,6 +28,7 @@ Dynamic: classifier
28
28
  Dynamic: description
29
29
  Dynamic: description-content-type
30
30
  Dynamic: license
31
+ Dynamic: license-file
31
32
  Dynamic: project-url
32
33
  Dynamic: requires-python
33
34
  Dynamic: summary
@@ -104,20 +105,20 @@ The evaluation of the polyhedral gravity model requires the following parameters
104
105
  | Polyhedral Mesh (either as vertices & faces or as polyhedral source files) |
105
106
  | Constant Density $\rho$ |
106
107
 
107
- The mesh and the constants density's unit must match.
108
- Have a look the documentation to view the [supported mesh files](https://esa.github.io/polyhedral-gravity-model/quickstart/supported_input.html).
108
+ The mesh and the constant density's unit must match.
109
+ Have a look at the documentation to view the [supported mesh files](https://esa.github.io/polyhedral-gravity-model/quickstart/supported_input.html).
109
110
 
110
111
  ### Output
111
112
 
112
113
  The calculation outputs the following parameters for every Computation Point *P*.
113
114
  The units of the respective output depend on the units of the input parameters (mesh and density)!
114
- Hence, if e.g. your mesh is in $km$, the density must match. Further, output units will be different accordingly.
115
+ Hence, if e.g., your mesh is in $km$, the density must match. Further, output units will be different accordingly.
115
116
 
116
- | Name | Unit (if mesh in $[m]$ and $\rho$ in $[kg/m^3]$) | Comment |
117
- |:----------------------------------------------------------:|:------------------------------------------------:|:-----------------------------------------------------------------:|
118
- | $V$ | $\frac{m^2}{s^2}$ or $\frac{J}{kg}$ | The potential or also called specific energy |
119
- | $V_x$, $V_y$, $V_z$ | $\frac{m}{s^2}$ | The gravitational accerleration in the three cartesian directions |
120
- | $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 |
117
+ | Name | Unit (if mesh in $[m]$ and $\rho$ in $[kg/m^3]$) | Comment |
118
+ |:----------------------------------------------------------:|:------------------------------------------------:|:----------------------------------------------------------------:|
119
+ | $V$ | $\frac{m^2}{s^2}$ or $\frac{J}{kg}$ | The potential or also called specific energy |
120
+ | $V_x$, $V_y$, $V_z$ | $\frac{m}{s^2}$ | The gravitational acceleration in the three cartesian directions |
121
+ | $V_{xx}$, $V_{yy}$, $V_{zz}$, $V_{xy}$, $V_{xz}$, $V_{yz}$ | $\frac{1}{s^2}$ | The spatial rate of change of the gravitational acceleration |
121
122
 
122
123
 
123
124
  >[!NOTE]
@@ -176,7 +177,7 @@ potential, acceleration, tensor = evaluate(
176
177
  The more advanced way is to use the `GravityEvaluable` class. It caches the
177
178
  internal data structure and properties which can be reused for multiple
178
179
  evaluations. This is especially useful if you want to compute the gravity
179
- for multiple computation points, but don't know the "future points" in advance.
180
+ for multiple computation points but don't know the "future points" in advance.
180
181
 
181
182
  ```python
182
183
  evaluable = GravityEvaluable(polyhedron=cube_polyhedron) # stores intermediate computation steps
@@ -197,7 +198,7 @@ This property is - by default - checked when constructing the `Polyhedron`! So,
197
198
  is impossible if not **explicitly** disabled to create an invalid `Polyhedron`.
198
199
  You can disable/ enable this setting via the optional `integrity_check` flag and can even
199
200
  automatically repair the ordering via `HEAL`.
200
- If you are confident that your mesh is defined correctly (e.g. checked once with the integrity check)
201
+ If you are confident that your mesh is defined correctly (e.g., checked once with the integrity check)
201
202
  you can disable this check (via `DISABLE`) to avoid the additional runtime overhead of the check.
202
203
  Also, you can set the metric unit of the mesh and the density.
203
204
  This also influences the output unit. E.g., Density in $kg/m^3$, Mesh in $m$, then the potential is given in $m^2/s^2$.
@@ -279,8 +280,8 @@ As a second option, you can also install the python interface with pip from [PyP
279
280
  pip install polyhedral-gravity
280
281
  ```
281
282
 
282
- Binaries for the most common platforms are available on PyPI including
283
- Windows, Linux and macOS. For macOS and Linux, binaries for
283
+ Binaries for the most common platforms are available on PyPI, including
284
+ Windows, Linux, and macOS. For macOS and Linux, binaries for
284
285
  `x86_64` and `aarch64` are provided.
285
286
  In case `pip` uses the source distribution, please make sure that
286
287
  you have a C++17 capable compiler and CMake installed.
@@ -288,7 +289,7 @@ you have a C++17 capable compiler and CMake installed.
288
289
  ### From source
289
290
 
290
291
  The project uses the following dependencies,
291
- all of them are **automatically** set-up via CMake:
292
+ all of them are **automatically** set up via CMake:
292
293
 
293
294
  - GoogleTest (1.15.2 or compatible), only required for testing
294
295
  - spdlog (1.13.0 or compatible), required for logging
@@ -298,7 +299,7 @@ all of them are **automatically** set-up via CMake:
298
299
  - xsimd (11.1.0 or compatible), required for vectorization of the `atan(..)`
299
300
  - pybind11 (2.12.0 or compatible), required for the Python interface, but not the C++ standalone
300
301
 
301
- The module will be build using a C++17 capable compiler,
302
+ The module will be built using a C++17 capable compiler,
302
303
  CMake. Just execute the following command in
303
304
  the repository root folder:
304
305
 
@@ -316,7 +317,7 @@ export POLYHEDRAL_GRAVITY_PARALLELIZATION="TBB"
316
317
  pip install .
317
318
  ```
318
319
 
319
- (Optional: For a faster build you can install all dependencies available
320
+ (Optional: For a faster build, you can install all dependencies available
320
321
  for your system in your local python environment. That way, they
321
322
  won't be fetched from GitHub.)
322
323
 
@@ -324,7 +325,7 @@ won't be fetched from GitHub.)
324
325
 
325
326
  ### Building the C++ Library & Executable
326
327
 
327
- The program is build by using CMake. So first make sure that you installed
328
+ The program is built by using CMake. So first make sure that you installed
328
329
  CMake and then follow these steps:
329
330
 
330
331
  ```bash
@@ -345,7 +346,7 @@ The following options are available:
345
346
  | BUILD_POLYHEDRAL_GRAVITY_PYTHON_INTERFACE (`ON`) | Build the Python interface |
346
347
 
347
348
  During testing POLYHEDRAL_GRAVITY_PARALLELIZATION=`TBB` has been the most performant.
348
- It is further not recommend to change the POLYHEDRAL_GRAVITY_LOGGING_LEVEL to something else than `INFO=2`.
349
+ It is further not recommended to change the POLYHEDRAL_GRAVITY_LOGGING_LEVEL to something else than `INFO=2`.
349
350
 
350
351
  The recommended CMake settings using the `TBB` backend would look like this:
351
352
 
@@ -372,7 +373,7 @@ It is required to specify the source-files of the polyhedron's mesh (more info
372
373
  about the supported file in the [documentation](https://esa.github.io/polyhedral-gravity-model/quickstart/supported_input.html)), the density
373
374
  of the polyhedron, and the wished computation points where the
374
375
  gravity tensor shall be computed.
375
- Further one must specify the name of the .csv output file.
376
+ Further, one must specify the name of the .csv output file.
376
377
 
377
378
  ````yaml
378
379
  ---
@@ -381,7 +382,7 @@ gravityModel:
381
382
  polyhedron: # polyhedron source-file(s)
382
383
  - "../example-config/data/tsoulis.node" # .node contains the vertices
383
384
  - "../example-config/data/tsoulis.face" # .face contains the triangular faces
384
- density: 2670.0 # constant density, units must match with the mesh (see section below)
385
+ density: 2670.0 # constant density, units must match with the mesh (see a section below)
385
386
  # Depends on metric_unit: 'km' -> kg/km^3, 'm' -> kg/m^3, 'unitless' -> 'unitless'
386
387
  points: # Location of the computation point(s) P
387
388
  - [ 0, 0, 0 ] # Here it is situated at the origin
@@ -400,8 +401,8 @@ computation point *P*.
400
401
 
401
402
  ## Testing
402
403
 
403
- The project uses GoogleTest for testing. In oder to execute those
404
- tests just execute the following command in the build directory:
404
+ The project uses GoogleTest for testing.
405
+ In order to execute those tests, just execute the following command in the build directory:
405
406
 
406
407
  ```bash
407
408
  ctest
@@ -416,5 +417,5 @@ pytest
416
417
  ## Contributing
417
418
 
418
419
  We are happy to accept contributions to the project in the form of
419
- suggestions, bug reports and pull requests. Please have a look at
420
+ suggestions, bug reports, and pull requests. Please have a look at
420
421
  the [contributing guidelines](CONTRIBUTING.md) for more information.
@@ -5,6 +5,7 @@ README.md
5
5
  setup.py
6
6
  cmake/FindSphinx.cmake
7
7
  cmake/clang_format.cmake
8
+ cmake/cmake_format.cmake
8
9
  cmake/git.cmake
9
10
  cmake/gtest.cmake
10
11
  cmake/pybind11.cmake
@@ -30,7 +30,9 @@ CMAKE_OPTIONS = {
30
30
  # Should be of course ON!
31
31
  "BUILD_POLYHEDRAL_GRAVITY_PYTHON_INTERFACE": "ON",
32
32
  # Build static libs by default (On conda-forge we build shared libs by setting this to ON)
33
- "BUILD_SHARED_LIBS": "OFF"
33
+ "BUILD_SHARED_LIBS": "OFF",
34
+ # Required since CMake 4.0 (doesn't do anything before that) due to the outdated TetGen build system
35
+ "CMAKE_POLICY_VERSION_MINIMUM": "3.5",
34
36
  }
35
37
  # ---------------------------------------------------------------------------------
36
38
 
@@ -53,7 +55,21 @@ def get_cmake_generator():
53
55
  else:
54
56
  return None
55
57
 
56
- def get_version():
58
+ def get_git_version():
59
+ """Returns the version of the polyhedral gravity package by using git describe"""
60
+ version_string = subprocess.check_output([
61
+ "git", "describe", "--tags", "--abbrev=0",
62
+ "--match", "v[0-9]*.[0-9]*.[0-9]*", # plain
63
+ "--match", "v[0-9]*.[0-9]*.[0-9]*a*", # alpha
64
+ "--match", "v[0-9]*.[0-9]*.[0-9]*b*", # beta
65
+ "--match", "v[0-9]*.[0-9]*.[0-9]*rc*", # release candidate
66
+ "--match", "v[0-9]*.[0-9]*.[0-9]*.post*", # post
67
+ "--match", "v[0-9]*.[0-9]*.[0-9]*.dev*", # dev
68
+ ]).decode("utf-8").strip()
69
+ # Remove the leading "v"
70
+ return version_string[1:]
71
+
72
+ def get_cmake_version():
57
73
  """Returns the version of the polyhedral gravity package by reading the CMake file."""
58
74
  # Path to the CMake file
59
75
  cmake_file = os.path.join(os.path.dirname(__file__), "version.cmake" )
@@ -67,7 +83,7 @@ def get_version():
67
83
  content = file.read()
68
84
 
69
85
  # Use regex to extract the PROJECT_VERSION
70
- version_match = re.search(r'set\(PROJECT_VERSION\s+([^\s)]+)\)', content)
86
+ version_match = re.search(r'set\(POLYHEDRAL_GRAVITY_VERSION\s+"(.*)"', content)
71
87
  if version_match:
72
88
  return version_match.group(1)
73
89
  else:
@@ -194,7 +210,7 @@ picture_in_readme = '''<p align="center">
194
210
  # --------------------------------------------------------------------------------
195
211
  setup(
196
212
  name="polyhedral_gravity",
197
- version=get_version(),
213
+ version=get_cmake_version(),
198
214
  author="Jonas Schuhmacher",
199
215
  author_email="jonas.schuhmacher@tum.de",
200
216
  description="Package to compute full gravity tensor of a given constant density polyhedron for arbitrary points "
@@ -206,7 +222,7 @@ setup(
206
222
  license="GPLv3",
207
223
  license_file="LICENSE",
208
224
  zip_safe=False,
209
- python_requires=">=3.8",
225
+ python_requires=">=3.9",
210
226
  include_package_data=True,
211
227
  project_urls={
212
228
  "Homepage": "https://github.com/esa/polyhedral-gravity-model",
@@ -6,6 +6,12 @@
6
6
  namespace polyhedralGravity {
7
7
 
8
8
  PolyhedralSource MeshReader::getPolyhedralSource(const std::vector<std::string> &fileNames) {
9
+ // Input Sanity Check if the files exists
10
+ for (const auto &fileName: fileNames) {
11
+ if (!std::filesystem::exists(fileName)) {
12
+ throw std::runtime_error("File '" + fileName + "' does not exist.");
13
+ }
14
+ }
9
15
  switch (fileNames.size()) {
10
16
  case 0:
11
17
  throw std::runtime_error("No mesh file given");
@@ -11,6 +11,7 @@
11
11
  #include "polyhedralGravity/util/UtilityContainer.h"
12
12
  #include <exception>
13
13
  #include <stdexcept>
14
+ #include <filesystem>
14
15
 
15
16
  namespace polyhedralGravity {
16
17
 
@@ -23,7 +24,8 @@ namespace polyhedralGravity {
23
24
  * Returns a polyhedral source consisting of vertices and faces by reading mesh input files.
24
25
  * @param fileNames files specifying a polyhedron
25
26
  * @return polyhedral source consisting of vertices and faces
26
- * @throws std::invalid_argument exception if the file type is unsupported by the implementation
27
+ * @throws std::invalid_argument if the file type is unsupported by the implementation
28
+ * @throws std::runtime_error if the provided files do not exist
27
29
  */
28
30
  PolyhedralSource getPolyhedralSource(const std::vector<std::string> &fileNames);
29
31
 
@@ -175,6 +175,7 @@ PYBIND11_MODULE(polyhedral_gravity, m) {
175
175
 
176
176
  Raises:
177
177
  ValueError: If :code:`integrity_check` is set to :code:`AUTOMATIC` or :code:`VERIFY` and the mesh is inconsistent
178
+ RuntimeError: If files given as :code:`polyhedral_source` do not exist
178
179
 
179
180
  Note:
180
181
  The :code:`integrity_check` is automatically enabled to avoid wrong results due to the wrong vertex ordering.
@@ -287,7 +288,8 @@ PYBIND11_MODULE(polyhedral_gravity, m) {
287
288
 
288
289
  Args:
289
290
  computation_points: The computation points as tuple or list of points
290
- parallel: If :code:`True`, the computation is done in parallel (default: :code:`True`)
291
+ parallel: If :code:`True`, the computation is done in parallel on the CPU using the technology specified by
292
+ :code:`polyhedral_gravity.__parallelization__` (default: :code:`True`)
291
293
 
292
294
  Returns:
293
295
  Either a triplet of potential :math:`V`, acceleration :math:`[V_x, V_y, V_z]`
@@ -333,7 +335,8 @@ PYBIND11_MODULE(polyhedral_gravity, m) {
333
335
  Args:
334
336
  polyhedron: The polyhedron for which to evaluate the gravity model
335
337
  computation_points: The computation points as tuple or list of points
336
- parallel: If :code:`True`, the computation is done in parallel (default: :code:`True`)
338
+ parallel: If :code:`True`, the computation is done in parallel on the CPU using the technology specified by
339
+ :code:`polyhedral_gravity.__parallelization__` (default: :code:`True`)
337
340
 
338
341
  Returns:
339
342
  Either a triplet of potential :math:`V`, acceleration :math:`[V_x, V_y, V_z]`