Tsaraloha 1.0.0__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.
- tsaraloha-1.0.0/.gitignore +28 -0
- tsaraloha-1.0.0/CMakeLists.txt +234 -0
- tsaraloha-1.0.0/DOCUMENTATION.md +607 -0
- tsaraloha-1.0.0/LIPoutreContinue/bindings/DictConverter.h +168 -0
- tsaraloha-1.0.0/LIPoutreContinue/bindings/bindings.cpp +844 -0
- tsaraloha-1.0.0/LIPoutreContinue/include/LIPoutreContinue/Output.h +130 -0
- tsaraloha-1.0.0/LIPoutreContinue/include/LIPoutreContinue/StructuralAnalysis.h +25 -0
- tsaraloha-1.0.0/LIPoutreContinue/include/LIPoutreContinue/Utils.h +279 -0
- tsaraloha-1.0.0/LIPoutreContinue/include/LIPoutreContinue/core/Hyperstatique.h +99 -0
- tsaraloha-1.0.0/LIPoutreContinue/include/LIPoutreContinue/core/Isostatique.h +44 -0
- tsaraloha-1.0.0/LIPoutreContinue/include/LIPoutreContinue/io/ProjectPaths.h +137 -0
- tsaraloha-1.0.0/LIPoutreContinue/include/LIPoutreContinue/io/UpdatePositions.h +111 -0
- tsaraloha-1.0.0/LIPoutreContinue/include/LIPoutreContinue/loading/Input.h +29 -0
- tsaraloha-1.0.0/LIPoutreContinue/include/LIPoutreContinue/loading/Loading.h +54 -0
- tsaraloha-1.0.0/LIPoutreContinue/src/Output.cpp +247 -0
- tsaraloha-1.0.0/LIPoutreContinue/src/core/Hyperstatique.cpp +489 -0
- tsaraloha-1.0.0/LIPoutreContinue/src/core/Isostatique.cpp +186 -0
- tsaraloha-1.0.0/LIPoutreContinue/src/io/UpdatePositions.cpp +331 -0
- tsaraloha-1.0.0/LIPoutreContinue/src/loading/Input.cpp +27 -0
- tsaraloha-1.0.0/LIPoutreContinue/src/loading/Loading.cpp +455 -0
- tsaraloha-1.0.0/PKG-INFO +356 -0
- tsaraloha-1.0.0/PUBLISHING.md +109 -0
- tsaraloha-1.0.0/README.md +337 -0
- tsaraloha-1.0.0/include/nlohmann/json.hpp +24765 -0
- tsaraloha-1.0.0/include/nlohmann/json_fwd.hpp +176 -0
- tsaraloha-1.0.0/pyproject.toml +86 -0
- tsaraloha-1.0.0/python/Tsaraloha/LIPoutreContinue/__init__.py +851 -0
- tsaraloha-1.0.0/python/Tsaraloha/LIPoutreContinue/__init__.pyi +297 -0
- tsaraloha-1.0.0/python/Tsaraloha/LIPoutreContinue/_validation.py +182 -0
- tsaraloha-1.0.0/python/Tsaraloha/LIPoutreContinue/plot.py +1134 -0
- tsaraloha-1.0.0/python/Tsaraloha/LIPoutreContinue/py.typed +0 -0
- tsaraloha-1.0.0/python/Tsaraloha/LIPoutreContinue/report.py +904 -0
- tsaraloha-1.0.0/python/Tsaraloha/__init__.py +29 -0
- tsaraloha-1.0.0/python/Tsaraloha/py.typed +0 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Build directories
|
|
2
|
+
build/
|
|
3
|
+
bin/
|
|
4
|
+
lib/
|
|
5
|
+
_skbuild/
|
|
6
|
+
dist/
|
|
7
|
+
*.egg-info/
|
|
8
|
+
|
|
9
|
+
# Python cache & compiled binaries
|
|
10
|
+
__pycache__/
|
|
11
|
+
*.pyc
|
|
12
|
+
*.pyo
|
|
13
|
+
*.pyd
|
|
14
|
+
*.so
|
|
15
|
+
*.dylib
|
|
16
|
+
*.dll
|
|
17
|
+
|
|
18
|
+
# IDE and OS files
|
|
19
|
+
.vscode/
|
|
20
|
+
.idea/
|
|
21
|
+
.vs/
|
|
22
|
+
.DS_Store
|
|
23
|
+
Thumbs.db
|
|
24
|
+
|
|
25
|
+
# Archives
|
|
26
|
+
*.zip
|
|
27
|
+
*.tar.gz
|
|
28
|
+
*.rar
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
# =============================================================================
|
|
2
|
+
# CMakeLists.txt — Tsaraloha
|
|
3
|
+
#
|
|
4
|
+
# Tsaraloha est une librairie chapeau destinée à regrouper plusieurs
|
|
5
|
+
# sous-librairies de calcul. La première sous-librairie intégrée est
|
|
6
|
+
# LIPoutreContinue (analyse structurelle de poutres continues).
|
|
7
|
+
#
|
|
8
|
+
# Construit, pour la sous-librairie LIPoutreContinue :
|
|
9
|
+
# 1) la librairie coeur C++ "LIPoutreContinue_core" (calcul pur, sans Python)
|
|
10
|
+
# 2) le module Python "Tsaraloha.LIPoutreContinue._LIPoutreContinue"
|
|
11
|
+
# (bindings pybind11, extension privée enveloppée par le paquet Python
|
|
12
|
+
# python/Tsaraloha/LIPoutreContinue/, sur le modèle de numpy : le code
|
|
13
|
+
# compilé de numpy est privé, et `import numpy` expose une API Python
|
|
14
|
+
# propre par-dessus)
|
|
15
|
+
#
|
|
16
|
+
# D'autres sous-librairies pourront être ajoutées ultérieurement de la même
|
|
17
|
+
# façon : un dossier <NomDeLaSousLib>/ à la racine (include/src/bindings)
|
|
18
|
+
# + un sous-paquet python/Tsaraloha/<NomDeLaSousLib>/, greffés ici par la
|
|
19
|
+
# même mécanique que la section LIPoutreContinue ci-dessous.
|
|
20
|
+
#
|
|
21
|
+
# Le module Python est généré AUTOMATIQUEMENT :
|
|
22
|
+
# - pybind11 est détecté s'il est déjà installé (pip install pybind11),
|
|
23
|
+
# sinon téléchargé et compilé automatiquement via FetchContent —
|
|
24
|
+
# aucune installation manuelle requise, "cmake -B build" suffit.
|
|
25
|
+
# - nlohmann_json n'est PAS une dépendance externe : il est déjà
|
|
26
|
+
# embarqué dans include/nlohmann/ (partagé entre sous-librairies),
|
|
27
|
+
# donc rien à installer pour lui non plus.
|
|
28
|
+
#
|
|
29
|
+
# Détection du compilateur / IDE — AUCUNE action requise de ta part :
|
|
30
|
+
# - Sous Windows, si tu ne passes pas -G, CMake choisit automatiquement
|
|
31
|
+
# la version de Visual Studio la plus récente installée sur la machine
|
|
32
|
+
# (VS 2022, VS 2026, ...) — c'est le comportement par défaut de CMake,
|
|
33
|
+
# pas une option à activer. Rien dans ce fichier ne force une version.
|
|
34
|
+
# - VS 2026 correspond au générateur CMake "Visual Studio 18 2026", need
|
|
35
|
+
# CMake >= 4.2 pour être reconnu ; VS 2022 = "Visual Studio 17 2022"
|
|
36
|
+
# (CMake >= 3.21). Si `cmake --version` est trop ancien, CMake ne verra
|
|
37
|
+
# pas ta VS la plus récente et retombera sur une version antérieure —
|
|
38
|
+
# mets à jour CMake dans ce cas (voir la démarche d'installation).
|
|
39
|
+
# - Pour forcer une version précise malgré tout :
|
|
40
|
+
# cmake -B build -G "Visual Studio 17 2022" -A x64
|
|
41
|
+
#
|
|
42
|
+
# Usage direct (CMake seul) :
|
|
43
|
+
# cmake -B build
|
|
44
|
+
# cmake --build build --config Release -j
|
|
45
|
+
# # -> build/python/Tsaraloha/LIPoutreContinue/_LIPoutreContinue<...>.pyd (Windows) ou .so (Linux/macOS)
|
|
46
|
+
# # Windows (PowerShell) :
|
|
47
|
+
# $env:PYTHONPATH = "build/python"; python -c "import Tsaraloha.LIPoutreContinue"
|
|
48
|
+
# # Linux/macOS :
|
|
49
|
+
# PYTHONPATH=build/python python3 -c "import Tsaraloha.LIPoutreContinue"
|
|
50
|
+
#
|
|
51
|
+
# Usage "lib Python installable" (recommandé, comme numpy) :
|
|
52
|
+
# pip install .
|
|
53
|
+
# # nécessite le pyproject.toml (scikit-build-core) livré à côté de ce
|
|
54
|
+
# # fichier — c'est lui qui invoque ce CMakeLists.txt pour toi.
|
|
55
|
+
# # Ensuite, dans n'importe quel script : import Tsaraloha.LIPoutreContinue
|
|
56
|
+
# =============================================================================
|
|
57
|
+
|
|
58
|
+
cmake_minimum_required(VERSION 3.18)
|
|
59
|
+
project(Tsaraloha LANGUAGES CXX)
|
|
60
|
+
|
|
61
|
+
message(STATUS "Tsaraloha: générateur sélectionné par CMake -> ${CMAKE_GENERATOR}")
|
|
62
|
+
if(MSVC)
|
|
63
|
+
message(STATUS "Tsaraloha: compilateur MSVC détecté, version ${MSVC_VERSION} (${CMAKE_CXX_COMPILER})")
|
|
64
|
+
endif()
|
|
65
|
+
|
|
66
|
+
# ── Options ───────────────────────────────────────────────────────────────
|
|
67
|
+
option(TSARALOHA_BUILD_PYTHON "Construire le(s) module(s) Python pybind11 des sous-librairies" ON)
|
|
68
|
+
option(TSARALOHA_BUILD_EXAMPLES "Construire les exécutables d'examples/ (si présents)" OFF)
|
|
69
|
+
|
|
70
|
+
set(CMAKE_CXX_STANDARD 20)
|
|
71
|
+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
72
|
+
set(CMAKE_CXX_EXTENSIONS OFF)
|
|
73
|
+
set(CMAKE_POSITION_INDEPENDENT_CODE ON) # requis pour lier les libs coeur dans un .so/.pyd Python
|
|
74
|
+
|
|
75
|
+
# Visual Studio (comme Xcode) est un générateur "multi-config" : Debug/Release
|
|
76
|
+
# coexistent dans le même dossier de build, et CMAKE_BUILD_TYPE est ignoré —
|
|
77
|
+
# la configuration se choisit au moment du build/install (--config Release).
|
|
78
|
+
# On ne force donc CMAKE_BUILD_TYPE que pour les générateurs mono-config
|
|
79
|
+
# (Makefiles, Ninja), utilisés sous Linux/macOS.
|
|
80
|
+
get_property(TSARALOHA_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
|
81
|
+
if(NOT TSARALOHA_IS_MULTI_CONFIG AND NOT CMAKE_BUILD_TYPE)
|
|
82
|
+
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
|
|
83
|
+
endif()
|
|
84
|
+
|
|
85
|
+
find_package(Threads REQUIRED)
|
|
86
|
+
|
|
87
|
+
# =============================================================================
|
|
88
|
+
# Sous-librairie : LIPoutreContinue
|
|
89
|
+
# Calcul pur (Isostatique/Hyperstatique/Output/Loading/UpdatePositions),
|
|
90
|
+
# aucune dépendance à Python. Réutilisable telle quelle par un programme
|
|
91
|
+
# C++ (voir examples/), le module Python n'est qu'un consommateur de plus.
|
|
92
|
+
# =============================================================================
|
|
93
|
+
|
|
94
|
+
# ── 1) Librairie coeur — "LIPoutreContinue_core" ────────────────────────────
|
|
95
|
+
add_library(LIPoutreContinue_core STATIC
|
|
96
|
+
LIPoutreContinue/src/Output.cpp
|
|
97
|
+
LIPoutreContinue/src/core/Hyperstatique.cpp
|
|
98
|
+
LIPoutreContinue/src/core/Isostatique.cpp
|
|
99
|
+
LIPoutreContinue/src/io/UpdatePositions.cpp
|
|
100
|
+
LIPoutreContinue/src/loading/Input.cpp
|
|
101
|
+
LIPoutreContinue/src/loading/Loading.cpp
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
target_include_directories(LIPoutreContinue_core PUBLIC
|
|
105
|
+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/LIPoutreContinue/include>
|
|
106
|
+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
# BendingMoments()/ShearForce()/Deflection()/Rotation() sont lancés en
|
|
110
|
+
# parallèle via std::async -> nécessite de lier pthread sous Linux/macOS
|
|
111
|
+
# (no-op sous Windows, Threads::Threads reste portable).
|
|
112
|
+
target_link_libraries(LIPoutreContinue_core PUBLIC Threads::Threads)
|
|
113
|
+
|
|
114
|
+
if(MSVC)
|
|
115
|
+
target_compile_options(LIPoutreContinue_core PUBLIC
|
|
116
|
+
/EHsc # exceptions C++ standard (requis par pybind11)
|
|
117
|
+
/W4 # warnings niveau 4 (équivalent -Wall -Wextra)
|
|
118
|
+
/permissive- # conformité stricte au standard C++ (comme GCC/Clang)
|
|
119
|
+
/Zc:__cplusplus # __cplusplus reporte la vraie version C++ (sinon MSVC ment)
|
|
120
|
+
/MP # compilation multi-fichiers en parallèle -> build plus rapide
|
|
121
|
+
)
|
|
122
|
+
else()
|
|
123
|
+
target_compile_options(LIPoutreContinue_core PUBLIC -O3 -Wall -Wextra)
|
|
124
|
+
endif()
|
|
125
|
+
|
|
126
|
+
# ── 2) Exemples — optionnels, désactivés par défaut (TSARALOHA_BUILD_EXAMPLES=ON
|
|
127
|
+
# pour les activer). Ignorés silencieusement si examples/ n'existe pas.
|
|
128
|
+
if(TSARALOHA_BUILD_EXAMPLES AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/LIPoutreContinue/examples/CMakeLists.txt")
|
|
129
|
+
add_subdirectory(LIPoutreContinue/examples)
|
|
130
|
+
endif()
|
|
131
|
+
|
|
132
|
+
# ── 3) Module Python — "Tsaraloha.LIPoutreContinue._LIPoutreContinue"
|
|
133
|
+
# (extension privée, bindings pybind11), enveloppé par le paquet
|
|
134
|
+
# pur-Python python/Tsaraloha/LIPoutreContinue/.
|
|
135
|
+
# Modèle numpy : le code compilé est un détail d'implémentation privé
|
|
136
|
+
# (préfixe underscore), l'utilisateur ne fait jamais que
|
|
137
|
+
# `import Tsaraloha.LIPoutreContinue`.
|
|
138
|
+
if(TSARALOHA_BUILD_PYTHON)
|
|
139
|
+
# PYBIND11_FINDPYTHON ON = pybind11 utilise le module CMake FindPython
|
|
140
|
+
# moderne (plutôt que l'ancien FindPythonLibs) — nécessaire pour cibler
|
|
141
|
+
# correctement le Python actif (venv, pyenv, etc.), y compris quand
|
|
142
|
+
# pybind11 est récupéré via FetchContent ci-dessous.
|
|
143
|
+
set(PYBIND11_FINDPYTHON ON)
|
|
144
|
+
find_package(Python 3.9 REQUIRED COMPONENTS Interpreter Development.Module)
|
|
145
|
+
|
|
146
|
+
# 1) On cherche d'abord un pybind11 déjà installé (pip install pybind11 —
|
|
147
|
+
# c'est le cas le plus courant et le plus rapide à configurer).
|
|
148
|
+
find_package(pybind11 CONFIG QUIET)
|
|
149
|
+
|
|
150
|
+
# 2) Sinon, on le télécharge et le compile automatiquement : aucune
|
|
151
|
+
# installation manuelle requise, "cmake -B build" suffit tel quel.
|
|
152
|
+
if(NOT pybind11_FOUND)
|
|
153
|
+
message(STATUS "Tsaraloha: pybind11 non trouvé localement -> téléchargement via FetchContent")
|
|
154
|
+
include(FetchContent)
|
|
155
|
+
FetchContent_Declare(
|
|
156
|
+
pybind11
|
|
157
|
+
GIT_REPOSITORY https://github.com/pybind/pybind11.git
|
|
158
|
+
GIT_TAG v2.13.6
|
|
159
|
+
GIT_SHALLOW TRUE
|
|
160
|
+
)
|
|
161
|
+
FetchContent_MakeAvailable(pybind11)
|
|
162
|
+
endif()
|
|
163
|
+
|
|
164
|
+
pybind11_add_module(_LIPoutreContinue MODULE LIPoutreContinue/bindings/bindings.cpp)
|
|
165
|
+
target_link_libraries(_LIPoutreContinue PRIVATE LIPoutreContinue_core)
|
|
166
|
+
|
|
167
|
+
# /bigobj : les templates pybind11 génèrent beaucoup de symboles par
|
|
168
|
+
# fichier objet -> nécessaire sous MSVC pour éviter l'erreur
|
|
169
|
+
# "too many sections" sur bindings.cpp.
|
|
170
|
+
if(MSVC)
|
|
171
|
+
target_compile_options(_LIPoutreContinue PRIVATE /bigobj)
|
|
172
|
+
endif()
|
|
173
|
+
|
|
174
|
+
# Place le .so compilé dans build/python/Tsaraloha/LIPoutreContinue/, et
|
|
175
|
+
# copie tout le paquet pur-Python (python/Tsaraloha/LIPoutreContinue/*.py,
|
|
176
|
+
# *.pyi) à côté, pour que
|
|
177
|
+
# `PYTHONPATH=build/python python3 -c "import Tsaraloha.LIPoutreContinue"`
|
|
178
|
+
# fonctionne directement après le build, sans étape d'installation.
|
|
179
|
+
set_target_properties(_LIPoutreContinue PROPERTIES
|
|
180
|
+
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/python/Tsaraloha/LIPoutreContinue"
|
|
181
|
+
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/python/Tsaraloha/LIPoutreContinue"
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
# ── Copie du paquet pur-Python racine Tsaraloha/ (namespace) ────────────
|
|
185
|
+
set(TSARALOHA_PY_ROOT_SRC "${CMAKE_CURRENT_SOURCE_DIR}/python/Tsaraloha")
|
|
186
|
+
set(TSARALOHA_PY_ROOT_OUT "${CMAKE_BINARY_DIR}/python/Tsaraloha")
|
|
187
|
+
if(EXISTS "${TSARALOHA_PY_ROOT_SRC}/__init__.py")
|
|
188
|
+
add_custom_command(TARGET _LIPoutreContinue POST_BUILD
|
|
189
|
+
COMMAND ${CMAKE_COMMAND} -E make_directory "${TSARALOHA_PY_ROOT_OUT}"
|
|
190
|
+
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
|
191
|
+
"${TSARALOHA_PY_ROOT_SRC}/__init__.py" "${TSARALOHA_PY_ROOT_OUT}/"
|
|
192
|
+
)
|
|
193
|
+
endif()
|
|
194
|
+
if(EXISTS "${TSARALOHA_PY_ROOT_SRC}/py.typed")
|
|
195
|
+
add_custom_command(TARGET _LIPoutreContinue POST_BUILD
|
|
196
|
+
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
|
197
|
+
"${TSARALOHA_PY_ROOT_SRC}/py.typed" "${TSARALOHA_PY_ROOT_OUT}/"
|
|
198
|
+
)
|
|
199
|
+
endif()
|
|
200
|
+
|
|
201
|
+
# ── Copie du sous-paquet pur-Python Tsaraloha/LIPoutreContinue/ ─────────
|
|
202
|
+
set(TSARALOHA_PY_PKG_SRC "${CMAKE_CURRENT_SOURCE_DIR}/python/Tsaraloha/LIPoutreContinue")
|
|
203
|
+
set(TSARALOHA_PY_PKG_OUT "${CMAKE_BINARY_DIR}/python/Tsaraloha/LIPoutreContinue")
|
|
204
|
+
if(EXISTS "${TSARALOHA_PY_PKG_SRC}")
|
|
205
|
+
file(GLOB TSARALOHA_PY_FILES
|
|
206
|
+
"${TSARALOHA_PY_PKG_SRC}/*.py"
|
|
207
|
+
"${TSARALOHA_PY_PKG_SRC}/*.pyi"
|
|
208
|
+
"${TSARALOHA_PY_PKG_SRC}/py.typed")
|
|
209
|
+
foreach(_pyfile ${TSARALOHA_PY_FILES})
|
|
210
|
+
add_custom_command(TARGET _LIPoutreContinue POST_BUILD
|
|
211
|
+
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
|
212
|
+
"${_pyfile}" "${TSARALOHA_PY_PKG_OUT}/"
|
|
213
|
+
)
|
|
214
|
+
endforeach()
|
|
215
|
+
endif()
|
|
216
|
+
|
|
217
|
+
# Installation ("cmake --install", voir démarche fournie à côté de ce
|
|
218
|
+
# fichier). Sous Windows, .pyd est un DLL -> RUNTIME DESTINATION (et non
|
|
219
|
+
# LIBRARY, ignoré par les DLL) ; sous Linux/macOS c'est LIBRARY qui
|
|
220
|
+
# s'applique. On garde les deux pour couvrir toutes les plateformes.
|
|
221
|
+
install(TARGETS _LIPoutreContinue
|
|
222
|
+
LIBRARY DESTINATION Tsaraloha/LIPoutreContinue
|
|
223
|
+
RUNTIME DESTINATION Tsaraloha/LIPoutreContinue
|
|
224
|
+
)
|
|
225
|
+
if(EXISTS "${TSARALOHA_PY_ROOT_SRC}")
|
|
226
|
+
install(FILES "${TSARALOHA_PY_ROOT_SRC}/__init__.py" "${TSARALOHA_PY_ROOT_SRC}/py.typed"
|
|
227
|
+
DESTINATION Tsaraloha)
|
|
228
|
+
endif()
|
|
229
|
+
if(EXISTS "${TSARALOHA_PY_PKG_SRC}")
|
|
230
|
+
install(DIRECTORY "${TSARALOHA_PY_PKG_SRC}/"
|
|
231
|
+
DESTINATION Tsaraloha/LIPoutreContinue
|
|
232
|
+
FILES_MATCHING PATTERN "*.py" PATTERN "*.pyi" PATTERN "py.typed")
|
|
233
|
+
endif()
|
|
234
|
+
endif()
|