warp-lang 1.0.2__py3-none-manylinux2014_x86_64.whl → 1.2.0__py3-none-manylinux2014_x86_64.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.

Potentially problematic release.


This version of warp-lang might be problematic. Click here for more details.

Files changed (356) hide show
  1. warp/__init__.py +108 -97
  2. warp/__init__.pyi +1 -1
  3. warp/bin/warp-clang.so +0 -0
  4. warp/bin/warp.so +0 -0
  5. warp/build.py +88 -113
  6. warp/build_dll.py +383 -375
  7. warp/builtins.py +3693 -3354
  8. warp/codegen.py +2925 -2792
  9. warp/config.py +40 -36
  10. warp/constants.py +49 -45
  11. warp/context.py +5409 -5102
  12. warp/dlpack.py +442 -442
  13. warp/examples/__init__.py +16 -16
  14. warp/examples/assets/bear.usd +0 -0
  15. warp/examples/assets/bunny.usd +0 -0
  16. warp/examples/assets/cartpole.urdf +110 -110
  17. warp/examples/assets/crazyflie.usd +0 -0
  18. warp/examples/assets/cube.usd +0 -0
  19. warp/examples/assets/nv_ant.xml +92 -92
  20. warp/examples/assets/nv_humanoid.xml +183 -183
  21. warp/examples/assets/quadruped.urdf +267 -267
  22. warp/examples/assets/rocks.nvdb +0 -0
  23. warp/examples/assets/rocks.usd +0 -0
  24. warp/examples/assets/sphere.usd +0 -0
  25. warp/examples/benchmarks/benchmark_api.py +381 -383
  26. warp/examples/benchmarks/benchmark_cloth.py +278 -277
  27. warp/examples/benchmarks/benchmark_cloth_cupy.py +88 -88
  28. warp/examples/benchmarks/benchmark_cloth_jax.py +97 -100
  29. warp/examples/benchmarks/benchmark_cloth_numba.py +146 -142
  30. warp/examples/benchmarks/benchmark_cloth_numpy.py +77 -77
  31. warp/examples/benchmarks/benchmark_cloth_pytorch.py +86 -86
  32. warp/examples/benchmarks/benchmark_cloth_taichi.py +112 -112
  33. warp/examples/benchmarks/benchmark_cloth_warp.py +145 -146
  34. warp/examples/benchmarks/benchmark_launches.py +293 -295
  35. warp/examples/browse.py +29 -29
  36. warp/examples/core/example_dem.py +232 -219
  37. warp/examples/core/example_fluid.py +291 -267
  38. warp/examples/core/example_graph_capture.py +142 -126
  39. warp/examples/core/example_marching_cubes.py +186 -174
  40. warp/examples/core/example_mesh.py +172 -155
  41. warp/examples/core/example_mesh_intersect.py +203 -193
  42. warp/examples/core/example_nvdb.py +174 -170
  43. warp/examples/core/example_raycast.py +103 -90
  44. warp/examples/core/example_raymarch.py +197 -178
  45. warp/examples/core/example_render_opengl.py +183 -141
  46. warp/examples/core/example_sph.py +403 -387
  47. warp/examples/core/example_torch.py +219 -181
  48. warp/examples/core/example_wave.py +261 -248
  49. warp/examples/fem/bsr_utils.py +378 -380
  50. warp/examples/fem/example_apic_fluid.py +432 -389
  51. warp/examples/fem/example_burgers.py +262 -0
  52. warp/examples/fem/example_convection_diffusion.py +180 -168
  53. warp/examples/fem/example_convection_diffusion_dg.py +217 -209
  54. warp/examples/fem/example_deformed_geometry.py +175 -159
  55. warp/examples/fem/example_diffusion.py +199 -173
  56. warp/examples/fem/example_diffusion_3d.py +178 -152
  57. warp/examples/fem/example_diffusion_mgpu.py +219 -214
  58. warp/examples/fem/example_mixed_elasticity.py +242 -222
  59. warp/examples/fem/example_navier_stokes.py +257 -243
  60. warp/examples/fem/example_stokes.py +218 -192
  61. warp/examples/fem/example_stokes_transfer.py +263 -249
  62. warp/examples/fem/mesh_utils.py +133 -109
  63. warp/examples/fem/plot_utils.py +292 -287
  64. warp/examples/optim/example_bounce.py +258 -246
  65. warp/examples/optim/example_cloth_throw.py +220 -209
  66. warp/examples/optim/example_diffray.py +564 -536
  67. warp/examples/optim/example_drone.py +862 -835
  68. warp/examples/optim/example_inverse_kinematics.py +174 -168
  69. warp/examples/optim/example_inverse_kinematics_torch.py +183 -169
  70. warp/examples/optim/example_spring_cage.py +237 -231
  71. warp/examples/optim/example_trajectory.py +221 -199
  72. warp/examples/optim/example_walker.py +304 -293
  73. warp/examples/sim/example_cartpole.py +137 -129
  74. warp/examples/sim/example_cloth.py +194 -186
  75. warp/examples/sim/example_granular.py +122 -111
  76. warp/examples/sim/example_granular_collision_sdf.py +195 -186
  77. warp/examples/sim/example_jacobian_ik.py +234 -214
  78. warp/examples/sim/example_particle_chain.py +116 -105
  79. warp/examples/sim/example_quadruped.py +191 -180
  80. warp/examples/sim/example_rigid_chain.py +195 -187
  81. warp/examples/sim/example_rigid_contact.py +187 -177
  82. warp/examples/sim/example_rigid_force.py +125 -125
  83. warp/examples/sim/example_rigid_gyroscopic.py +107 -95
  84. warp/examples/sim/example_rigid_soft_contact.py +132 -122
  85. warp/examples/sim/example_soft_body.py +188 -177
  86. warp/fabric.py +337 -335
  87. warp/fem/__init__.py +61 -27
  88. warp/fem/cache.py +403 -388
  89. warp/fem/dirichlet.py +178 -179
  90. warp/fem/domain.py +262 -263
  91. warp/fem/field/__init__.py +100 -101
  92. warp/fem/field/field.py +148 -149
  93. warp/fem/field/nodal_field.py +298 -299
  94. warp/fem/field/restriction.py +22 -21
  95. warp/fem/field/test.py +180 -181
  96. warp/fem/field/trial.py +183 -183
  97. warp/fem/geometry/__init__.py +16 -19
  98. warp/fem/geometry/closest_point.py +69 -70
  99. warp/fem/geometry/deformed_geometry.py +270 -271
  100. warp/fem/geometry/element.py +748 -744
  101. warp/fem/geometry/geometry.py +184 -186
  102. warp/fem/geometry/grid_2d.py +380 -373
  103. warp/fem/geometry/grid_3d.py +437 -435
  104. warp/fem/geometry/hexmesh.py +953 -953
  105. warp/fem/geometry/nanogrid.py +455 -0
  106. warp/fem/geometry/partition.py +374 -376
  107. warp/fem/geometry/quadmesh_2d.py +532 -532
  108. warp/fem/geometry/tetmesh.py +840 -840
  109. warp/fem/geometry/trimesh_2d.py +577 -577
  110. warp/fem/integrate.py +1684 -1615
  111. warp/fem/operator.py +190 -191
  112. warp/fem/polynomial.py +214 -213
  113. warp/fem/quadrature/__init__.py +2 -2
  114. warp/fem/quadrature/pic_quadrature.py +243 -245
  115. warp/fem/quadrature/quadrature.py +295 -294
  116. warp/fem/space/__init__.py +179 -292
  117. warp/fem/space/basis_space.py +522 -489
  118. warp/fem/space/collocated_function_space.py +100 -105
  119. warp/fem/space/dof_mapper.py +236 -236
  120. warp/fem/space/function_space.py +148 -145
  121. warp/fem/space/grid_2d_function_space.py +148 -267
  122. warp/fem/space/grid_3d_function_space.py +167 -306
  123. warp/fem/space/hexmesh_function_space.py +253 -352
  124. warp/fem/space/nanogrid_function_space.py +202 -0
  125. warp/fem/space/partition.py +350 -350
  126. warp/fem/space/quadmesh_2d_function_space.py +261 -369
  127. warp/fem/space/restriction.py +161 -160
  128. warp/fem/space/shape/__init__.py +90 -15
  129. warp/fem/space/shape/cube_shape_function.py +728 -738
  130. warp/fem/space/shape/shape_function.py +102 -103
  131. warp/fem/space/shape/square_shape_function.py +611 -611
  132. warp/fem/space/shape/tet_shape_function.py +565 -567
  133. warp/fem/space/shape/triangle_shape_function.py +429 -429
  134. warp/fem/space/tetmesh_function_space.py +224 -292
  135. warp/fem/space/topology.py +297 -295
  136. warp/fem/space/trimesh_2d_function_space.py +153 -221
  137. warp/fem/types.py +77 -77
  138. warp/fem/utils.py +495 -495
  139. warp/jax.py +166 -141
  140. warp/jax_experimental.py +341 -339
  141. warp/native/array.h +1081 -1025
  142. warp/native/builtin.h +1603 -1560
  143. warp/native/bvh.cpp +402 -398
  144. warp/native/bvh.cu +533 -525
  145. warp/native/bvh.h +430 -429
  146. warp/native/clang/clang.cpp +496 -464
  147. warp/native/crt.cpp +42 -32
  148. warp/native/crt.h +352 -335
  149. warp/native/cuda_crt.h +1049 -1049
  150. warp/native/cuda_util.cpp +549 -540
  151. warp/native/cuda_util.h +288 -203
  152. warp/native/cutlass_gemm.cpp +34 -34
  153. warp/native/cutlass_gemm.cu +372 -372
  154. warp/native/error.cpp +66 -66
  155. warp/native/error.h +27 -27
  156. warp/native/exports.h +187 -0
  157. warp/native/fabric.h +228 -228
  158. warp/native/hashgrid.cpp +301 -278
  159. warp/native/hashgrid.cu +78 -77
  160. warp/native/hashgrid.h +227 -227
  161. warp/native/initializer_array.h +32 -32
  162. warp/native/intersect.h +1204 -1204
  163. warp/native/intersect_adj.h +365 -365
  164. warp/native/intersect_tri.h +322 -322
  165. warp/native/marching.cpp +2 -2
  166. warp/native/marching.cu +497 -497
  167. warp/native/marching.h +2 -2
  168. warp/native/mat.h +1545 -1498
  169. warp/native/matnn.h +333 -333
  170. warp/native/mesh.cpp +203 -203
  171. warp/native/mesh.cu +292 -293
  172. warp/native/mesh.h +1887 -1887
  173. warp/native/nanovdb/GridHandle.h +366 -0
  174. warp/native/nanovdb/HostBuffer.h +590 -0
  175. warp/native/nanovdb/NanoVDB.h +6624 -4782
  176. warp/native/nanovdb/PNanoVDB.h +3390 -2553
  177. warp/native/noise.h +850 -850
  178. warp/native/quat.h +1112 -1085
  179. warp/native/rand.h +303 -299
  180. warp/native/range.h +108 -108
  181. warp/native/reduce.cpp +156 -156
  182. warp/native/reduce.cu +348 -348
  183. warp/native/runlength_encode.cpp +61 -61
  184. warp/native/runlength_encode.cu +46 -46
  185. warp/native/scan.cpp +30 -30
  186. warp/native/scan.cu +36 -36
  187. warp/native/scan.h +7 -7
  188. warp/native/solid_angle.h +442 -442
  189. warp/native/sort.cpp +94 -94
  190. warp/native/sort.cu +97 -97
  191. warp/native/sort.h +14 -14
  192. warp/native/sparse.cpp +337 -337
  193. warp/native/sparse.cu +544 -544
  194. warp/native/spatial.h +630 -630
  195. warp/native/svd.h +562 -562
  196. warp/native/temp_buffer.h +30 -30
  197. warp/native/vec.h +1177 -1133
  198. warp/native/volume.cpp +529 -297
  199. warp/native/volume.cu +58 -32
  200. warp/native/volume.h +960 -538
  201. warp/native/volume_builder.cu +446 -425
  202. warp/native/volume_builder.h +34 -19
  203. warp/native/volume_impl.h +61 -0
  204. warp/native/warp.cpp +1057 -1052
  205. warp/native/warp.cu +2949 -2828
  206. warp/native/warp.h +321 -305
  207. warp/optim/__init__.py +9 -9
  208. warp/optim/adam.py +120 -120
  209. warp/optim/linear.py +1104 -939
  210. warp/optim/sgd.py +104 -92
  211. warp/render/__init__.py +10 -10
  212. warp/render/render_opengl.py +3356 -3204
  213. warp/render/render_usd.py +768 -749
  214. warp/render/utils.py +152 -150
  215. warp/sim/__init__.py +52 -59
  216. warp/sim/articulation.py +685 -685
  217. warp/sim/collide.py +1594 -1590
  218. warp/sim/import_mjcf.py +489 -481
  219. warp/sim/import_snu.py +220 -221
  220. warp/sim/import_urdf.py +536 -516
  221. warp/sim/import_usd.py +887 -881
  222. warp/sim/inertia.py +316 -317
  223. warp/sim/integrator.py +234 -233
  224. warp/sim/integrator_euler.py +1956 -1956
  225. warp/sim/integrator_featherstone.py +1917 -1991
  226. warp/sim/integrator_xpbd.py +3288 -3312
  227. warp/sim/model.py +4473 -4314
  228. warp/sim/particles.py +113 -112
  229. warp/sim/render.py +417 -403
  230. warp/sim/utils.py +413 -410
  231. warp/sparse.py +1289 -1227
  232. warp/stubs.py +2192 -2469
  233. warp/tape.py +1162 -225
  234. warp/tests/__init__.py +1 -1
  235. warp/tests/__main__.py +4 -4
  236. warp/tests/assets/test_index_grid.nvdb +0 -0
  237. warp/tests/assets/torus.usda +105 -105
  238. warp/tests/aux_test_class_kernel.py +26 -26
  239. warp/tests/aux_test_compile_consts_dummy.py +10 -10
  240. warp/tests/aux_test_conditional_unequal_types_kernels.py +21 -21
  241. warp/tests/aux_test_dependent.py +20 -22
  242. warp/tests/aux_test_grad_customs.py +21 -23
  243. warp/tests/aux_test_reference.py +9 -11
  244. warp/tests/aux_test_reference_reference.py +8 -10
  245. warp/tests/aux_test_square.py +15 -17
  246. warp/tests/aux_test_unresolved_func.py +14 -14
  247. warp/tests/aux_test_unresolved_symbol.py +14 -14
  248. warp/tests/disabled_kinematics.py +237 -239
  249. warp/tests/run_coverage_serial.py +31 -31
  250. warp/tests/test_adam.py +155 -157
  251. warp/tests/test_arithmetic.py +1088 -1124
  252. warp/tests/test_array.py +2415 -2326
  253. warp/tests/test_array_reduce.py +148 -150
  254. warp/tests/test_async.py +666 -656
  255. warp/tests/test_atomic.py +139 -141
  256. warp/tests/test_bool.py +212 -149
  257. warp/tests/test_builtins_resolution.py +1290 -1292
  258. warp/tests/test_bvh.py +162 -171
  259. warp/tests/test_closest_point_edge_edge.py +227 -228
  260. warp/tests/test_codegen.py +562 -553
  261. warp/tests/test_compile_consts.py +217 -101
  262. warp/tests/test_conditional.py +244 -246
  263. warp/tests/test_copy.py +230 -215
  264. warp/tests/test_ctypes.py +630 -632
  265. warp/tests/test_dense.py +65 -67
  266. warp/tests/test_devices.py +89 -98
  267. warp/tests/test_dlpack.py +528 -529
  268. warp/tests/test_examples.py +403 -378
  269. warp/tests/test_fabricarray.py +952 -955
  270. warp/tests/test_fast_math.py +60 -54
  271. warp/tests/test_fem.py +1298 -1278
  272. warp/tests/test_fp16.py +128 -130
  273. warp/tests/test_func.py +336 -337
  274. warp/tests/test_generics.py +596 -571
  275. warp/tests/test_grad.py +885 -640
  276. warp/tests/test_grad_customs.py +331 -336
  277. warp/tests/test_hash_grid.py +208 -164
  278. warp/tests/test_import.py +37 -39
  279. warp/tests/test_indexedarray.py +1132 -1134
  280. warp/tests/test_intersect.py +65 -67
  281. warp/tests/test_jax.py +305 -307
  282. warp/tests/test_large.py +169 -164
  283. warp/tests/test_launch.py +352 -354
  284. warp/tests/test_lerp.py +217 -261
  285. warp/tests/test_linear_solvers.py +189 -171
  286. warp/tests/test_lvalue.py +419 -493
  287. warp/tests/test_marching_cubes.py +63 -65
  288. warp/tests/test_mat.py +1799 -1827
  289. warp/tests/test_mat_lite.py +113 -115
  290. warp/tests/test_mat_scalar_ops.py +2905 -2889
  291. warp/tests/test_math.py +124 -193
  292. warp/tests/test_matmul.py +498 -499
  293. warp/tests/test_matmul_lite.py +408 -410
  294. warp/tests/test_mempool.py +186 -190
  295. warp/tests/test_mesh.py +281 -324
  296. warp/tests/test_mesh_query_aabb.py +226 -241
  297. warp/tests/test_mesh_query_point.py +690 -702
  298. warp/tests/test_mesh_query_ray.py +290 -303
  299. warp/tests/test_mlp.py +274 -276
  300. warp/tests/test_model.py +108 -110
  301. warp/tests/test_module_hashing.py +111 -0
  302. warp/tests/test_modules_lite.py +36 -39
  303. warp/tests/test_multigpu.py +161 -163
  304. warp/tests/test_noise.py +244 -248
  305. warp/tests/test_operators.py +248 -250
  306. warp/tests/test_options.py +121 -125
  307. warp/tests/test_peer.py +131 -137
  308. warp/tests/test_pinned.py +76 -78
  309. warp/tests/test_print.py +52 -54
  310. warp/tests/test_quat.py +2084 -2086
  311. warp/tests/test_rand.py +324 -288
  312. warp/tests/test_reload.py +207 -217
  313. warp/tests/test_rounding.py +177 -179
  314. warp/tests/test_runlength_encode.py +188 -190
  315. warp/tests/test_sim_grad.py +241 -0
  316. warp/tests/test_sim_kinematics.py +89 -97
  317. warp/tests/test_smoothstep.py +166 -168
  318. warp/tests/test_snippet.py +303 -266
  319. warp/tests/test_sparse.py +466 -460
  320. warp/tests/test_spatial.py +2146 -2148
  321. warp/tests/test_special_values.py +362 -0
  322. warp/tests/test_streams.py +484 -473
  323. warp/tests/test_struct.py +708 -675
  324. warp/tests/test_tape.py +171 -148
  325. warp/tests/test_torch.py +741 -743
  326. warp/tests/test_transient_module.py +85 -87
  327. warp/tests/test_types.py +554 -659
  328. warp/tests/test_utils.py +488 -499
  329. warp/tests/test_vec.py +1262 -1268
  330. warp/tests/test_vec_lite.py +71 -73
  331. warp/tests/test_vec_scalar_ops.py +2097 -2099
  332. warp/tests/test_verify_fp.py +92 -94
  333. warp/tests/test_volume.py +961 -736
  334. warp/tests/test_volume_write.py +338 -265
  335. warp/tests/unittest_serial.py +38 -37
  336. warp/tests/unittest_suites.py +367 -359
  337. warp/tests/unittest_utils.py +434 -578
  338. warp/tests/unused_test_misc.py +69 -71
  339. warp/tests/walkthrough_debug.py +85 -85
  340. warp/thirdparty/appdirs.py +598 -598
  341. warp/thirdparty/dlpack.py +143 -143
  342. warp/thirdparty/unittest_parallel.py +563 -561
  343. warp/torch.py +321 -295
  344. warp/types.py +4941 -4450
  345. warp/utils.py +1008 -821
  346. {warp_lang-1.0.2.dist-info → warp_lang-1.2.0.dist-info}/LICENSE.md +126 -126
  347. {warp_lang-1.0.2.dist-info → warp_lang-1.2.0.dist-info}/METADATA +365 -400
  348. warp_lang-1.2.0.dist-info/RECORD +359 -0
  349. warp/examples/assets/cube.usda +0 -42
  350. warp/examples/assets/sphere.usda +0 -56
  351. warp/examples/assets/torus.usda +0 -105
  352. warp/examples/fem/example_convection_diffusion_dg0.py +0 -194
  353. warp/native/nanovdb/PNanoVDBWrite.h +0 -295
  354. warp_lang-1.0.2.dist-info/RECORD +0 -352
  355. {warp_lang-1.0.2.dist-info → warp_lang-1.2.0.dist-info}/WHEEL +0 -0
  356. {warp_lang-1.0.2.dist-info → warp_lang-1.2.0.dist-info}/top_level.txt +0 -0
@@ -1,744 +1,748 @@
1
- from typing import Tuple, List
2
-
3
- from warp.fem.types import Coords
4
- from warp.fem.polynomial import Polynomial, quadrature_1d
5
-
6
-
7
- class Element:
8
- def measure() -> float:
9
- """Measure (area, volume, ...) of the reference element"""
10
- raise NotImplementedError
11
-
12
- @staticmethod
13
- def instantiate_quadrature(order: int, family: Polynomial) -> Tuple[List[Coords], List[float]]:
14
- """Returns a quadrature of a given order for a prototypical element"""
15
- raise NotImplementedError
16
-
17
-
18
- def _point_count_from_order(order: int, family: Polynomial):
19
- if family == Polynomial.GAUSS_LEGENDRE:
20
- point_count = max(1, order // 2 + 1)
21
- elif family == Polynomial.LOBATTO_GAUSS_LEGENDRE:
22
- point_count = max(2, order // 2 + 2)
23
- elif family == Polynomial.EQUISPACED_CLOSED:
24
- point_count = max(2, 2 * (order // 2) + 1)
25
- elif family == Polynomial.EQUISPACED_OPEN:
26
- point_count = max(1, 2 * (order // 2) + 1)
27
-
28
- return point_count
29
-
30
-
31
- class Cube(Element):
32
- @staticmethod
33
- def measure() -> float:
34
- return 1.0
35
-
36
- @staticmethod
37
- def instantiate_quadrature(order: int, family: Polynomial):
38
- if family is None:
39
- family = Polynomial.GAUSS_LEGENDRE
40
-
41
- point_count = _point_count_from_order(order=order, family=family)
42
- gauss_1d, weights_1d = quadrature_1d(point_count=point_count, family=family)
43
-
44
- coords = [Coords(x, y, z) for x in gauss_1d for y in gauss_1d for z in gauss_1d]
45
- weights = [wx * wy * wz for wx in weights_1d for wy in weights_1d for wz in weights_1d]
46
-
47
- return coords, weights
48
-
49
-
50
- class Square(Element):
51
- @staticmethod
52
- def measure() -> float:
53
- return 1.0
54
-
55
- @staticmethod
56
- def instantiate_quadrature(order: int, family: Polynomial):
57
- if family is None:
58
- family = Polynomial.GAUSS_LEGENDRE
59
-
60
- point_count = _point_count_from_order(order=order, family=family)
61
- gauss_1d, weights_1d = quadrature_1d(point_count=point_count, family=family)
62
-
63
- coords = [Coords(x, y, 0.0) for x in gauss_1d for y in gauss_1d]
64
- weights = [wx * wy for wx in weights_1d for wy in weights_1d]
65
-
66
- return coords, weights
67
-
68
-
69
- class LinearEdge(Element):
70
- @staticmethod
71
- def measure() -> float:
72
- return 1.0
73
-
74
- @staticmethod
75
- def instantiate_quadrature(order: int, family: Polynomial):
76
- if family is None:
77
- family = Polynomial.GAUSS_LEGENDRE
78
-
79
- point_count = _point_count_from_order(order=order, family=family)
80
- gauss_1d, weights_1d = quadrature_1d(point_count=point_count, family=family)
81
-
82
- coords = [Coords(x, 0.0, 0.0) for x in gauss_1d]
83
- return coords, weights_1d
84
-
85
-
86
- class Triangle(Element):
87
- @staticmethod
88
- def measure() -> float:
89
- return 0.5
90
-
91
- @staticmethod
92
- def instantiate_quadrature(order: int, family: Polynomial):
93
- if family is not None:
94
- # Duffy transformation from square to triangle
95
- point_count = _point_count_from_order(order=order + 1, family=family)
96
- gauss_1d, weights_1d = quadrature_1d(point_count=point_count, family=family)
97
-
98
- coords = [Coords(1.0 - x - y + x * y, x, y * (1.0 - x)) for x in gauss_1d for y in gauss_1d]
99
-
100
- # Scale weight by 2.0 so that they sum up to 1
101
- weights = [2.0 * wx * (1.0 - x) * wy for x, wx in zip(gauss_1d, weights_1d) for wy in weights_1d]
102
-
103
- return coords, weights
104
-
105
- if order <= 1:
106
- weights = [1.0]
107
- coords = [Coords(1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0)]
108
- elif order <= 2:
109
- weights = [1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0]
110
- coords = [
111
- Coords(2.0 / 3.0, 1.0 / 6.0, 1.0 / 6.0),
112
- Coords(1.0 / 6.0, 2.0 / 3.0, 1.0 / 6.0),
113
- Coords(1.0 / 6.0, 1.0 / 6.0, 2.0 / 3.0),
114
- ]
115
- elif order <= 3:
116
- # Hillion 1977,
117
- # "Numerical Integration on a Triangle"
118
- weights = [
119
- 3.18041381743977225049491153185954e-01,
120
- 3.18041381743977225049491153185954e-01,
121
- 1.81958618256022719439357615556219e-01,
122
- 1.81958618256022719439357615556219e-01,
123
- ]
124
-
125
- coords = [
126
- Coords(
127
- 6.66390246014701426169324349757517e-01,
128
- 1.78558728263616461884311092944699e-01,
129
- 1.55051025721682111946364557297784e-01,
130
- ),
131
- Coords(
132
- 1.78558728263616461884311092944699e-01,
133
- 6.66390246014701426169324349757517e-01,
134
- 1.55051025721682056435213326039957e-01,
135
- ),
136
- Coords(
137
- 2.80019915499074012465996474929852e-01,
138
- 7.50311102226081383381739442484104e-02,
139
- 6.44948974278317876951405196450651e-01,
140
- ),
141
- Coords(
142
- 7.50311102226081383381739442484104e-02,
143
- 2.80019915499074012465996474929852e-01,
144
- 6.44948974278317876951405196450651e-01,
145
- ),
146
- ]
147
- elif order <= 4:
148
- # Witherden and Vincent 2015,
149
- # "On the identification of symmetric quadrature rules for finite element methods"
150
- # https://doi.org/10.1016/j.camwa.2015.03.017
151
-
152
- weights = [
153
- 2.23381589678011471811203136894619e-01,
154
- 2.23381589678011471811203136894619e-01,
155
- 2.23381589678011471811203136894619e-01,
156
- 1.09951743655321870773988734981685e-01,
157
- 1.09951743655321870773988734981685e-01,
158
- 1.09951743655321870773988734981685e-01,
159
- ]
160
-
161
- coords = [
162
- Coords(
163
- 4.45948490915964890213274429697776e-01,
164
- 4.45948490915964890213274429697776e-01,
165
- 1.08103018168070219573451140604448e-01,
166
- ),
167
- Coords(
168
- 4.45948490915964890213274429697776e-01,
169
- 1.08103018168070219573451140604448e-01,
170
- 4.45948490915964890213274429697776e-01,
171
- ),
172
- Coords(
173
- 1.08103018168070219573451140604448e-01,
174
- 4.45948490915964890213274429697776e-01,
175
- 4.45948490915964890213274429697776e-01,
176
- ),
177
- Coords(
178
- 9.15762135097707430375635340169538e-02,
179
- 9.15762135097707430375635340169538e-02,
180
- 8.16847572980458513924872931966092e-01,
181
- ),
182
- Coords(
183
- 9.15762135097707430375635340169538e-02,
184
- 8.16847572980458513924872931966092e-01,
185
- 9.15762135097707430375635340169538e-02,
186
- ),
187
- Coords(
188
- 8.16847572980458513924872931966092e-01,
189
- 9.15762135097707430375635340169538e-02,
190
- 9.15762135097707430375635340169538e-02,
191
- ),
192
- ]
193
-
194
- elif order <= 5:
195
- weights = [
196
- 2.25000000000000005551115123125783e-01,
197
- 1.25939180544827139529573400977824e-01,
198
- 1.25939180544827139529573400977824e-01,
199
- 1.25939180544827139529573400977824e-01,
200
- 1.32394152788506191953388224646915e-01,
201
- 1.32394152788506191953388224646915e-01,
202
- 1.32394152788506191953388224646915e-01,
203
- ]
204
-
205
- coords = [
206
- Coords(
207
- 3.33333333333333314829616256247391e-01,
208
- 3.33333333333333314829616256247391e-01,
209
- 3.33333333333333314829616256247391e-01,
210
- ),
211
- Coords(
212
- 1.01286507323456342888334802410100e-01,
213
- 1.01286507323456342888334802410100e-01,
214
- 7.97426985353087314223330395179801e-01,
215
- ),
216
- Coords(
217
- 1.01286507323456342888334802410100e-01,
218
- 7.97426985353087314223330395179801e-01,
219
- 1.01286507323456342888334802410100e-01,
220
- ),
221
- Coords(
222
- 7.97426985353087314223330395179801e-01,
223
- 1.01286507323456342888334802410100e-01,
224
- 1.01286507323456342888334802410100e-01,
225
- ),
226
- Coords(
227
- 4.70142064105115109473587153843255e-01,
228
- 4.70142064105115109473587153843255e-01,
229
- 5.97158717897697810528256923134904e-02,
230
- ),
231
- Coords(
232
- 4.70142064105115109473587153843255e-01,
233
- 5.97158717897697810528256923134904e-02,
234
- 4.70142064105115109473587153843255e-01,
235
- ),
236
- Coords(
237
- 5.97158717897697810528256923134904e-02,
238
- 4.70142064105115109473587153843255e-01,
239
- 4.70142064105115109473587153843255e-01,
240
- ),
241
- ]
242
- elif order <= 6:
243
- weights = [
244
- 5.08449063702068326797700592578622e-02,
245
- 5.08449063702068326797700592578622e-02,
246
- 5.08449063702068326797700592578622e-02,
247
- 1.16786275726379396022736045779311e-01,
248
- 1.16786275726379396022736045779311e-01,
249
- 1.16786275726379396022736045779311e-01,
250
- 8.28510756183735846969184990484791e-02,
251
- 8.28510756183735846969184990484791e-02,
252
- 8.28510756183735846969184990484791e-02,
253
- 8.28510756183735846969184990484791e-02,
254
- 8.28510756183735846969184990484791e-02,
255
- 8.28510756183735846969184990484791e-02,
256
- ]
257
-
258
- coords = [
259
- Coords(
260
- 6.30890144915022266225435032538371e-02,
261
- 6.30890144915022266225435032538371e-02,
262
- 8.73821971016995546754912993492326e-01,
263
- ),
264
- Coords(
265
- 6.30890144915022266225435032538371e-02,
266
- 8.73821971016995546754912993492326e-01,
267
- 6.30890144915022266225435032538371e-02,
268
- ),
269
- Coords(
270
- 8.73821971016995546754912993492326e-01,
271
- 6.30890144915022266225435032538371e-02,
272
- 6.30890144915022266225435032538371e-02,
273
- ),
274
- Coords(
275
- 2.49286745170910428726074314909056e-01,
276
- 2.49286745170910428726074314909056e-01,
277
- 5.01426509658179142547851370181888e-01,
278
- ),
279
- Coords(
280
- 2.49286745170910428726074314909056e-01,
281
- 5.01426509658179142547851370181888e-01,
282
- 2.49286745170910428726074314909056e-01,
283
- ),
284
- Coords(
285
- 5.01426509658179142547851370181888e-01,
286
- 2.49286745170910428726074314909056e-01,
287
- 2.49286745170910428726074314909056e-01,
288
- ),
289
- Coords(
290
- 5.31450498448169383891581674106419e-02,
291
- 3.10352451033784393352732422499685e-01,
292
- 6.36502499121398668258109410089673e-01,
293
- ),
294
- Coords(
295
- 5.31450498448169383891581674106419e-02,
296
- 6.36502499121398668258109410089673e-01,
297
- 3.10352451033784393352732422499685e-01,
298
- ),
299
- Coords(
300
- 3.10352451033784393352732422499685e-01,
301
- 5.31450498448169383891581674106419e-02,
302
- 6.36502499121398668258109410089673e-01,
303
- ),
304
- Coords(
305
- 3.10352451033784393352732422499685e-01,
306
- 6.36502499121398668258109410089673e-01,
307
- 5.31450498448169383891581674106419e-02,
308
- ),
309
- Coords(
310
- 6.36502499121398668258109410089673e-01,
311
- 5.31450498448169383891581674106419e-02,
312
- 3.10352451033784393352732422499685e-01,
313
- ),
314
- Coords(
315
- 6.36502499121398668258109410089673e-01,
316
- 3.10352451033784393352732422499685e-01,
317
- 5.31450498448169383891581674106419e-02,
318
- ),
319
- ]
320
- else:
321
- # Order 8
322
-
323
- weights = [
324
- 1.44315607677787172136163462710101e-01,
325
- 9.50916342672846193195823616406415e-02,
326
- 9.50916342672846193195823616406415e-02,
327
- 9.50916342672846193195823616406415e-02,
328
- 1.03217370534718244634575512463925e-01,
329
- 1.03217370534718244634575512463925e-01,
330
- 1.03217370534718244634575512463925e-01,
331
- 3.24584976231980792960030157701112e-02,
332
- 3.24584976231980792960030157701112e-02,
333
- 3.24584976231980792960030157701112e-02,
334
- 2.72303141744349927466650740370824e-02,
335
- 2.72303141744349927466650740370824e-02,
336
- 2.72303141744349927466650740370824e-02,
337
- 2.72303141744349927466650740370824e-02,
338
- 2.72303141744349927466650740370824e-02,
339
- 2.72303141744349927466650740370824e-02,
340
- ]
341
-
342
- coords = [
343
- Coords(
344
- 3.33333333333333314829616256247391e-01,
345
- 3.33333333333333314829616256247391e-01,
346
- 3.33333333333333314829616256247391e-01,
347
- ),
348
- Coords(
349
- 4.59292588292723125142913431773195e-01,
350
- 4.59292588292723125142913431773195e-01,
351
- 8.14148234145537497141731364536099e-02,
352
- ),
353
- Coords(
354
- 4.59292588292723125142913431773195e-01,
355
- 8.14148234145537497141731364536099e-02,
356
- 4.59292588292723125142913431773195e-01,
357
- ),
358
- Coords(
359
- 8.14148234145537497141731364536099e-02,
360
- 4.59292588292723125142913431773195e-01,
361
- 4.59292588292723125142913431773195e-01,
362
- ),
363
- Coords(
364
- 1.70569307751760212976677166807349e-01,
365
- 1.70569307751760212976677166807349e-01,
366
- 6.58861384496479574046645666385302e-01,
367
- ),
368
- Coords(
369
- 1.70569307751760212976677166807349e-01,
370
- 6.58861384496479574046645666385302e-01,
371
- 1.70569307751760212976677166807349e-01,
372
- ),
373
- Coords(
374
- 6.58861384496479574046645666385302e-01,
375
- 1.70569307751760212976677166807349e-01,
376
- 1.70569307751760212976677166807349e-01,
377
- ),
378
- Coords(
379
- 5.05472283170309566457945038564503e-02,
380
- 5.05472283170309566457945038564503e-02,
381
- 8.98905543365938086708410992287099e-01,
382
- ),
383
- Coords(
384
- 5.05472283170309566457945038564503e-02,
385
- 8.98905543365938086708410992287099e-01,
386
- 5.05472283170309566457945038564503e-02,
387
- ),
388
- Coords(
389
- 8.98905543365938086708410992287099e-01,
390
- 5.05472283170309566457945038564503e-02,
391
- 5.05472283170309566457945038564503e-02,
392
- ),
393
- Coords(
394
- 8.39477740995758781039626228448469e-03,
395
- 2.63112829634638112352718053443823e-01,
396
- 7.28492392955404355348036915529519e-01,
397
- ),
398
- Coords(
399
- 8.39477740995758781039626228448469e-03,
400
- 7.28492392955404355348036915529519e-01,
401
- 2.63112829634638112352718053443823e-01,
402
- ),
403
- Coords(
404
- 2.63112829634638112352718053443823e-01,
405
- 8.39477740995758781039626228448469e-03,
406
- 7.28492392955404355348036915529519e-01,
407
- ),
408
- Coords(
409
- 2.63112829634638112352718053443823e-01,
410
- 7.28492392955404355348036915529519e-01,
411
- 8.39477740995758781039626228448469e-03,
412
- ),
413
- Coords(
414
- 7.28492392955404355348036915529519e-01,
415
- 8.39477740995758781039626228448469e-03,
416
- 2.63112829634638112352718053443823e-01,
417
- ),
418
- Coords(
419
- 7.28492392955404355348036915529519e-01,
420
- 2.63112829634638112352718053443823e-01,
421
- 8.39477740995758781039626228448469e-03,
422
- ),
423
- ]
424
-
425
- return coords, weights
426
-
427
-
428
- class Tetrahedron(Element):
429
- @staticmethod
430
- def measure() -> float:
431
- return 1.0 / 6.0
432
-
433
- @staticmethod
434
- def instantiate_quadrature(order: int, family: Polynomial):
435
- if family is not None:
436
- # Duffy transformation from square to triangle
437
- point_count = _point_count_from_order(order=order + 1, family=family)
438
- gauss_1d, weights_1d = quadrature_1d(point_count=point_count, family=family)
439
-
440
- coords = [
441
- Coords(x, y * (1.0 - x), z * (1.0 - x) * (1.0 - y))
442
- for x in gauss_1d
443
- for y in gauss_1d
444
- for z in gauss_1d
445
- ]
446
-
447
- # Scale weight by 6.0 so that they sum up to 1
448
- weights = [
449
- 6.0 * wx * wy * wz * (1.0 - x) * (1.0 - x) * (1.0 - y)
450
- for x, wx in zip(gauss_1d, weights_1d)
451
- for y, wy in zip(gauss_1d, weights_1d)
452
- for wz in weights_1d
453
- ]
454
-
455
- return coords, weights
456
-
457
- # Shunn and Ham 2012
458
- # "Symmetric quadrature rules for tetrahedra based on a cubic close-packed lattice arrangement"
459
- # https://doi.org/10.1016/j.cam.2012.03.032
460
-
461
- # TODO: add Witherden and Vincent 2015,
462
-
463
- if order <= 1:
464
- weights = [1.0]
465
- coords = [Coords(1.0 / 4.0, 1.0 / 4.0, 1.0 / 4.0)]
466
- elif order <= 2:
467
- weights = [1.0 / 4.0, 1.0 / 4.0, 1.0 / 4.0, 1.0 / 4.0]
468
- coords = [
469
- Coords(0.1381966011250110, 0.1381966011250110, 0.1381966011250110),
470
- Coords(0.5854101966249680, 0.1381966011250110, 0.1381966011250110),
471
- Coords(0.1381966011250110, 0.5854101966249680, 0.1381966011250110),
472
- Coords(0.1381966011250110, 0.1381966011250110, 0.5854101966249680),
473
- ]
474
- elif order <= 3:
475
- weights = [
476
- 0.0476331348432089,
477
- 0.0476331348432089,
478
- 0.0476331348432089,
479
- 0.0476331348432089,
480
- 0.1349112434378610,
481
- 0.1349112434378610,
482
- 0.1349112434378610,
483
- 0.1349112434378610,
484
- 0.1349112434378610,
485
- 0.1349112434378610,
486
- ]
487
-
488
- coords = [
489
- Coords(0.0738349017262234, 0.0738349017262234, 0.0738349017262234),
490
- Coords(0.7784952948213300, 0.0738349017262234, 0.0738349017262234),
491
- Coords(0.0738349017262234, 0.7784952948213300, 0.0738349017262234),
492
- Coords(0.0738349017262234, 0.0738349017262234, 0.7784952948213300),
493
- Coords(0.4062443438840510, 0.0937556561159491, 0.0937556561159491),
494
- Coords(0.0937556561159491, 0.4062443438840510, 0.0937556561159491),
495
- Coords(0.0937556561159491, 0.0937556561159491, 0.4062443438840510),
496
- Coords(0.4062443438840510, 0.4062443438840510, 0.0937556561159491),
497
- Coords(0.4062443438840510, 0.0937556561159491, 0.4062443438840510),
498
- Coords(0.0937556561159491, 0.4062443438840510, 0.4062443438840510),
499
- ]
500
- elif order <= 4:
501
- weights = [
502
- 0.0070670747944695,
503
- 0.0070670747944695,
504
- 0.0070670747944695,
505
- 0.0070670747944695,
506
- 0.0469986689718877,
507
- 0.0469986689718877,
508
- 0.0469986689718877,
509
- 0.0469986689718877,
510
- 0.0469986689718877,
511
- 0.0469986689718877,
512
- 0.0469986689718877,
513
- 0.0469986689718877,
514
- 0.0469986689718877,
515
- 0.0469986689718877,
516
- 0.0469986689718877,
517
- 0.0469986689718877,
518
- 0.1019369182898680,
519
- 0.1019369182898680,
520
- 0.1019369182898680,
521
- 0.1019369182898680,
522
- ]
523
-
524
- coords = [
525
- Coords(0.0323525947272439, 0.0323525947272439, 0.0323525947272439),
526
- Coords(0.9029422158182680, 0.0323525947272439, 0.0323525947272439),
527
- Coords(0.0323525947272439, 0.9029422158182680, 0.0323525947272439),
528
- Coords(0.0323525947272439, 0.0323525947272439, 0.9029422158182680),
529
- Coords(0.6165965330619370, 0.0603604415251421, 0.0603604415251421),
530
- Coords(0.2626825838877790, 0.0603604415251421, 0.0603604415251421),
531
- Coords(0.0603604415251421, 0.6165965330619370, 0.0603604415251421),
532
- Coords(0.0603604415251421, 0.2626825838877790, 0.0603604415251421),
533
- Coords(0.0603604415251421, 0.0603604415251421, 0.6165965330619370),
534
- Coords(0.0603604415251421, 0.0603604415251421, 0.2626825838877790),
535
- Coords(0.2626825838877790, 0.6165965330619370, 0.0603604415251421),
536
- Coords(0.6165965330619370, 0.2626825838877790, 0.0603604415251421),
537
- Coords(0.2626825838877790, 0.0603604415251421, 0.6165965330619370),
538
- Coords(0.6165965330619370, 0.0603604415251421, 0.2626825838877790),
539
- Coords(0.0603604415251421, 0.2626825838877790, 0.6165965330619370),
540
- Coords(0.0603604415251421, 0.6165965330619370, 0.2626825838877790),
541
- Coords(0.3097693042728620, 0.3097693042728620, 0.0706920871814129),
542
- Coords(0.3097693042728620, 0.0706920871814129, 0.3097693042728620),
543
- Coords(0.0706920871814129, 0.3097693042728620, 0.3097693042728620),
544
- Coords(0.3097693042728620, 0.3097693042728620, 0.3097693042728620),
545
- ]
546
-
547
- elif order <= 5:
548
- weights = [
549
- 0.0021900463965388,
550
- 0.0021900463965388,
551
- 0.0021900463965388,
552
- 0.0021900463965388,
553
- 0.0143395670177665,
554
- 0.0143395670177665,
555
- 0.0143395670177665,
556
- 0.0143395670177665,
557
- 0.0143395670177665,
558
- 0.0143395670177665,
559
- 0.0143395670177665,
560
- 0.0143395670177665,
561
- 0.0143395670177665,
562
- 0.0143395670177665,
563
- 0.0143395670177665,
564
- 0.0143395670177665,
565
- 0.0250305395686746,
566
- 0.0250305395686746,
567
- 0.0250305395686746,
568
- 0.0250305395686746,
569
- 0.0250305395686746,
570
- 0.0250305395686746,
571
- 0.0479839333057554,
572
- 0.0479839333057554,
573
- 0.0479839333057554,
574
- 0.0479839333057554,
575
- 0.0479839333057554,
576
- 0.0479839333057554,
577
- 0.0479839333057554,
578
- 0.0479839333057554,
579
- 0.0479839333057554,
580
- 0.0479839333057554,
581
- 0.0479839333057554,
582
- 0.0479839333057554,
583
- 0.0931745731195340,
584
- ]
585
-
586
- coords = [
587
- Coords(0.0267367755543735, 0.0267367755543735, 0.0267367755543735),
588
- Coords(0.9197896733368800, 0.0267367755543735, 0.0267367755543735),
589
- Coords(0.0267367755543735, 0.9197896733368800, 0.0267367755543735),
590
- Coords(0.0267367755543735, 0.0267367755543735, 0.9197896733368800),
591
- Coords(0.7477598884818090, 0.0391022406356488, 0.0391022406356488),
592
- Coords(0.1740356302468940, 0.0391022406356488, 0.0391022406356488),
593
- Coords(0.0391022406356488, 0.7477598884818090, 0.0391022406356488),
594
- Coords(0.0391022406356488, 0.1740356302468940, 0.0391022406356488),
595
- Coords(0.0391022406356488, 0.0391022406356488, 0.7477598884818090),
596
- Coords(0.0391022406356488, 0.0391022406356488, 0.1740356302468940),
597
- Coords(0.1740356302468940, 0.7477598884818090, 0.0391022406356488),
598
- Coords(0.7477598884818090, 0.1740356302468940, 0.0391022406356488),
599
- Coords(0.1740356302468940, 0.0391022406356488, 0.7477598884818090),
600
- Coords(0.7477598884818090, 0.0391022406356488, 0.1740356302468940),
601
- Coords(0.0391022406356488, 0.1740356302468940, 0.7477598884818090),
602
- Coords(0.0391022406356488, 0.7477598884818090, 0.1740356302468940),
603
- Coords(0.4547545999844830, 0.0452454000155172, 0.0452454000155172),
604
- Coords(0.0452454000155172, 0.4547545999844830, 0.0452454000155172),
605
- Coords(0.0452454000155172, 0.0452454000155172, 0.4547545999844830),
606
- Coords(0.4547545999844830, 0.4547545999844830, 0.0452454000155172),
607
- Coords(0.4547545999844830, 0.0452454000155172, 0.4547545999844830),
608
- Coords(0.0452454000155172, 0.4547545999844830, 0.4547545999844830),
609
- Coords(0.2232010379623150, 0.2232010379623150, 0.0504792790607720),
610
- Coords(0.5031186450145980, 0.2232010379623150, 0.0504792790607720),
611
- Coords(0.2232010379623150, 0.5031186450145980, 0.0504792790607720),
612
- Coords(0.2232010379623150, 0.0504792790607720, 0.2232010379623150),
613
- Coords(0.5031186450145980, 0.0504792790607720, 0.2232010379623150),
614
- Coords(0.2232010379623150, 0.0504792790607720, 0.5031186450145980),
615
- Coords(0.0504792790607720, 0.2232010379623150, 0.2232010379623150),
616
- Coords(0.0504792790607720, 0.5031186450145980, 0.2232010379623150),
617
- Coords(0.0504792790607720, 0.2232010379623150, 0.5031186450145980),
618
- Coords(0.5031186450145980, 0.2232010379623150, 0.2232010379623150),
619
- Coords(0.2232010379623150, 0.5031186450145980, 0.2232010379623150),
620
- Coords(0.2232010379623150, 0.2232010379623150, 0.5031186450145980),
621
- Coords(0.2500000000000000, 0.2500000000000000, 0.2500000000000000),
622
- ]
623
- elif order <= 6:
624
- weights = [
625
- 0.0010373112336140,
626
- 0.0010373112336140,
627
- 0.0010373112336140,
628
- 0.0010373112336140,
629
- 0.0096016645399480,
630
- 0.0096016645399480,
631
- 0.0096016645399480,
632
- 0.0096016645399480,
633
- 0.0096016645399480,
634
- 0.0096016645399480,
635
- 0.0096016645399480,
636
- 0.0096016645399480,
637
- 0.0096016645399480,
638
- 0.0096016645399480,
639
- 0.0096016645399480,
640
- 0.0096016645399480,
641
- 0.0164493976798232,
642
- 0.0164493976798232,
643
- 0.0164493976798232,
644
- 0.0164493976798232,
645
- 0.0164493976798232,
646
- 0.0164493976798232,
647
- 0.0164493976798232,
648
- 0.0164493976798232,
649
- 0.0164493976798232,
650
- 0.0164493976798232,
651
- 0.0164493976798232,
652
- 0.0164493976798232,
653
- 0.0153747766513310,
654
- 0.0153747766513310,
655
- 0.0153747766513310,
656
- 0.0153747766513310,
657
- 0.0153747766513310,
658
- 0.0153747766513310,
659
- 0.0153747766513310,
660
- 0.0153747766513310,
661
- 0.0153747766513310,
662
- 0.0153747766513310,
663
- 0.0153747766513310,
664
- 0.0153747766513310,
665
- 0.0293520118375230,
666
- 0.0293520118375230,
667
- 0.0293520118375230,
668
- 0.0293520118375230,
669
- 0.0293520118375230,
670
- 0.0293520118375230,
671
- 0.0293520118375230,
672
- 0.0293520118375230,
673
- 0.0293520118375230,
674
- 0.0293520118375230,
675
- 0.0293520118375230,
676
- 0.0293520118375230,
677
- 0.0366291366405108,
678
- 0.0366291366405108,
679
- 0.0366291366405108,
680
- 0.0366291366405108,
681
- ]
682
-
683
- coords = [
684
- Coords(0.0149520651530592, 0.0149520651530592, 0.0149520651530592),
685
- Coords(0.9551438045408220, 0.0149520651530592, 0.0149520651530592),
686
- Coords(0.0149520651530592, 0.9551438045408220, 0.0149520651530592),
687
- Coords(0.0149520651530592, 0.0149520651530592, 0.9551438045408220),
688
- Coords(0.1518319491659370, 0.0340960211962615, 0.0340960211962615),
689
- Coords(0.7799760084415400, 0.0340960211962615, 0.0340960211962615),
690
- Coords(0.0340960211962615, 0.1518319491659370, 0.0340960211962615),
691
- Coords(0.0340960211962615, 0.7799760084415400, 0.0340960211962615),
692
- Coords(0.0340960211962615, 0.0340960211962615, 0.1518319491659370),
693
- Coords(0.0340960211962615, 0.0340960211962615, 0.7799760084415400),
694
- Coords(0.7799760084415400, 0.1518319491659370, 0.0340960211962615),
695
- Coords(0.1518319491659370, 0.7799760084415400, 0.0340960211962615),
696
- Coords(0.7799760084415400, 0.0340960211962615, 0.1518319491659370),
697
- Coords(0.1518319491659370, 0.0340960211962615, 0.7799760084415400),
698
- Coords(0.0340960211962615, 0.7799760084415400, 0.1518319491659370),
699
- Coords(0.0340960211962615, 0.1518319491659370, 0.7799760084415400),
700
- Coords(0.5526556431060170, 0.0462051504150017, 0.0462051504150017),
701
- Coords(0.3549340560639790, 0.0462051504150017, 0.0462051504150017),
702
- Coords(0.0462051504150017, 0.5526556431060170, 0.0462051504150017),
703
- Coords(0.0462051504150017, 0.3549340560639790, 0.0462051504150017),
704
- Coords(0.0462051504150017, 0.0462051504150017, 0.5526556431060170),
705
- Coords(0.0462051504150017, 0.0462051504150017, 0.3549340560639790),
706
- Coords(0.3549340560639790, 0.5526556431060170, 0.0462051504150017),
707
- Coords(0.5526556431060170, 0.3549340560639790, 0.0462051504150017),
708
- Coords(0.3549340560639790, 0.0462051504150017, 0.5526556431060170),
709
- Coords(0.5526556431060170, 0.0462051504150017, 0.3549340560639790),
710
- Coords(0.0462051504150017, 0.3549340560639790, 0.5526556431060170),
711
- Coords(0.0462051504150017, 0.5526556431060170, 0.3549340560639790),
712
- Coords(0.2281904610687610, 0.2281904610687610, 0.0055147549744775),
713
- Coords(0.5381043228880020, 0.2281904610687610, 0.0055147549744775),
714
- Coords(0.2281904610687610, 0.5381043228880020, 0.0055147549744775),
715
- Coords(0.2281904610687610, 0.0055147549744775, 0.2281904610687610),
716
- Coords(0.5381043228880020, 0.0055147549744775, 0.2281904610687610),
717
- Coords(0.2281904610687610, 0.0055147549744775, 0.5381043228880020),
718
- Coords(0.0055147549744775, 0.2281904610687610, 0.2281904610687610),
719
- Coords(0.0055147549744775, 0.5381043228880020, 0.2281904610687610),
720
- Coords(0.0055147549744775, 0.2281904610687610, 0.5381043228880020),
721
- Coords(0.5381043228880020, 0.2281904610687610, 0.2281904610687610),
722
- Coords(0.2281904610687610, 0.5381043228880020, 0.2281904610687610),
723
- Coords(0.2281904610687610, 0.2281904610687610, 0.5381043228880020),
724
- Coords(0.3523052600879940, 0.3523052600879940, 0.0992057202494530),
725
- Coords(0.1961837595745600, 0.3523052600879940, 0.0992057202494530),
726
- Coords(0.3523052600879940, 0.1961837595745600, 0.0992057202494530),
727
- Coords(0.3523052600879940, 0.0992057202494530, 0.3523052600879940),
728
- Coords(0.1961837595745600, 0.0992057202494530, 0.3523052600879940),
729
- Coords(0.3523052600879940, 0.0992057202494530, 0.1961837595745600),
730
- Coords(0.0992057202494530, 0.3523052600879940, 0.3523052600879940),
731
- Coords(0.0992057202494530, 0.1961837595745600, 0.3523052600879940),
732
- Coords(0.0992057202494530, 0.3523052600879940, 0.1961837595745600),
733
- Coords(0.1961837595745600, 0.3523052600879940, 0.3523052600879940),
734
- Coords(0.3523052600879940, 0.1961837595745600, 0.3523052600879940),
735
- Coords(0.3523052600879940, 0.3523052600879940, 0.1961837595745600),
736
- Coords(0.1344783347929940, 0.1344783347929940, 0.1344783347929940),
737
- Coords(0.5965649956210170, 0.1344783347929940, 0.1344783347929940),
738
- Coords(0.1344783347929940, 0.5965649956210170, 0.1344783347929940),
739
- Coords(0.1344783347929940, 0.1344783347929940, 0.5965649956210170),
740
- ]
741
- else:
742
- raise NotImplementedError
743
-
744
- return coords, weights
1
+ from typing import List, Tuple
2
+
3
+ from warp.fem.polynomial import Polynomial, quadrature_1d
4
+ from warp.fem.types import Coords
5
+
6
+
7
+ class Element:
8
+ def measure() -> float:
9
+ """Measure (area, volume, ...) of the reference element"""
10
+ raise NotImplementedError
11
+
12
+ @staticmethod
13
+ def instantiate_quadrature(order: int, family: Polynomial) -> Tuple[List[Coords], List[float]]:
14
+ """Returns a quadrature of a given order for a prototypical element"""
15
+ raise NotImplementedError
16
+
17
+ def center(self) -> Tuple[float]:
18
+ coords, _ = self.instantiate_quadrature(order=0, family=None)
19
+ return coords[0]
20
+
21
+
22
+ def _point_count_from_order(order: int, family: Polynomial):
23
+ if family == Polynomial.GAUSS_LEGENDRE:
24
+ point_count = max(1, order // 2 + 1)
25
+ elif family == Polynomial.LOBATTO_GAUSS_LEGENDRE:
26
+ point_count = max(2, order // 2 + 2)
27
+ elif family == Polynomial.EQUISPACED_CLOSED:
28
+ point_count = max(2, 2 * (order // 2) + 1)
29
+ elif family == Polynomial.EQUISPACED_OPEN:
30
+ point_count = max(1, 2 * (order // 2) + 1)
31
+
32
+ return point_count
33
+
34
+
35
+ class Cube(Element):
36
+ @staticmethod
37
+ def measure() -> float:
38
+ return 1.0
39
+
40
+ @staticmethod
41
+ def instantiate_quadrature(order: int, family: Polynomial):
42
+ if family is None:
43
+ family = Polynomial.GAUSS_LEGENDRE
44
+
45
+ point_count = _point_count_from_order(order=order, family=family)
46
+ gauss_1d, weights_1d = quadrature_1d(point_count=point_count, family=family)
47
+
48
+ coords = [Coords(x, y, z) for x in gauss_1d for y in gauss_1d for z in gauss_1d]
49
+ weights = [wx * wy * wz for wx in weights_1d for wy in weights_1d for wz in weights_1d]
50
+
51
+ return coords, weights
52
+
53
+
54
+ class Square(Element):
55
+ @staticmethod
56
+ def measure() -> float:
57
+ return 1.0
58
+
59
+ @staticmethod
60
+ def instantiate_quadrature(order: int, family: Polynomial):
61
+ if family is None:
62
+ family = Polynomial.GAUSS_LEGENDRE
63
+
64
+ point_count = _point_count_from_order(order=order, family=family)
65
+ gauss_1d, weights_1d = quadrature_1d(point_count=point_count, family=family)
66
+
67
+ coords = [Coords(x, y, 0.0) for x in gauss_1d for y in gauss_1d]
68
+ weights = [wx * wy for wx in weights_1d for wy in weights_1d]
69
+
70
+ return coords, weights
71
+
72
+
73
+ class LinearEdge(Element):
74
+ @staticmethod
75
+ def measure() -> float:
76
+ return 1.0
77
+
78
+ @staticmethod
79
+ def instantiate_quadrature(order: int, family: Polynomial):
80
+ if family is None:
81
+ family = Polynomial.GAUSS_LEGENDRE
82
+
83
+ point_count = _point_count_from_order(order=order, family=family)
84
+ gauss_1d, weights_1d = quadrature_1d(point_count=point_count, family=family)
85
+
86
+ coords = [Coords(x, 0.0, 0.0) for x in gauss_1d]
87
+ return coords, weights_1d
88
+
89
+
90
+ class Triangle(Element):
91
+ @staticmethod
92
+ def measure() -> float:
93
+ return 0.5
94
+
95
+ @staticmethod
96
+ def instantiate_quadrature(order: int, family: Polynomial):
97
+ if family is not None:
98
+ # Duffy transformation from square to triangle
99
+ point_count = _point_count_from_order(order=order + 1, family=family)
100
+ gauss_1d, weights_1d = quadrature_1d(point_count=point_count, family=family)
101
+
102
+ coords = [Coords(1.0 - x - y + x * y, x, y * (1.0 - x)) for x in gauss_1d for y in gauss_1d]
103
+
104
+ # Scale weight by 2.0 so that they sum up to 1
105
+ weights = [2.0 * wx * (1.0 - x) * wy for x, wx in zip(gauss_1d, weights_1d) for wy in weights_1d]
106
+
107
+ return coords, weights
108
+
109
+ if order <= 1:
110
+ weights = [1.0]
111
+ coords = [Coords(1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0)]
112
+ elif order <= 2:
113
+ weights = [1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0]
114
+ coords = [
115
+ Coords(2.0 / 3.0, 1.0 / 6.0, 1.0 / 6.0),
116
+ Coords(1.0 / 6.0, 2.0 / 3.0, 1.0 / 6.0),
117
+ Coords(1.0 / 6.0, 1.0 / 6.0, 2.0 / 3.0),
118
+ ]
119
+ elif order <= 3:
120
+ # Hillion 1977,
121
+ # "Numerical Integration on a Triangle"
122
+ weights = [
123
+ 3.18041381743977225049491153185954e-01,
124
+ 3.18041381743977225049491153185954e-01,
125
+ 1.81958618256022719439357615556219e-01,
126
+ 1.81958618256022719439357615556219e-01,
127
+ ]
128
+
129
+ coords = [
130
+ Coords(
131
+ 6.66390246014701426169324349757517e-01,
132
+ 1.78558728263616461884311092944699e-01,
133
+ 1.55051025721682111946364557297784e-01,
134
+ ),
135
+ Coords(
136
+ 1.78558728263616461884311092944699e-01,
137
+ 6.66390246014701426169324349757517e-01,
138
+ 1.55051025721682056435213326039957e-01,
139
+ ),
140
+ Coords(
141
+ 2.80019915499074012465996474929852e-01,
142
+ 7.50311102226081383381739442484104e-02,
143
+ 6.44948974278317876951405196450651e-01,
144
+ ),
145
+ Coords(
146
+ 7.50311102226081383381739442484104e-02,
147
+ 2.80019915499074012465996474929852e-01,
148
+ 6.44948974278317876951405196450651e-01,
149
+ ),
150
+ ]
151
+ elif order <= 4:
152
+ # Witherden and Vincent 2015,
153
+ # "On the identification of symmetric quadrature rules for finite element methods"
154
+ # https://doi.org/10.1016/j.camwa.2015.03.017
155
+
156
+ weights = [
157
+ 2.23381589678011471811203136894619e-01,
158
+ 2.23381589678011471811203136894619e-01,
159
+ 2.23381589678011471811203136894619e-01,
160
+ 1.09951743655321870773988734981685e-01,
161
+ 1.09951743655321870773988734981685e-01,
162
+ 1.09951743655321870773988734981685e-01,
163
+ ]
164
+
165
+ coords = [
166
+ Coords(
167
+ 4.45948490915964890213274429697776e-01,
168
+ 4.45948490915964890213274429697776e-01,
169
+ 1.08103018168070219573451140604448e-01,
170
+ ),
171
+ Coords(
172
+ 4.45948490915964890213274429697776e-01,
173
+ 1.08103018168070219573451140604448e-01,
174
+ 4.45948490915964890213274429697776e-01,
175
+ ),
176
+ Coords(
177
+ 1.08103018168070219573451140604448e-01,
178
+ 4.45948490915964890213274429697776e-01,
179
+ 4.45948490915964890213274429697776e-01,
180
+ ),
181
+ Coords(
182
+ 9.15762135097707430375635340169538e-02,
183
+ 9.15762135097707430375635340169538e-02,
184
+ 8.16847572980458513924872931966092e-01,
185
+ ),
186
+ Coords(
187
+ 9.15762135097707430375635340169538e-02,
188
+ 8.16847572980458513924872931966092e-01,
189
+ 9.15762135097707430375635340169538e-02,
190
+ ),
191
+ Coords(
192
+ 8.16847572980458513924872931966092e-01,
193
+ 9.15762135097707430375635340169538e-02,
194
+ 9.15762135097707430375635340169538e-02,
195
+ ),
196
+ ]
197
+
198
+ elif order <= 5:
199
+ weights = [
200
+ 2.25000000000000005551115123125783e-01,
201
+ 1.25939180544827139529573400977824e-01,
202
+ 1.25939180544827139529573400977824e-01,
203
+ 1.25939180544827139529573400977824e-01,
204
+ 1.32394152788506191953388224646915e-01,
205
+ 1.32394152788506191953388224646915e-01,
206
+ 1.32394152788506191953388224646915e-01,
207
+ ]
208
+
209
+ coords = [
210
+ Coords(
211
+ 3.33333333333333314829616256247391e-01,
212
+ 3.33333333333333314829616256247391e-01,
213
+ 3.33333333333333314829616256247391e-01,
214
+ ),
215
+ Coords(
216
+ 1.01286507323456342888334802410100e-01,
217
+ 1.01286507323456342888334802410100e-01,
218
+ 7.97426985353087314223330395179801e-01,
219
+ ),
220
+ Coords(
221
+ 1.01286507323456342888334802410100e-01,
222
+ 7.97426985353087314223330395179801e-01,
223
+ 1.01286507323456342888334802410100e-01,
224
+ ),
225
+ Coords(
226
+ 7.97426985353087314223330395179801e-01,
227
+ 1.01286507323456342888334802410100e-01,
228
+ 1.01286507323456342888334802410100e-01,
229
+ ),
230
+ Coords(
231
+ 4.70142064105115109473587153843255e-01,
232
+ 4.70142064105115109473587153843255e-01,
233
+ 5.97158717897697810528256923134904e-02,
234
+ ),
235
+ Coords(
236
+ 4.70142064105115109473587153843255e-01,
237
+ 5.97158717897697810528256923134904e-02,
238
+ 4.70142064105115109473587153843255e-01,
239
+ ),
240
+ Coords(
241
+ 5.97158717897697810528256923134904e-02,
242
+ 4.70142064105115109473587153843255e-01,
243
+ 4.70142064105115109473587153843255e-01,
244
+ ),
245
+ ]
246
+ elif order <= 6:
247
+ weights = [
248
+ 5.08449063702068326797700592578622e-02,
249
+ 5.08449063702068326797700592578622e-02,
250
+ 5.08449063702068326797700592578622e-02,
251
+ 1.16786275726379396022736045779311e-01,
252
+ 1.16786275726379396022736045779311e-01,
253
+ 1.16786275726379396022736045779311e-01,
254
+ 8.28510756183735846969184990484791e-02,
255
+ 8.28510756183735846969184990484791e-02,
256
+ 8.28510756183735846969184990484791e-02,
257
+ 8.28510756183735846969184990484791e-02,
258
+ 8.28510756183735846969184990484791e-02,
259
+ 8.28510756183735846969184990484791e-02,
260
+ ]
261
+
262
+ coords = [
263
+ Coords(
264
+ 6.30890144915022266225435032538371e-02,
265
+ 6.30890144915022266225435032538371e-02,
266
+ 8.73821971016995546754912993492326e-01,
267
+ ),
268
+ Coords(
269
+ 6.30890144915022266225435032538371e-02,
270
+ 8.73821971016995546754912993492326e-01,
271
+ 6.30890144915022266225435032538371e-02,
272
+ ),
273
+ Coords(
274
+ 8.73821971016995546754912993492326e-01,
275
+ 6.30890144915022266225435032538371e-02,
276
+ 6.30890144915022266225435032538371e-02,
277
+ ),
278
+ Coords(
279
+ 2.49286745170910428726074314909056e-01,
280
+ 2.49286745170910428726074314909056e-01,
281
+ 5.01426509658179142547851370181888e-01,
282
+ ),
283
+ Coords(
284
+ 2.49286745170910428726074314909056e-01,
285
+ 5.01426509658179142547851370181888e-01,
286
+ 2.49286745170910428726074314909056e-01,
287
+ ),
288
+ Coords(
289
+ 5.01426509658179142547851370181888e-01,
290
+ 2.49286745170910428726074314909056e-01,
291
+ 2.49286745170910428726074314909056e-01,
292
+ ),
293
+ Coords(
294
+ 5.31450498448169383891581674106419e-02,
295
+ 3.10352451033784393352732422499685e-01,
296
+ 6.36502499121398668258109410089673e-01,
297
+ ),
298
+ Coords(
299
+ 5.31450498448169383891581674106419e-02,
300
+ 6.36502499121398668258109410089673e-01,
301
+ 3.10352451033784393352732422499685e-01,
302
+ ),
303
+ Coords(
304
+ 3.10352451033784393352732422499685e-01,
305
+ 5.31450498448169383891581674106419e-02,
306
+ 6.36502499121398668258109410089673e-01,
307
+ ),
308
+ Coords(
309
+ 3.10352451033784393352732422499685e-01,
310
+ 6.36502499121398668258109410089673e-01,
311
+ 5.31450498448169383891581674106419e-02,
312
+ ),
313
+ Coords(
314
+ 6.36502499121398668258109410089673e-01,
315
+ 5.31450498448169383891581674106419e-02,
316
+ 3.10352451033784393352732422499685e-01,
317
+ ),
318
+ Coords(
319
+ 6.36502499121398668258109410089673e-01,
320
+ 3.10352451033784393352732422499685e-01,
321
+ 5.31450498448169383891581674106419e-02,
322
+ ),
323
+ ]
324
+ else:
325
+ # Order 8
326
+
327
+ weights = [
328
+ 1.44315607677787172136163462710101e-01,
329
+ 9.50916342672846193195823616406415e-02,
330
+ 9.50916342672846193195823616406415e-02,
331
+ 9.50916342672846193195823616406415e-02,
332
+ 1.03217370534718244634575512463925e-01,
333
+ 1.03217370534718244634575512463925e-01,
334
+ 1.03217370534718244634575512463925e-01,
335
+ 3.24584976231980792960030157701112e-02,
336
+ 3.24584976231980792960030157701112e-02,
337
+ 3.24584976231980792960030157701112e-02,
338
+ 2.72303141744349927466650740370824e-02,
339
+ 2.72303141744349927466650740370824e-02,
340
+ 2.72303141744349927466650740370824e-02,
341
+ 2.72303141744349927466650740370824e-02,
342
+ 2.72303141744349927466650740370824e-02,
343
+ 2.72303141744349927466650740370824e-02,
344
+ ]
345
+
346
+ coords = [
347
+ Coords(
348
+ 3.33333333333333314829616256247391e-01,
349
+ 3.33333333333333314829616256247391e-01,
350
+ 3.33333333333333314829616256247391e-01,
351
+ ),
352
+ Coords(
353
+ 4.59292588292723125142913431773195e-01,
354
+ 4.59292588292723125142913431773195e-01,
355
+ 8.14148234145537497141731364536099e-02,
356
+ ),
357
+ Coords(
358
+ 4.59292588292723125142913431773195e-01,
359
+ 8.14148234145537497141731364536099e-02,
360
+ 4.59292588292723125142913431773195e-01,
361
+ ),
362
+ Coords(
363
+ 8.14148234145537497141731364536099e-02,
364
+ 4.59292588292723125142913431773195e-01,
365
+ 4.59292588292723125142913431773195e-01,
366
+ ),
367
+ Coords(
368
+ 1.70569307751760212976677166807349e-01,
369
+ 1.70569307751760212976677166807349e-01,
370
+ 6.58861384496479574046645666385302e-01,
371
+ ),
372
+ Coords(
373
+ 1.70569307751760212976677166807349e-01,
374
+ 6.58861384496479574046645666385302e-01,
375
+ 1.70569307751760212976677166807349e-01,
376
+ ),
377
+ Coords(
378
+ 6.58861384496479574046645666385302e-01,
379
+ 1.70569307751760212976677166807349e-01,
380
+ 1.70569307751760212976677166807349e-01,
381
+ ),
382
+ Coords(
383
+ 5.05472283170309566457945038564503e-02,
384
+ 5.05472283170309566457945038564503e-02,
385
+ 8.98905543365938086708410992287099e-01,
386
+ ),
387
+ Coords(
388
+ 5.05472283170309566457945038564503e-02,
389
+ 8.98905543365938086708410992287099e-01,
390
+ 5.05472283170309566457945038564503e-02,
391
+ ),
392
+ Coords(
393
+ 8.98905543365938086708410992287099e-01,
394
+ 5.05472283170309566457945038564503e-02,
395
+ 5.05472283170309566457945038564503e-02,
396
+ ),
397
+ Coords(
398
+ 8.39477740995758781039626228448469e-03,
399
+ 2.63112829634638112352718053443823e-01,
400
+ 7.28492392955404355348036915529519e-01,
401
+ ),
402
+ Coords(
403
+ 8.39477740995758781039626228448469e-03,
404
+ 7.28492392955404355348036915529519e-01,
405
+ 2.63112829634638112352718053443823e-01,
406
+ ),
407
+ Coords(
408
+ 2.63112829634638112352718053443823e-01,
409
+ 8.39477740995758781039626228448469e-03,
410
+ 7.28492392955404355348036915529519e-01,
411
+ ),
412
+ Coords(
413
+ 2.63112829634638112352718053443823e-01,
414
+ 7.28492392955404355348036915529519e-01,
415
+ 8.39477740995758781039626228448469e-03,
416
+ ),
417
+ Coords(
418
+ 7.28492392955404355348036915529519e-01,
419
+ 8.39477740995758781039626228448469e-03,
420
+ 2.63112829634638112352718053443823e-01,
421
+ ),
422
+ Coords(
423
+ 7.28492392955404355348036915529519e-01,
424
+ 2.63112829634638112352718053443823e-01,
425
+ 8.39477740995758781039626228448469e-03,
426
+ ),
427
+ ]
428
+
429
+ return coords, weights
430
+
431
+
432
+ class Tetrahedron(Element):
433
+ @staticmethod
434
+ def measure() -> float:
435
+ return 1.0 / 6.0
436
+
437
+ @staticmethod
438
+ def instantiate_quadrature(order: int, family: Polynomial):
439
+ if family is not None:
440
+ # Duffy transformation from square to triangle
441
+ point_count = _point_count_from_order(order=order + 1, family=family)
442
+ gauss_1d, weights_1d = quadrature_1d(point_count=point_count, family=family)
443
+
444
+ coords = [
445
+ Coords(x, y * (1.0 - x), z * (1.0 - x) * (1.0 - y))
446
+ for x in gauss_1d
447
+ for y in gauss_1d
448
+ for z in gauss_1d
449
+ ]
450
+
451
+ # Scale weight by 6.0 so that they sum up to 1
452
+ weights = [
453
+ 6.0 * wx * wy * wz * (1.0 - x) * (1.0 - x) * (1.0 - y)
454
+ for x, wx in zip(gauss_1d, weights_1d)
455
+ for y, wy in zip(gauss_1d, weights_1d)
456
+ for wz in weights_1d
457
+ ]
458
+
459
+ return coords, weights
460
+
461
+ # Shunn and Ham 2012
462
+ # "Symmetric quadrature rules for tetrahedra based on a cubic close-packed lattice arrangement"
463
+ # https://doi.org/10.1016/j.cam.2012.03.032
464
+
465
+ # TODO: add Witherden and Vincent 2015,
466
+
467
+ if order <= 1:
468
+ weights = [1.0]
469
+ coords = [Coords(1.0 / 4.0, 1.0 / 4.0, 1.0 / 4.0)]
470
+ elif order <= 2:
471
+ weights = [1.0 / 4.0, 1.0 / 4.0, 1.0 / 4.0, 1.0 / 4.0]
472
+ coords = [
473
+ Coords(0.1381966011250110, 0.1381966011250110, 0.1381966011250110),
474
+ Coords(0.5854101966249680, 0.1381966011250110, 0.1381966011250110),
475
+ Coords(0.1381966011250110, 0.5854101966249680, 0.1381966011250110),
476
+ Coords(0.1381966011250110, 0.1381966011250110, 0.5854101966249680),
477
+ ]
478
+ elif order <= 3:
479
+ weights = [
480
+ 0.0476331348432089,
481
+ 0.0476331348432089,
482
+ 0.0476331348432089,
483
+ 0.0476331348432089,
484
+ 0.1349112434378610,
485
+ 0.1349112434378610,
486
+ 0.1349112434378610,
487
+ 0.1349112434378610,
488
+ 0.1349112434378610,
489
+ 0.1349112434378610,
490
+ ]
491
+
492
+ coords = [
493
+ Coords(0.0738349017262234, 0.0738349017262234, 0.0738349017262234),
494
+ Coords(0.7784952948213300, 0.0738349017262234, 0.0738349017262234),
495
+ Coords(0.0738349017262234, 0.7784952948213300, 0.0738349017262234),
496
+ Coords(0.0738349017262234, 0.0738349017262234, 0.7784952948213300),
497
+ Coords(0.4062443438840510, 0.0937556561159491, 0.0937556561159491),
498
+ Coords(0.0937556561159491, 0.4062443438840510, 0.0937556561159491),
499
+ Coords(0.0937556561159491, 0.0937556561159491, 0.4062443438840510),
500
+ Coords(0.4062443438840510, 0.4062443438840510, 0.0937556561159491),
501
+ Coords(0.4062443438840510, 0.0937556561159491, 0.4062443438840510),
502
+ Coords(0.0937556561159491, 0.4062443438840510, 0.4062443438840510),
503
+ ]
504
+ elif order <= 4:
505
+ weights = [
506
+ 0.0070670747944695,
507
+ 0.0070670747944695,
508
+ 0.0070670747944695,
509
+ 0.0070670747944695,
510
+ 0.0469986689718877,
511
+ 0.0469986689718877,
512
+ 0.0469986689718877,
513
+ 0.0469986689718877,
514
+ 0.0469986689718877,
515
+ 0.0469986689718877,
516
+ 0.0469986689718877,
517
+ 0.0469986689718877,
518
+ 0.0469986689718877,
519
+ 0.0469986689718877,
520
+ 0.0469986689718877,
521
+ 0.0469986689718877,
522
+ 0.1019369182898680,
523
+ 0.1019369182898680,
524
+ 0.1019369182898680,
525
+ 0.1019369182898680,
526
+ ]
527
+
528
+ coords = [
529
+ Coords(0.0323525947272439, 0.0323525947272439, 0.0323525947272439),
530
+ Coords(0.9029422158182680, 0.0323525947272439, 0.0323525947272439),
531
+ Coords(0.0323525947272439, 0.9029422158182680, 0.0323525947272439),
532
+ Coords(0.0323525947272439, 0.0323525947272439, 0.9029422158182680),
533
+ Coords(0.6165965330619370, 0.0603604415251421, 0.0603604415251421),
534
+ Coords(0.2626825838877790, 0.0603604415251421, 0.0603604415251421),
535
+ Coords(0.0603604415251421, 0.6165965330619370, 0.0603604415251421),
536
+ Coords(0.0603604415251421, 0.2626825838877790, 0.0603604415251421),
537
+ Coords(0.0603604415251421, 0.0603604415251421, 0.6165965330619370),
538
+ Coords(0.0603604415251421, 0.0603604415251421, 0.2626825838877790),
539
+ Coords(0.2626825838877790, 0.6165965330619370, 0.0603604415251421),
540
+ Coords(0.6165965330619370, 0.2626825838877790, 0.0603604415251421),
541
+ Coords(0.2626825838877790, 0.0603604415251421, 0.6165965330619370),
542
+ Coords(0.6165965330619370, 0.0603604415251421, 0.2626825838877790),
543
+ Coords(0.0603604415251421, 0.2626825838877790, 0.6165965330619370),
544
+ Coords(0.0603604415251421, 0.6165965330619370, 0.2626825838877790),
545
+ Coords(0.3097693042728620, 0.3097693042728620, 0.0706920871814129),
546
+ Coords(0.3097693042728620, 0.0706920871814129, 0.3097693042728620),
547
+ Coords(0.0706920871814129, 0.3097693042728620, 0.3097693042728620),
548
+ Coords(0.3097693042728620, 0.3097693042728620, 0.3097693042728620),
549
+ ]
550
+
551
+ elif order <= 5:
552
+ weights = [
553
+ 0.0021900463965388,
554
+ 0.0021900463965388,
555
+ 0.0021900463965388,
556
+ 0.0021900463965388,
557
+ 0.0143395670177665,
558
+ 0.0143395670177665,
559
+ 0.0143395670177665,
560
+ 0.0143395670177665,
561
+ 0.0143395670177665,
562
+ 0.0143395670177665,
563
+ 0.0143395670177665,
564
+ 0.0143395670177665,
565
+ 0.0143395670177665,
566
+ 0.0143395670177665,
567
+ 0.0143395670177665,
568
+ 0.0143395670177665,
569
+ 0.0250305395686746,
570
+ 0.0250305395686746,
571
+ 0.0250305395686746,
572
+ 0.0250305395686746,
573
+ 0.0250305395686746,
574
+ 0.0250305395686746,
575
+ 0.0479839333057554,
576
+ 0.0479839333057554,
577
+ 0.0479839333057554,
578
+ 0.0479839333057554,
579
+ 0.0479839333057554,
580
+ 0.0479839333057554,
581
+ 0.0479839333057554,
582
+ 0.0479839333057554,
583
+ 0.0479839333057554,
584
+ 0.0479839333057554,
585
+ 0.0479839333057554,
586
+ 0.0479839333057554,
587
+ 0.0931745731195340,
588
+ ]
589
+
590
+ coords = [
591
+ Coords(0.0267367755543735, 0.0267367755543735, 0.0267367755543735),
592
+ Coords(0.9197896733368800, 0.0267367755543735, 0.0267367755543735),
593
+ Coords(0.0267367755543735, 0.9197896733368800, 0.0267367755543735),
594
+ Coords(0.0267367755543735, 0.0267367755543735, 0.9197896733368800),
595
+ Coords(0.7477598884818090, 0.0391022406356488, 0.0391022406356488),
596
+ Coords(0.1740356302468940, 0.0391022406356488, 0.0391022406356488),
597
+ Coords(0.0391022406356488, 0.7477598884818090, 0.0391022406356488),
598
+ Coords(0.0391022406356488, 0.1740356302468940, 0.0391022406356488),
599
+ Coords(0.0391022406356488, 0.0391022406356488, 0.7477598884818090),
600
+ Coords(0.0391022406356488, 0.0391022406356488, 0.1740356302468940),
601
+ Coords(0.1740356302468940, 0.7477598884818090, 0.0391022406356488),
602
+ Coords(0.7477598884818090, 0.1740356302468940, 0.0391022406356488),
603
+ Coords(0.1740356302468940, 0.0391022406356488, 0.7477598884818090),
604
+ Coords(0.7477598884818090, 0.0391022406356488, 0.1740356302468940),
605
+ Coords(0.0391022406356488, 0.1740356302468940, 0.7477598884818090),
606
+ Coords(0.0391022406356488, 0.7477598884818090, 0.1740356302468940),
607
+ Coords(0.4547545999844830, 0.0452454000155172, 0.0452454000155172),
608
+ Coords(0.0452454000155172, 0.4547545999844830, 0.0452454000155172),
609
+ Coords(0.0452454000155172, 0.0452454000155172, 0.4547545999844830),
610
+ Coords(0.4547545999844830, 0.4547545999844830, 0.0452454000155172),
611
+ Coords(0.4547545999844830, 0.0452454000155172, 0.4547545999844830),
612
+ Coords(0.0452454000155172, 0.4547545999844830, 0.4547545999844830),
613
+ Coords(0.2232010379623150, 0.2232010379623150, 0.0504792790607720),
614
+ Coords(0.5031186450145980, 0.2232010379623150, 0.0504792790607720),
615
+ Coords(0.2232010379623150, 0.5031186450145980, 0.0504792790607720),
616
+ Coords(0.2232010379623150, 0.0504792790607720, 0.2232010379623150),
617
+ Coords(0.5031186450145980, 0.0504792790607720, 0.2232010379623150),
618
+ Coords(0.2232010379623150, 0.0504792790607720, 0.5031186450145980),
619
+ Coords(0.0504792790607720, 0.2232010379623150, 0.2232010379623150),
620
+ Coords(0.0504792790607720, 0.5031186450145980, 0.2232010379623150),
621
+ Coords(0.0504792790607720, 0.2232010379623150, 0.5031186450145980),
622
+ Coords(0.5031186450145980, 0.2232010379623150, 0.2232010379623150),
623
+ Coords(0.2232010379623150, 0.5031186450145980, 0.2232010379623150),
624
+ Coords(0.2232010379623150, 0.2232010379623150, 0.5031186450145980),
625
+ Coords(0.2500000000000000, 0.2500000000000000, 0.2500000000000000),
626
+ ]
627
+ elif order <= 6:
628
+ weights = [
629
+ 0.0010373112336140,
630
+ 0.0010373112336140,
631
+ 0.0010373112336140,
632
+ 0.0010373112336140,
633
+ 0.0096016645399480,
634
+ 0.0096016645399480,
635
+ 0.0096016645399480,
636
+ 0.0096016645399480,
637
+ 0.0096016645399480,
638
+ 0.0096016645399480,
639
+ 0.0096016645399480,
640
+ 0.0096016645399480,
641
+ 0.0096016645399480,
642
+ 0.0096016645399480,
643
+ 0.0096016645399480,
644
+ 0.0096016645399480,
645
+ 0.0164493976798232,
646
+ 0.0164493976798232,
647
+ 0.0164493976798232,
648
+ 0.0164493976798232,
649
+ 0.0164493976798232,
650
+ 0.0164493976798232,
651
+ 0.0164493976798232,
652
+ 0.0164493976798232,
653
+ 0.0164493976798232,
654
+ 0.0164493976798232,
655
+ 0.0164493976798232,
656
+ 0.0164493976798232,
657
+ 0.0153747766513310,
658
+ 0.0153747766513310,
659
+ 0.0153747766513310,
660
+ 0.0153747766513310,
661
+ 0.0153747766513310,
662
+ 0.0153747766513310,
663
+ 0.0153747766513310,
664
+ 0.0153747766513310,
665
+ 0.0153747766513310,
666
+ 0.0153747766513310,
667
+ 0.0153747766513310,
668
+ 0.0153747766513310,
669
+ 0.0293520118375230,
670
+ 0.0293520118375230,
671
+ 0.0293520118375230,
672
+ 0.0293520118375230,
673
+ 0.0293520118375230,
674
+ 0.0293520118375230,
675
+ 0.0293520118375230,
676
+ 0.0293520118375230,
677
+ 0.0293520118375230,
678
+ 0.0293520118375230,
679
+ 0.0293520118375230,
680
+ 0.0293520118375230,
681
+ 0.0366291366405108,
682
+ 0.0366291366405108,
683
+ 0.0366291366405108,
684
+ 0.0366291366405108,
685
+ ]
686
+
687
+ coords = [
688
+ Coords(0.0149520651530592, 0.0149520651530592, 0.0149520651530592),
689
+ Coords(0.9551438045408220, 0.0149520651530592, 0.0149520651530592),
690
+ Coords(0.0149520651530592, 0.9551438045408220, 0.0149520651530592),
691
+ Coords(0.0149520651530592, 0.0149520651530592, 0.9551438045408220),
692
+ Coords(0.1518319491659370, 0.0340960211962615, 0.0340960211962615),
693
+ Coords(0.7799760084415400, 0.0340960211962615, 0.0340960211962615),
694
+ Coords(0.0340960211962615, 0.1518319491659370, 0.0340960211962615),
695
+ Coords(0.0340960211962615, 0.7799760084415400, 0.0340960211962615),
696
+ Coords(0.0340960211962615, 0.0340960211962615, 0.1518319491659370),
697
+ Coords(0.0340960211962615, 0.0340960211962615, 0.7799760084415400),
698
+ Coords(0.7799760084415400, 0.1518319491659370, 0.0340960211962615),
699
+ Coords(0.1518319491659370, 0.7799760084415400, 0.0340960211962615),
700
+ Coords(0.7799760084415400, 0.0340960211962615, 0.1518319491659370),
701
+ Coords(0.1518319491659370, 0.0340960211962615, 0.7799760084415400),
702
+ Coords(0.0340960211962615, 0.7799760084415400, 0.1518319491659370),
703
+ Coords(0.0340960211962615, 0.1518319491659370, 0.7799760084415400),
704
+ Coords(0.5526556431060170, 0.0462051504150017, 0.0462051504150017),
705
+ Coords(0.3549340560639790, 0.0462051504150017, 0.0462051504150017),
706
+ Coords(0.0462051504150017, 0.5526556431060170, 0.0462051504150017),
707
+ Coords(0.0462051504150017, 0.3549340560639790, 0.0462051504150017),
708
+ Coords(0.0462051504150017, 0.0462051504150017, 0.5526556431060170),
709
+ Coords(0.0462051504150017, 0.0462051504150017, 0.3549340560639790),
710
+ Coords(0.3549340560639790, 0.5526556431060170, 0.0462051504150017),
711
+ Coords(0.5526556431060170, 0.3549340560639790, 0.0462051504150017),
712
+ Coords(0.3549340560639790, 0.0462051504150017, 0.5526556431060170),
713
+ Coords(0.5526556431060170, 0.0462051504150017, 0.3549340560639790),
714
+ Coords(0.0462051504150017, 0.3549340560639790, 0.5526556431060170),
715
+ Coords(0.0462051504150017, 0.5526556431060170, 0.3549340560639790),
716
+ Coords(0.2281904610687610, 0.2281904610687610, 0.0055147549744775),
717
+ Coords(0.5381043228880020, 0.2281904610687610, 0.0055147549744775),
718
+ Coords(0.2281904610687610, 0.5381043228880020, 0.0055147549744775),
719
+ Coords(0.2281904610687610, 0.0055147549744775, 0.2281904610687610),
720
+ Coords(0.5381043228880020, 0.0055147549744775, 0.2281904610687610),
721
+ Coords(0.2281904610687610, 0.0055147549744775, 0.5381043228880020),
722
+ Coords(0.0055147549744775, 0.2281904610687610, 0.2281904610687610),
723
+ Coords(0.0055147549744775, 0.5381043228880020, 0.2281904610687610),
724
+ Coords(0.0055147549744775, 0.2281904610687610, 0.5381043228880020),
725
+ Coords(0.5381043228880020, 0.2281904610687610, 0.2281904610687610),
726
+ Coords(0.2281904610687610, 0.5381043228880020, 0.2281904610687610),
727
+ Coords(0.2281904610687610, 0.2281904610687610, 0.5381043228880020),
728
+ Coords(0.3523052600879940, 0.3523052600879940, 0.0992057202494530),
729
+ Coords(0.1961837595745600, 0.3523052600879940, 0.0992057202494530),
730
+ Coords(0.3523052600879940, 0.1961837595745600, 0.0992057202494530),
731
+ Coords(0.3523052600879940, 0.0992057202494530, 0.3523052600879940),
732
+ Coords(0.1961837595745600, 0.0992057202494530, 0.3523052600879940),
733
+ Coords(0.3523052600879940, 0.0992057202494530, 0.1961837595745600),
734
+ Coords(0.0992057202494530, 0.3523052600879940, 0.3523052600879940),
735
+ Coords(0.0992057202494530, 0.1961837595745600, 0.3523052600879940),
736
+ Coords(0.0992057202494530, 0.3523052600879940, 0.1961837595745600),
737
+ Coords(0.1961837595745600, 0.3523052600879940, 0.3523052600879940),
738
+ Coords(0.3523052600879940, 0.1961837595745600, 0.3523052600879940),
739
+ Coords(0.3523052600879940, 0.3523052600879940, 0.1961837595745600),
740
+ Coords(0.1344783347929940, 0.1344783347929940, 0.1344783347929940),
741
+ Coords(0.5965649956210170, 0.1344783347929940, 0.1344783347929940),
742
+ Coords(0.1344783347929940, 0.5965649956210170, 0.1344783347929940),
743
+ Coords(0.1344783347929940, 0.1344783347929940, 0.5965649956210170),
744
+ ]
745
+ else:
746
+ raise NotImplementedError
747
+
748
+ return coords, weights