warp-lang 1.0.1__py3-none-macosx_10_13_universal2.whl → 1.1.0__py3-none-macosx_10_13_universal2.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 (346) hide show
  1. warp/__init__.py +108 -97
  2. warp/__init__.pyi +1 -1
  3. warp/bin/libwarp-clang.dylib +0 -0
  4. warp/bin/libwarp.dylib +0 -0
  5. warp/build.py +115 -113
  6. warp/build_dll.py +383 -375
  7. warp/builtins.py +3425 -3354
  8. warp/codegen.py +2878 -2792
  9. warp/config.py +40 -36
  10. warp/constants.py +45 -45
  11. warp/context.py +5194 -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 +383 -383
  26. warp/examples/benchmarks/benchmark_cloth.py +278 -279
  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 +146 -146
  34. warp/examples/benchmarks/benchmark_launches.py +295 -295
  35. warp/examples/browse.py +29 -28
  36. warp/examples/core/example_dem.py +234 -221
  37. warp/examples/core/example_fluid.py +293 -267
  38. warp/examples/core/example_graph_capture.py +144 -129
  39. warp/examples/core/example_marching_cubes.py +188 -176
  40. warp/examples/core/example_mesh.py +174 -154
  41. warp/examples/core/example_mesh_intersect.py +205 -193
  42. warp/examples/core/example_nvdb.py +176 -169
  43. warp/examples/core/example_raycast.py +105 -89
  44. warp/examples/core/example_raymarch.py +199 -178
  45. warp/examples/core/example_render_opengl.py +185 -141
  46. warp/examples/core/example_sph.py +405 -389
  47. warp/examples/core/example_torch.py +222 -181
  48. warp/examples/core/example_wave.py +263 -249
  49. warp/examples/fem/bsr_utils.py +378 -380
  50. warp/examples/fem/example_apic_fluid.py +407 -391
  51. warp/examples/fem/example_convection_diffusion.py +182 -168
  52. warp/examples/fem/example_convection_diffusion_dg.py +219 -209
  53. warp/examples/fem/example_convection_diffusion_dg0.py +204 -194
  54. warp/examples/fem/example_deformed_geometry.py +177 -159
  55. warp/examples/fem/example_diffusion.py +201 -173
  56. warp/examples/fem/example_diffusion_3d.py +177 -152
  57. warp/examples/fem/example_diffusion_mgpu.py +221 -214
  58. warp/examples/fem/example_mixed_elasticity.py +244 -222
  59. warp/examples/fem/example_navier_stokes.py +259 -243
  60. warp/examples/fem/example_stokes.py +220 -192
  61. warp/examples/fem/example_stokes_transfer.py +265 -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 +260 -248
  65. warp/examples/optim/example_cloth_throw.py +222 -210
  66. warp/examples/optim/example_diffray.py +566 -535
  67. warp/examples/optim/example_drone.py +864 -835
  68. warp/examples/optim/example_inverse_kinematics.py +176 -169
  69. warp/examples/optim/example_inverse_kinematics_torch.py +185 -170
  70. warp/examples/optim/example_spring_cage.py +239 -234
  71. warp/examples/optim/example_trajectory.py +223 -201
  72. warp/examples/optim/example_walker.py +306 -292
  73. warp/examples/sim/example_cartpole.py +139 -128
  74. warp/examples/sim/example_cloth.py +196 -184
  75. warp/examples/sim/example_granular.py +124 -113
  76. warp/examples/sim/example_granular_collision_sdf.py +197 -185
  77. warp/examples/sim/example_jacobian_ik.py +236 -213
  78. warp/examples/sim/example_particle_chain.py +118 -106
  79. warp/examples/sim/example_quadruped.py +193 -179
  80. warp/examples/sim/example_rigid_chain.py +197 -189
  81. warp/examples/sim/example_rigid_contact.py +189 -176
  82. warp/examples/sim/example_rigid_force.py +127 -126
  83. warp/examples/sim/example_rigid_gyroscopic.py +109 -97
  84. warp/examples/sim/example_rigid_soft_contact.py +134 -124
  85. warp/examples/sim/example_soft_body.py +190 -178
  86. warp/fabric.py +337 -335
  87. warp/fem/__init__.py +60 -27
  88. warp/fem/cache.py +401 -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 +15 -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 +744 -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 +441 -435
  104. warp/fem/geometry/hexmesh.py +953 -953
  105. warp/fem/geometry/partition.py +374 -376
  106. warp/fem/geometry/quadmesh_2d.py +532 -532
  107. warp/fem/geometry/tetmesh.py +840 -840
  108. warp/fem/geometry/trimesh_2d.py +577 -577
  109. warp/fem/integrate.py +1630 -1615
  110. warp/fem/operator.py +190 -191
  111. warp/fem/polynomial.py +214 -213
  112. warp/fem/quadrature/__init__.py +2 -2
  113. warp/fem/quadrature/pic_quadrature.py +243 -245
  114. warp/fem/quadrature/quadrature.py +295 -294
  115. warp/fem/space/__init__.py +294 -292
  116. warp/fem/space/basis_space.py +488 -489
  117. warp/fem/space/collocated_function_space.py +100 -105
  118. warp/fem/space/dof_mapper.py +236 -236
  119. warp/fem/space/function_space.py +148 -145
  120. warp/fem/space/grid_2d_function_space.py +267 -267
  121. warp/fem/space/grid_3d_function_space.py +305 -306
  122. warp/fem/space/hexmesh_function_space.py +350 -352
  123. warp/fem/space/partition.py +350 -350
  124. warp/fem/space/quadmesh_2d_function_space.py +368 -369
  125. warp/fem/space/restriction.py +158 -160
  126. warp/fem/space/shape/__init__.py +13 -15
  127. warp/fem/space/shape/cube_shape_function.py +738 -738
  128. warp/fem/space/shape/shape_function.py +102 -103
  129. warp/fem/space/shape/square_shape_function.py +611 -611
  130. warp/fem/space/shape/tet_shape_function.py +565 -567
  131. warp/fem/space/shape/triangle_shape_function.py +429 -429
  132. warp/fem/space/tetmesh_function_space.py +294 -292
  133. warp/fem/space/topology.py +297 -295
  134. warp/fem/space/trimesh_2d_function_space.py +223 -221
  135. warp/fem/types.py +77 -77
  136. warp/fem/utils.py +495 -495
  137. warp/jax.py +166 -141
  138. warp/jax_experimental.py +341 -339
  139. warp/native/array.h +1072 -1025
  140. warp/native/builtin.h +1560 -1560
  141. warp/native/bvh.cpp +398 -398
  142. warp/native/bvh.cu +525 -525
  143. warp/native/bvh.h +429 -429
  144. warp/native/clang/clang.cpp +495 -464
  145. warp/native/crt.cpp +31 -31
  146. warp/native/crt.h +334 -334
  147. warp/native/cuda_crt.h +1049 -1049
  148. warp/native/cuda_util.cpp +549 -540
  149. warp/native/cuda_util.h +288 -203
  150. warp/native/cutlass_gemm.cpp +34 -34
  151. warp/native/cutlass_gemm.cu +372 -372
  152. warp/native/error.cpp +66 -66
  153. warp/native/error.h +27 -27
  154. warp/native/fabric.h +228 -228
  155. warp/native/hashgrid.cpp +301 -278
  156. warp/native/hashgrid.cu +78 -77
  157. warp/native/hashgrid.h +227 -227
  158. warp/native/initializer_array.h +32 -32
  159. warp/native/intersect.h +1204 -1204
  160. warp/native/intersect_adj.h +365 -365
  161. warp/native/intersect_tri.h +322 -322
  162. warp/native/marching.cpp +2 -2
  163. warp/native/marching.cu +497 -497
  164. warp/native/marching.h +2 -2
  165. warp/native/mat.h +1498 -1498
  166. warp/native/matnn.h +333 -333
  167. warp/native/mesh.cpp +203 -203
  168. warp/native/mesh.cu +293 -293
  169. warp/native/mesh.h +1887 -1887
  170. warp/native/nanovdb/NanoVDB.h +4782 -4782
  171. warp/native/nanovdb/PNanoVDB.h +2553 -2553
  172. warp/native/nanovdb/PNanoVDBWrite.h +294 -294
  173. warp/native/noise.h +850 -850
  174. warp/native/quat.h +1084 -1084
  175. warp/native/rand.h +299 -299
  176. warp/native/range.h +108 -108
  177. warp/native/reduce.cpp +156 -156
  178. warp/native/reduce.cu +348 -348
  179. warp/native/runlength_encode.cpp +61 -61
  180. warp/native/runlength_encode.cu +46 -46
  181. warp/native/scan.cpp +30 -30
  182. warp/native/scan.cu +36 -36
  183. warp/native/scan.h +7 -7
  184. warp/native/solid_angle.h +442 -442
  185. warp/native/sort.cpp +94 -94
  186. warp/native/sort.cu +97 -97
  187. warp/native/sort.h +14 -14
  188. warp/native/sparse.cpp +337 -337
  189. warp/native/sparse.cu +544 -544
  190. warp/native/spatial.h +630 -630
  191. warp/native/svd.h +562 -562
  192. warp/native/temp_buffer.h +30 -30
  193. warp/native/vec.h +1132 -1132
  194. warp/native/volume.cpp +297 -297
  195. warp/native/volume.cu +32 -32
  196. warp/native/volume.h +538 -538
  197. warp/native/volume_builder.cu +425 -425
  198. warp/native/volume_builder.h +19 -19
  199. warp/native/warp.cpp +1057 -1052
  200. warp/native/warp.cu +2943 -2828
  201. warp/native/warp.h +313 -305
  202. warp/optim/__init__.py +9 -9
  203. warp/optim/adam.py +120 -120
  204. warp/optim/linear.py +1104 -939
  205. warp/optim/sgd.py +104 -92
  206. warp/render/__init__.py +10 -10
  207. warp/render/render_opengl.py +3217 -3204
  208. warp/render/render_usd.py +768 -749
  209. warp/render/utils.py +152 -150
  210. warp/sim/__init__.py +52 -59
  211. warp/sim/articulation.py +685 -685
  212. warp/sim/collide.py +1594 -1590
  213. warp/sim/import_mjcf.py +489 -481
  214. warp/sim/import_snu.py +220 -221
  215. warp/sim/import_urdf.py +536 -516
  216. warp/sim/import_usd.py +887 -881
  217. warp/sim/inertia.py +316 -317
  218. warp/sim/integrator.py +234 -233
  219. warp/sim/integrator_euler.py +1956 -1956
  220. warp/sim/integrator_featherstone.py +1910 -1991
  221. warp/sim/integrator_xpbd.py +3294 -3312
  222. warp/sim/model.py +4473 -4314
  223. warp/sim/particles.py +113 -112
  224. warp/sim/render.py +417 -403
  225. warp/sim/utils.py +413 -410
  226. warp/sparse.py +1227 -1227
  227. warp/stubs.py +2109 -2469
  228. warp/tape.py +1162 -225
  229. warp/tests/__init__.py +1 -1
  230. warp/tests/__main__.py +4 -4
  231. warp/tests/assets/torus.usda +105 -105
  232. warp/tests/aux_test_class_kernel.py +26 -26
  233. warp/tests/aux_test_compile_consts_dummy.py +10 -10
  234. warp/tests/aux_test_conditional_unequal_types_kernels.py +21 -21
  235. warp/tests/aux_test_dependent.py +22 -22
  236. warp/tests/aux_test_grad_customs.py +23 -23
  237. warp/tests/aux_test_reference.py +11 -11
  238. warp/tests/aux_test_reference_reference.py +10 -10
  239. warp/tests/aux_test_square.py +17 -17
  240. warp/tests/aux_test_unresolved_func.py +14 -14
  241. warp/tests/aux_test_unresolved_symbol.py +14 -14
  242. warp/tests/disabled_kinematics.py +239 -239
  243. warp/tests/run_coverage_serial.py +31 -31
  244. warp/tests/test_adam.py +157 -157
  245. warp/tests/test_arithmetic.py +1124 -1124
  246. warp/tests/test_array.py +2417 -2326
  247. warp/tests/test_array_reduce.py +150 -150
  248. warp/tests/test_async.py +668 -656
  249. warp/tests/test_atomic.py +141 -141
  250. warp/tests/test_bool.py +204 -149
  251. warp/tests/test_builtins_resolution.py +1292 -1292
  252. warp/tests/test_bvh.py +164 -171
  253. warp/tests/test_closest_point_edge_edge.py +228 -228
  254. warp/tests/test_codegen.py +566 -553
  255. warp/tests/test_compile_consts.py +97 -101
  256. warp/tests/test_conditional.py +246 -246
  257. warp/tests/test_copy.py +232 -215
  258. warp/tests/test_ctypes.py +632 -632
  259. warp/tests/test_dense.py +67 -67
  260. warp/tests/test_devices.py +91 -98
  261. warp/tests/test_dlpack.py +530 -529
  262. warp/tests/test_examples.py +400 -378
  263. warp/tests/test_fabricarray.py +955 -955
  264. warp/tests/test_fast_math.py +62 -54
  265. warp/tests/test_fem.py +1277 -1278
  266. warp/tests/test_fp16.py +130 -130
  267. warp/tests/test_func.py +338 -337
  268. warp/tests/test_generics.py +571 -571
  269. warp/tests/test_grad.py +746 -640
  270. warp/tests/test_grad_customs.py +333 -336
  271. warp/tests/test_hash_grid.py +210 -164
  272. warp/tests/test_import.py +39 -39
  273. warp/tests/test_indexedarray.py +1134 -1134
  274. warp/tests/test_intersect.py +67 -67
  275. warp/tests/test_jax.py +307 -307
  276. warp/tests/test_large.py +167 -164
  277. warp/tests/test_launch.py +354 -354
  278. warp/tests/test_lerp.py +261 -261
  279. warp/tests/test_linear_solvers.py +191 -171
  280. warp/tests/test_lvalue.py +421 -493
  281. warp/tests/test_marching_cubes.py +65 -65
  282. warp/tests/test_mat.py +1801 -1827
  283. warp/tests/test_mat_lite.py +115 -115
  284. warp/tests/test_mat_scalar_ops.py +2907 -2889
  285. warp/tests/test_math.py +126 -193
  286. warp/tests/test_matmul.py +500 -499
  287. warp/tests/test_matmul_lite.py +410 -410
  288. warp/tests/test_mempool.py +188 -190
  289. warp/tests/test_mesh.py +284 -324
  290. warp/tests/test_mesh_query_aabb.py +228 -241
  291. warp/tests/test_mesh_query_point.py +692 -702
  292. warp/tests/test_mesh_query_ray.py +292 -303
  293. warp/tests/test_mlp.py +276 -276
  294. warp/tests/test_model.py +110 -110
  295. warp/tests/test_modules_lite.py +39 -39
  296. warp/tests/test_multigpu.py +163 -163
  297. warp/tests/test_noise.py +248 -248
  298. warp/tests/test_operators.py +250 -250
  299. warp/tests/test_options.py +123 -125
  300. warp/tests/test_peer.py +133 -137
  301. warp/tests/test_pinned.py +78 -78
  302. warp/tests/test_print.py +54 -54
  303. warp/tests/test_quat.py +2086 -2086
  304. warp/tests/test_rand.py +288 -288
  305. warp/tests/test_reload.py +217 -217
  306. warp/tests/test_rounding.py +179 -179
  307. warp/tests/test_runlength_encode.py +190 -190
  308. warp/tests/test_sim_grad.py +243 -0
  309. warp/tests/test_sim_kinematics.py +91 -97
  310. warp/tests/test_smoothstep.py +168 -168
  311. warp/tests/test_snippet.py +305 -266
  312. warp/tests/test_sparse.py +468 -460
  313. warp/tests/test_spatial.py +2148 -2148
  314. warp/tests/test_streams.py +486 -473
  315. warp/tests/test_struct.py +710 -675
  316. warp/tests/test_tape.py +173 -148
  317. warp/tests/test_torch.py +743 -743
  318. warp/tests/test_transient_module.py +87 -87
  319. warp/tests/test_types.py +556 -659
  320. warp/tests/test_utils.py +490 -499
  321. warp/tests/test_vec.py +1264 -1268
  322. warp/tests/test_vec_lite.py +73 -73
  323. warp/tests/test_vec_scalar_ops.py +2099 -2099
  324. warp/tests/test_verify_fp.py +94 -94
  325. warp/tests/test_volume.py +737 -736
  326. warp/tests/test_volume_write.py +255 -265
  327. warp/tests/unittest_serial.py +37 -37
  328. warp/tests/unittest_suites.py +363 -359
  329. warp/tests/unittest_utils.py +603 -578
  330. warp/tests/unused_test_misc.py +71 -71
  331. warp/tests/walkthrough_debug.py +85 -85
  332. warp/thirdparty/appdirs.py +598 -598
  333. warp/thirdparty/dlpack.py +143 -143
  334. warp/thirdparty/unittest_parallel.py +566 -561
  335. warp/torch.py +321 -295
  336. warp/types.py +4504 -4450
  337. warp/utils.py +1008 -821
  338. {warp_lang-1.0.1.dist-info → warp_lang-1.1.0.dist-info}/LICENSE.md +126 -126
  339. {warp_lang-1.0.1.dist-info → warp_lang-1.1.0.dist-info}/METADATA +338 -400
  340. warp_lang-1.1.0.dist-info/RECORD +352 -0
  341. warp/examples/assets/cube.usda +0 -42
  342. warp/examples/assets/sphere.usda +0 -56
  343. warp/examples/assets/torus.usda +0 -105
  344. warp_lang-1.0.1.dist-info/RECORD +0 -352
  345. {warp_lang-1.0.1.dist-info → warp_lang-1.1.0.dist-info}/WHEEL +0 -0
  346. {warp_lang-1.0.1.dist-info → warp_lang-1.1.0.dist-info}/top_level.txt +0 -0
@@ -1,744 +1,744 @@
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
+
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