warp-lang 1.7.0__py3-none-manylinux_2_34_aarch64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of warp-lang might be problematic. Click here for more details.
- warp/__init__.py +139 -0
- warp/__init__.pyi +1 -0
- warp/autograd.py +1142 -0
- warp/bin/warp-clang.so +0 -0
- warp/bin/warp.so +0 -0
- warp/build.py +557 -0
- warp/build_dll.py +405 -0
- warp/builtins.py +6855 -0
- warp/codegen.py +3969 -0
- warp/config.py +158 -0
- warp/constants.py +57 -0
- warp/context.py +6812 -0
- warp/dlpack.py +462 -0
- warp/examples/__init__.py +24 -0
- warp/examples/assets/bear.usd +0 -0
- warp/examples/assets/bunny.usd +0 -0
- warp/examples/assets/cartpole.urdf +110 -0
- warp/examples/assets/crazyflie.usd +0 -0
- warp/examples/assets/cube.usd +0 -0
- warp/examples/assets/nonuniform.usd +0 -0
- warp/examples/assets/nv_ant.xml +92 -0
- warp/examples/assets/nv_humanoid.xml +183 -0
- warp/examples/assets/nvidia_logo.png +0 -0
- warp/examples/assets/pixel.jpg +0 -0
- warp/examples/assets/quadruped.urdf +268 -0
- warp/examples/assets/rocks.nvdb +0 -0
- warp/examples/assets/rocks.usd +0 -0
- warp/examples/assets/sphere.usd +0 -0
- warp/examples/assets/square_cloth.usd +0 -0
- warp/examples/benchmarks/benchmark_api.py +389 -0
- warp/examples/benchmarks/benchmark_cloth.py +296 -0
- warp/examples/benchmarks/benchmark_cloth_cupy.py +96 -0
- warp/examples/benchmarks/benchmark_cloth_jax.py +105 -0
- warp/examples/benchmarks/benchmark_cloth_numba.py +161 -0
- warp/examples/benchmarks/benchmark_cloth_numpy.py +85 -0
- warp/examples/benchmarks/benchmark_cloth_paddle.py +94 -0
- warp/examples/benchmarks/benchmark_cloth_pytorch.py +94 -0
- warp/examples/benchmarks/benchmark_cloth_taichi.py +120 -0
- warp/examples/benchmarks/benchmark_cloth_warp.py +153 -0
- warp/examples/benchmarks/benchmark_gemm.py +164 -0
- warp/examples/benchmarks/benchmark_interop_paddle.py +166 -0
- warp/examples/benchmarks/benchmark_interop_torch.py +166 -0
- warp/examples/benchmarks/benchmark_launches.py +301 -0
- warp/examples/benchmarks/benchmark_tile_load_store.py +103 -0
- warp/examples/browse.py +37 -0
- warp/examples/core/example_cupy.py +86 -0
- warp/examples/core/example_dem.py +241 -0
- warp/examples/core/example_fluid.py +299 -0
- warp/examples/core/example_graph_capture.py +150 -0
- warp/examples/core/example_marching_cubes.py +194 -0
- warp/examples/core/example_mesh.py +180 -0
- warp/examples/core/example_mesh_intersect.py +211 -0
- warp/examples/core/example_nvdb.py +182 -0
- warp/examples/core/example_raycast.py +111 -0
- warp/examples/core/example_raymarch.py +205 -0
- warp/examples/core/example_render_opengl.py +193 -0
- warp/examples/core/example_sample_mesh.py +300 -0
- warp/examples/core/example_sph.py +411 -0
- warp/examples/core/example_torch.py +211 -0
- warp/examples/core/example_wave.py +269 -0
- warp/examples/fem/example_adaptive_grid.py +286 -0
- warp/examples/fem/example_apic_fluid.py +423 -0
- warp/examples/fem/example_burgers.py +261 -0
- warp/examples/fem/example_convection_diffusion.py +178 -0
- warp/examples/fem/example_convection_diffusion_dg.py +204 -0
- warp/examples/fem/example_deformed_geometry.py +172 -0
- warp/examples/fem/example_diffusion.py +196 -0
- warp/examples/fem/example_diffusion_3d.py +225 -0
- warp/examples/fem/example_diffusion_mgpu.py +220 -0
- warp/examples/fem/example_distortion_energy.py +228 -0
- warp/examples/fem/example_magnetostatics.py +240 -0
- warp/examples/fem/example_mixed_elasticity.py +291 -0
- warp/examples/fem/example_navier_stokes.py +261 -0
- warp/examples/fem/example_nonconforming_contact.py +298 -0
- warp/examples/fem/example_stokes.py +213 -0
- warp/examples/fem/example_stokes_transfer.py +262 -0
- warp/examples/fem/example_streamlines.py +352 -0
- warp/examples/fem/utils.py +1000 -0
- warp/examples/interop/example_jax_callable.py +116 -0
- warp/examples/interop/example_jax_ffi_callback.py +132 -0
- warp/examples/interop/example_jax_kernel.py +205 -0
- warp/examples/optim/example_bounce.py +266 -0
- warp/examples/optim/example_cloth_throw.py +228 -0
- warp/examples/optim/example_diffray.py +561 -0
- warp/examples/optim/example_drone.py +870 -0
- warp/examples/optim/example_fluid_checkpoint.py +497 -0
- warp/examples/optim/example_inverse_kinematics.py +182 -0
- warp/examples/optim/example_inverse_kinematics_torch.py +191 -0
- warp/examples/optim/example_softbody_properties.py +400 -0
- warp/examples/optim/example_spring_cage.py +245 -0
- warp/examples/optim/example_trajectory.py +227 -0
- warp/examples/sim/example_cartpole.py +143 -0
- warp/examples/sim/example_cloth.py +225 -0
- warp/examples/sim/example_cloth_self_contact.py +322 -0
- warp/examples/sim/example_granular.py +130 -0
- warp/examples/sim/example_granular_collision_sdf.py +202 -0
- warp/examples/sim/example_jacobian_ik.py +244 -0
- warp/examples/sim/example_particle_chain.py +124 -0
- warp/examples/sim/example_quadruped.py +203 -0
- warp/examples/sim/example_rigid_chain.py +203 -0
- warp/examples/sim/example_rigid_contact.py +195 -0
- warp/examples/sim/example_rigid_force.py +133 -0
- warp/examples/sim/example_rigid_gyroscopic.py +115 -0
- warp/examples/sim/example_rigid_soft_contact.py +140 -0
- warp/examples/sim/example_soft_body.py +196 -0
- warp/examples/tile/example_tile_cholesky.py +87 -0
- warp/examples/tile/example_tile_convolution.py +66 -0
- warp/examples/tile/example_tile_fft.py +55 -0
- warp/examples/tile/example_tile_filtering.py +113 -0
- warp/examples/tile/example_tile_matmul.py +85 -0
- warp/examples/tile/example_tile_mlp.py +383 -0
- warp/examples/tile/example_tile_nbody.py +199 -0
- warp/examples/tile/example_tile_walker.py +327 -0
- warp/fabric.py +355 -0
- warp/fem/__init__.py +106 -0
- warp/fem/adaptivity.py +508 -0
- warp/fem/cache.py +572 -0
- warp/fem/dirichlet.py +202 -0
- warp/fem/domain.py +411 -0
- warp/fem/field/__init__.py +125 -0
- warp/fem/field/field.py +619 -0
- warp/fem/field/nodal_field.py +326 -0
- warp/fem/field/restriction.py +37 -0
- warp/fem/field/virtual.py +848 -0
- warp/fem/geometry/__init__.py +32 -0
- warp/fem/geometry/adaptive_nanogrid.py +857 -0
- warp/fem/geometry/closest_point.py +84 -0
- warp/fem/geometry/deformed_geometry.py +221 -0
- warp/fem/geometry/element.py +776 -0
- warp/fem/geometry/geometry.py +362 -0
- warp/fem/geometry/grid_2d.py +392 -0
- warp/fem/geometry/grid_3d.py +452 -0
- warp/fem/geometry/hexmesh.py +911 -0
- warp/fem/geometry/nanogrid.py +571 -0
- warp/fem/geometry/partition.py +389 -0
- warp/fem/geometry/quadmesh.py +663 -0
- warp/fem/geometry/tetmesh.py +855 -0
- warp/fem/geometry/trimesh.py +806 -0
- warp/fem/integrate.py +2335 -0
- warp/fem/linalg.py +419 -0
- warp/fem/operator.py +293 -0
- warp/fem/polynomial.py +229 -0
- warp/fem/quadrature/__init__.py +17 -0
- warp/fem/quadrature/pic_quadrature.py +299 -0
- warp/fem/quadrature/quadrature.py +591 -0
- warp/fem/space/__init__.py +228 -0
- warp/fem/space/basis_function_space.py +468 -0
- warp/fem/space/basis_space.py +667 -0
- warp/fem/space/dof_mapper.py +251 -0
- warp/fem/space/function_space.py +309 -0
- warp/fem/space/grid_2d_function_space.py +177 -0
- warp/fem/space/grid_3d_function_space.py +227 -0
- warp/fem/space/hexmesh_function_space.py +257 -0
- warp/fem/space/nanogrid_function_space.py +201 -0
- warp/fem/space/partition.py +367 -0
- warp/fem/space/quadmesh_function_space.py +223 -0
- warp/fem/space/restriction.py +179 -0
- warp/fem/space/shape/__init__.py +143 -0
- warp/fem/space/shape/cube_shape_function.py +1105 -0
- warp/fem/space/shape/shape_function.py +133 -0
- warp/fem/space/shape/square_shape_function.py +926 -0
- warp/fem/space/shape/tet_shape_function.py +834 -0
- warp/fem/space/shape/triangle_shape_function.py +672 -0
- warp/fem/space/tetmesh_function_space.py +271 -0
- warp/fem/space/topology.py +424 -0
- warp/fem/space/trimesh_function_space.py +194 -0
- warp/fem/types.py +99 -0
- warp/fem/utils.py +420 -0
- warp/jax.py +187 -0
- warp/jax_experimental/__init__.py +16 -0
- warp/jax_experimental/custom_call.py +351 -0
- warp/jax_experimental/ffi.py +698 -0
- warp/jax_experimental/xla_ffi.py +602 -0
- warp/math.py +244 -0
- warp/native/array.h +1145 -0
- warp/native/builtin.h +1800 -0
- warp/native/bvh.cpp +492 -0
- warp/native/bvh.cu +791 -0
- warp/native/bvh.h +554 -0
- warp/native/clang/clang.cpp +536 -0
- warp/native/coloring.cpp +613 -0
- warp/native/crt.cpp +51 -0
- warp/native/crt.h +362 -0
- warp/native/cuda_crt.h +1058 -0
- warp/native/cuda_util.cpp +646 -0
- warp/native/cuda_util.h +307 -0
- warp/native/error.cpp +77 -0
- warp/native/error.h +36 -0
- warp/native/exports.h +1878 -0
- warp/native/fabric.h +245 -0
- warp/native/hashgrid.cpp +311 -0
- warp/native/hashgrid.cu +87 -0
- warp/native/hashgrid.h +240 -0
- warp/native/initializer_array.h +41 -0
- warp/native/intersect.h +1230 -0
- warp/native/intersect_adj.h +375 -0
- warp/native/intersect_tri.h +339 -0
- warp/native/marching.cpp +19 -0
- warp/native/marching.cu +514 -0
- warp/native/marching.h +19 -0
- warp/native/mat.h +2220 -0
- warp/native/mathdx.cpp +87 -0
- warp/native/matnn.h +343 -0
- warp/native/mesh.cpp +266 -0
- warp/native/mesh.cu +404 -0
- warp/native/mesh.h +1980 -0
- warp/native/nanovdb/GridHandle.h +366 -0
- warp/native/nanovdb/HostBuffer.h +590 -0
- warp/native/nanovdb/NanoVDB.h +6624 -0
- warp/native/nanovdb/PNanoVDB.h +3390 -0
- warp/native/noise.h +859 -0
- warp/native/quat.h +1371 -0
- warp/native/rand.h +342 -0
- warp/native/range.h +139 -0
- warp/native/reduce.cpp +174 -0
- warp/native/reduce.cu +364 -0
- warp/native/runlength_encode.cpp +79 -0
- warp/native/runlength_encode.cu +61 -0
- warp/native/scan.cpp +47 -0
- warp/native/scan.cu +53 -0
- warp/native/scan.h +23 -0
- warp/native/solid_angle.h +466 -0
- warp/native/sort.cpp +251 -0
- warp/native/sort.cu +277 -0
- warp/native/sort.h +33 -0
- warp/native/sparse.cpp +378 -0
- warp/native/sparse.cu +524 -0
- warp/native/spatial.h +657 -0
- warp/native/svd.h +702 -0
- warp/native/temp_buffer.h +46 -0
- warp/native/tile.h +2584 -0
- warp/native/tile_reduce.h +264 -0
- warp/native/vec.h +1426 -0
- warp/native/volume.cpp +501 -0
- warp/native/volume.cu +67 -0
- warp/native/volume.h +969 -0
- warp/native/volume_builder.cu +477 -0
- warp/native/volume_builder.h +52 -0
- warp/native/volume_impl.h +70 -0
- warp/native/warp.cpp +1082 -0
- warp/native/warp.cu +3636 -0
- warp/native/warp.h +381 -0
- warp/optim/__init__.py +17 -0
- warp/optim/adam.py +163 -0
- warp/optim/linear.py +1137 -0
- warp/optim/sgd.py +112 -0
- warp/paddle.py +407 -0
- warp/render/__init__.py +18 -0
- warp/render/render_opengl.py +3518 -0
- warp/render/render_usd.py +784 -0
- warp/render/utils.py +160 -0
- warp/sim/__init__.py +65 -0
- warp/sim/articulation.py +793 -0
- warp/sim/collide.py +2395 -0
- warp/sim/graph_coloring.py +300 -0
- warp/sim/import_mjcf.py +790 -0
- warp/sim/import_snu.py +227 -0
- warp/sim/import_urdf.py +579 -0
- warp/sim/import_usd.py +894 -0
- warp/sim/inertia.py +324 -0
- warp/sim/integrator.py +242 -0
- warp/sim/integrator_euler.py +1997 -0
- warp/sim/integrator_featherstone.py +2101 -0
- warp/sim/integrator_vbd.py +2048 -0
- warp/sim/integrator_xpbd.py +3292 -0
- warp/sim/model.py +4791 -0
- warp/sim/particles.py +121 -0
- warp/sim/render.py +427 -0
- warp/sim/utils.py +428 -0
- warp/sparse.py +2057 -0
- warp/stubs.py +3333 -0
- warp/tape.py +1203 -0
- warp/tests/__init__.py +1 -0
- warp/tests/__main__.py +4 -0
- warp/tests/assets/curlnoise_golden.npy +0 -0
- warp/tests/assets/mlp_golden.npy +0 -0
- warp/tests/assets/pixel.npy +0 -0
- warp/tests/assets/pnoise_golden.npy +0 -0
- warp/tests/assets/spiky.usd +0 -0
- warp/tests/assets/test_grid.nvdb +0 -0
- warp/tests/assets/test_index_grid.nvdb +0 -0
- warp/tests/assets/test_int32_grid.nvdb +0 -0
- warp/tests/assets/test_vec_grid.nvdb +0 -0
- warp/tests/assets/torus.nvdb +0 -0
- warp/tests/assets/torus.usda +105 -0
- warp/tests/aux_test_class_kernel.py +34 -0
- warp/tests/aux_test_compile_consts_dummy.py +18 -0
- warp/tests/aux_test_conditional_unequal_types_kernels.py +29 -0
- warp/tests/aux_test_dependent.py +29 -0
- warp/tests/aux_test_grad_customs.py +29 -0
- warp/tests/aux_test_instancing_gc.py +26 -0
- warp/tests/aux_test_module_unload.py +23 -0
- warp/tests/aux_test_name_clash1.py +40 -0
- warp/tests/aux_test_name_clash2.py +40 -0
- warp/tests/aux_test_reference.py +9 -0
- warp/tests/aux_test_reference_reference.py +8 -0
- warp/tests/aux_test_square.py +16 -0
- warp/tests/aux_test_unresolved_func.py +22 -0
- warp/tests/aux_test_unresolved_symbol.py +22 -0
- warp/tests/cuda/__init__.py +0 -0
- warp/tests/cuda/test_async.py +676 -0
- warp/tests/cuda/test_ipc.py +124 -0
- warp/tests/cuda/test_mempool.py +233 -0
- warp/tests/cuda/test_multigpu.py +169 -0
- warp/tests/cuda/test_peer.py +139 -0
- warp/tests/cuda/test_pinned.py +84 -0
- warp/tests/cuda/test_streams.py +634 -0
- warp/tests/geometry/__init__.py +0 -0
- warp/tests/geometry/test_bvh.py +200 -0
- warp/tests/geometry/test_hash_grid.py +221 -0
- warp/tests/geometry/test_marching_cubes.py +74 -0
- warp/tests/geometry/test_mesh.py +316 -0
- warp/tests/geometry/test_mesh_query_aabb.py +399 -0
- warp/tests/geometry/test_mesh_query_point.py +932 -0
- warp/tests/geometry/test_mesh_query_ray.py +311 -0
- warp/tests/geometry/test_volume.py +1103 -0
- warp/tests/geometry/test_volume_write.py +346 -0
- warp/tests/interop/__init__.py +0 -0
- warp/tests/interop/test_dlpack.py +729 -0
- warp/tests/interop/test_jax.py +371 -0
- warp/tests/interop/test_paddle.py +800 -0
- warp/tests/interop/test_torch.py +1001 -0
- warp/tests/run_coverage_serial.py +39 -0
- warp/tests/sim/__init__.py +0 -0
- warp/tests/sim/disabled_kinematics.py +244 -0
- warp/tests/sim/flaky_test_sim_grad.py +290 -0
- warp/tests/sim/test_collision.py +604 -0
- warp/tests/sim/test_coloring.py +258 -0
- warp/tests/sim/test_model.py +224 -0
- warp/tests/sim/test_sim_grad_bounce_linear.py +212 -0
- warp/tests/sim/test_sim_kinematics.py +98 -0
- warp/tests/sim/test_vbd.py +597 -0
- warp/tests/test_adam.py +163 -0
- warp/tests/test_arithmetic.py +1096 -0
- warp/tests/test_array.py +2972 -0
- warp/tests/test_array_reduce.py +156 -0
- warp/tests/test_assert.py +250 -0
- warp/tests/test_atomic.py +153 -0
- warp/tests/test_bool.py +220 -0
- warp/tests/test_builtins_resolution.py +1298 -0
- warp/tests/test_closest_point_edge_edge.py +327 -0
- warp/tests/test_codegen.py +810 -0
- warp/tests/test_codegen_instancing.py +1495 -0
- warp/tests/test_compile_consts.py +215 -0
- warp/tests/test_conditional.py +252 -0
- warp/tests/test_context.py +42 -0
- warp/tests/test_copy.py +238 -0
- warp/tests/test_ctypes.py +638 -0
- warp/tests/test_dense.py +73 -0
- warp/tests/test_devices.py +97 -0
- warp/tests/test_examples.py +482 -0
- warp/tests/test_fabricarray.py +996 -0
- warp/tests/test_fast_math.py +74 -0
- warp/tests/test_fem.py +2003 -0
- warp/tests/test_fp16.py +136 -0
- warp/tests/test_func.py +454 -0
- warp/tests/test_future_annotations.py +98 -0
- warp/tests/test_generics.py +656 -0
- warp/tests/test_grad.py +893 -0
- warp/tests/test_grad_customs.py +339 -0
- warp/tests/test_grad_debug.py +341 -0
- warp/tests/test_implicit_init.py +411 -0
- warp/tests/test_import.py +45 -0
- warp/tests/test_indexedarray.py +1140 -0
- warp/tests/test_intersect.py +73 -0
- warp/tests/test_iter.py +76 -0
- warp/tests/test_large.py +177 -0
- warp/tests/test_launch.py +411 -0
- warp/tests/test_lerp.py +151 -0
- warp/tests/test_linear_solvers.py +193 -0
- warp/tests/test_lvalue.py +427 -0
- warp/tests/test_mat.py +2089 -0
- warp/tests/test_mat_lite.py +122 -0
- warp/tests/test_mat_scalar_ops.py +2913 -0
- warp/tests/test_math.py +178 -0
- warp/tests/test_mlp.py +282 -0
- warp/tests/test_module_hashing.py +258 -0
- warp/tests/test_modules_lite.py +44 -0
- warp/tests/test_noise.py +252 -0
- warp/tests/test_operators.py +299 -0
- warp/tests/test_options.py +129 -0
- warp/tests/test_overwrite.py +551 -0
- warp/tests/test_print.py +339 -0
- warp/tests/test_quat.py +2315 -0
- warp/tests/test_rand.py +339 -0
- warp/tests/test_reload.py +302 -0
- warp/tests/test_rounding.py +185 -0
- warp/tests/test_runlength_encode.py +196 -0
- warp/tests/test_scalar_ops.py +105 -0
- warp/tests/test_smoothstep.py +108 -0
- warp/tests/test_snippet.py +318 -0
- warp/tests/test_sparse.py +582 -0
- warp/tests/test_spatial.py +2229 -0
- warp/tests/test_special_values.py +361 -0
- warp/tests/test_static.py +592 -0
- warp/tests/test_struct.py +734 -0
- warp/tests/test_tape.py +204 -0
- warp/tests/test_transient_module.py +93 -0
- warp/tests/test_triangle_closest_point.py +145 -0
- warp/tests/test_types.py +562 -0
- warp/tests/test_utils.py +588 -0
- warp/tests/test_vec.py +1487 -0
- warp/tests/test_vec_lite.py +80 -0
- warp/tests/test_vec_scalar_ops.py +2327 -0
- warp/tests/test_verify_fp.py +100 -0
- warp/tests/tile/__init__.py +0 -0
- warp/tests/tile/test_tile.py +780 -0
- warp/tests/tile/test_tile_load.py +407 -0
- warp/tests/tile/test_tile_mathdx.py +208 -0
- warp/tests/tile/test_tile_mlp.py +402 -0
- warp/tests/tile/test_tile_reduce.py +447 -0
- warp/tests/tile/test_tile_shared_memory.py +247 -0
- warp/tests/tile/test_tile_view.py +173 -0
- warp/tests/unittest_serial.py +47 -0
- warp/tests/unittest_suites.py +427 -0
- warp/tests/unittest_utils.py +468 -0
- warp/tests/walkthrough_debug.py +93 -0
- warp/thirdparty/__init__.py +0 -0
- warp/thirdparty/appdirs.py +598 -0
- warp/thirdparty/dlpack.py +145 -0
- warp/thirdparty/unittest_parallel.py +570 -0
- warp/torch.py +391 -0
- warp/types.py +5230 -0
- warp/utils.py +1137 -0
- warp_lang-1.7.0.dist-info/METADATA +516 -0
- warp_lang-1.7.0.dist-info/RECORD +429 -0
- warp_lang-1.7.0.dist-info/WHEEL +5 -0
- warp_lang-1.7.0.dist-info/licenses/LICENSE.md +202 -0
- warp_lang-1.7.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,776 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
|
|
16
|
+
from typing import List, Tuple
|
|
17
|
+
|
|
18
|
+
from warp.fem.polynomial import Polynomial, quadrature_1d
|
|
19
|
+
from warp.fem.types import Coords
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class Element:
|
|
23
|
+
dimension = 0
|
|
24
|
+
"""Intrinsic dimension of the element"""
|
|
25
|
+
|
|
26
|
+
def measure() -> float:
|
|
27
|
+
"""Measure (area, volume, ...) of the reference element"""
|
|
28
|
+
raise NotImplementedError
|
|
29
|
+
|
|
30
|
+
@staticmethod
|
|
31
|
+
def instantiate_quadrature(order: int, family: Polynomial) -> Tuple[List[Coords], List[float]]:
|
|
32
|
+
"""Returns a quadrature of a given order for a prototypical element"""
|
|
33
|
+
raise NotImplementedError
|
|
34
|
+
|
|
35
|
+
def center(self) -> Tuple[float]:
|
|
36
|
+
coords, _ = self.instantiate_quadrature(order=0, family=None)
|
|
37
|
+
return coords[0]
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def _point_count_from_order(order: int, family: Polynomial):
|
|
41
|
+
if family == Polynomial.GAUSS_LEGENDRE:
|
|
42
|
+
point_count = max(1, order // 2 + 1)
|
|
43
|
+
elif family == Polynomial.LOBATTO_GAUSS_LEGENDRE:
|
|
44
|
+
point_count = max(2, order // 2 + 2)
|
|
45
|
+
elif family == Polynomial.EQUISPACED_CLOSED:
|
|
46
|
+
point_count = max(2, 2 * (order // 2) + 1)
|
|
47
|
+
elif family == Polynomial.EQUISPACED_OPEN:
|
|
48
|
+
point_count = max(1, 2 * (order // 2) + 1)
|
|
49
|
+
|
|
50
|
+
return point_count
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class Cube(Element):
|
|
54
|
+
dimension = 3
|
|
55
|
+
|
|
56
|
+
@staticmethod
|
|
57
|
+
def measure() -> float:
|
|
58
|
+
return 1.0
|
|
59
|
+
|
|
60
|
+
@staticmethod
|
|
61
|
+
def instantiate_quadrature(order: int, family: Polynomial):
|
|
62
|
+
if family is None:
|
|
63
|
+
family = Polynomial.GAUSS_LEGENDRE
|
|
64
|
+
|
|
65
|
+
point_count = _point_count_from_order(order=order, family=family)
|
|
66
|
+
gauss_1d, weights_1d = quadrature_1d(point_count=point_count, family=family)
|
|
67
|
+
|
|
68
|
+
coords = [Coords(x, y, z) for x in gauss_1d for y in gauss_1d for z in gauss_1d]
|
|
69
|
+
weights = [wx * wy * wz for wx in weights_1d for wy in weights_1d for wz in weights_1d]
|
|
70
|
+
|
|
71
|
+
return coords, weights
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
class Square(Element):
|
|
75
|
+
dimension = 2
|
|
76
|
+
|
|
77
|
+
@staticmethod
|
|
78
|
+
def measure() -> float:
|
|
79
|
+
return 1.0
|
|
80
|
+
|
|
81
|
+
@staticmethod
|
|
82
|
+
def instantiate_quadrature(order: int, family: Polynomial):
|
|
83
|
+
if family is None:
|
|
84
|
+
family = Polynomial.GAUSS_LEGENDRE
|
|
85
|
+
|
|
86
|
+
point_count = _point_count_from_order(order=order, family=family)
|
|
87
|
+
gauss_1d, weights_1d = quadrature_1d(point_count=point_count, family=family)
|
|
88
|
+
|
|
89
|
+
coords = [Coords(x, y, 0.0) for x in gauss_1d for y in gauss_1d]
|
|
90
|
+
weights = [wx * wy for wx in weights_1d for wy in weights_1d]
|
|
91
|
+
|
|
92
|
+
return coords, weights
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
class LinearEdge(Element):
|
|
96
|
+
dimension = 1
|
|
97
|
+
|
|
98
|
+
@staticmethod
|
|
99
|
+
def measure() -> float:
|
|
100
|
+
return 1.0
|
|
101
|
+
|
|
102
|
+
@staticmethod
|
|
103
|
+
def instantiate_quadrature(order: int, family: Polynomial):
|
|
104
|
+
if family is None:
|
|
105
|
+
family = Polynomial.GAUSS_LEGENDRE
|
|
106
|
+
|
|
107
|
+
point_count = _point_count_from_order(order=order, family=family)
|
|
108
|
+
gauss_1d, weights_1d = quadrature_1d(point_count=point_count, family=family)
|
|
109
|
+
|
|
110
|
+
coords = [Coords(x, 0.0, 0.0) for x in gauss_1d]
|
|
111
|
+
return coords, weights_1d
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
class Triangle(Element):
|
|
115
|
+
dimension = 2
|
|
116
|
+
|
|
117
|
+
@staticmethod
|
|
118
|
+
def measure() -> float:
|
|
119
|
+
return 0.5
|
|
120
|
+
|
|
121
|
+
@staticmethod
|
|
122
|
+
def instantiate_quadrature(order: int, family: Polynomial):
|
|
123
|
+
if family is not None:
|
|
124
|
+
# Duffy transformation from square to triangle
|
|
125
|
+
point_count = _point_count_from_order(order=order + 1, family=family)
|
|
126
|
+
gauss_1d, weights_1d = quadrature_1d(point_count=point_count, family=family)
|
|
127
|
+
|
|
128
|
+
coords = [Coords(1.0 - x - y + x * y, x, y * (1.0 - x)) for x in gauss_1d for y in gauss_1d]
|
|
129
|
+
|
|
130
|
+
# Scale weight by 2.0 so that they sum up to 1
|
|
131
|
+
weights = [2.0 * wx * (1.0 - x) * wy for x, wx in zip(gauss_1d, weights_1d) for wy in weights_1d]
|
|
132
|
+
|
|
133
|
+
return coords, weights
|
|
134
|
+
|
|
135
|
+
if order <= 1:
|
|
136
|
+
weights = [1.0]
|
|
137
|
+
coords = [Coords(1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0)]
|
|
138
|
+
elif order <= 2:
|
|
139
|
+
weights = [1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0]
|
|
140
|
+
coords = [
|
|
141
|
+
Coords(2.0 / 3.0, 1.0 / 6.0, 1.0 / 6.0),
|
|
142
|
+
Coords(1.0 / 6.0, 2.0 / 3.0, 1.0 / 6.0),
|
|
143
|
+
Coords(1.0 / 6.0, 1.0 / 6.0, 2.0 / 3.0),
|
|
144
|
+
]
|
|
145
|
+
elif order <= 3:
|
|
146
|
+
# Hillion 1977,
|
|
147
|
+
# "Numerical Integration on a Triangle"
|
|
148
|
+
weights = [
|
|
149
|
+
3.18041381743977225049491153185954e-01,
|
|
150
|
+
3.18041381743977225049491153185954e-01,
|
|
151
|
+
1.81958618256022719439357615556219e-01,
|
|
152
|
+
1.81958618256022719439357615556219e-01,
|
|
153
|
+
]
|
|
154
|
+
|
|
155
|
+
coords = [
|
|
156
|
+
Coords(
|
|
157
|
+
6.66390246014701426169324349757517e-01,
|
|
158
|
+
1.78558728263616461884311092944699e-01,
|
|
159
|
+
1.55051025721682111946364557297784e-01,
|
|
160
|
+
),
|
|
161
|
+
Coords(
|
|
162
|
+
1.78558728263616461884311092944699e-01,
|
|
163
|
+
6.66390246014701426169324349757517e-01,
|
|
164
|
+
1.55051025721682056435213326039957e-01,
|
|
165
|
+
),
|
|
166
|
+
Coords(
|
|
167
|
+
2.80019915499074012465996474929852e-01,
|
|
168
|
+
7.50311102226081383381739442484104e-02,
|
|
169
|
+
6.44948974278317876951405196450651e-01,
|
|
170
|
+
),
|
|
171
|
+
Coords(
|
|
172
|
+
7.50311102226081383381739442484104e-02,
|
|
173
|
+
2.80019915499074012465996474929852e-01,
|
|
174
|
+
6.44948974278317876951405196450651e-01,
|
|
175
|
+
),
|
|
176
|
+
]
|
|
177
|
+
elif order <= 4:
|
|
178
|
+
# Witherden and Vincent 2015,
|
|
179
|
+
# "On the identification of symmetric quadrature rules for finite element methods"
|
|
180
|
+
# https://doi.org/10.1016/j.camwa.2015.03.017
|
|
181
|
+
|
|
182
|
+
weights = [
|
|
183
|
+
2.23381589678011471811203136894619e-01,
|
|
184
|
+
2.23381589678011471811203136894619e-01,
|
|
185
|
+
2.23381589678011471811203136894619e-01,
|
|
186
|
+
1.09951743655321870773988734981685e-01,
|
|
187
|
+
1.09951743655321870773988734981685e-01,
|
|
188
|
+
1.09951743655321870773988734981685e-01,
|
|
189
|
+
]
|
|
190
|
+
|
|
191
|
+
coords = [
|
|
192
|
+
Coords(
|
|
193
|
+
4.45948490915964890213274429697776e-01,
|
|
194
|
+
4.45948490915964890213274429697776e-01,
|
|
195
|
+
1.08103018168070219573451140604448e-01,
|
|
196
|
+
),
|
|
197
|
+
Coords(
|
|
198
|
+
4.45948490915964890213274429697776e-01,
|
|
199
|
+
1.08103018168070219573451140604448e-01,
|
|
200
|
+
4.45948490915964890213274429697776e-01,
|
|
201
|
+
),
|
|
202
|
+
Coords(
|
|
203
|
+
1.08103018168070219573451140604448e-01,
|
|
204
|
+
4.45948490915964890213274429697776e-01,
|
|
205
|
+
4.45948490915964890213274429697776e-01,
|
|
206
|
+
),
|
|
207
|
+
Coords(
|
|
208
|
+
9.15762135097707430375635340169538e-02,
|
|
209
|
+
9.15762135097707430375635340169538e-02,
|
|
210
|
+
8.16847572980458513924872931966092e-01,
|
|
211
|
+
),
|
|
212
|
+
Coords(
|
|
213
|
+
9.15762135097707430375635340169538e-02,
|
|
214
|
+
8.16847572980458513924872931966092e-01,
|
|
215
|
+
9.15762135097707430375635340169538e-02,
|
|
216
|
+
),
|
|
217
|
+
Coords(
|
|
218
|
+
8.16847572980458513924872931966092e-01,
|
|
219
|
+
9.15762135097707430375635340169538e-02,
|
|
220
|
+
9.15762135097707430375635340169538e-02,
|
|
221
|
+
),
|
|
222
|
+
]
|
|
223
|
+
|
|
224
|
+
elif order <= 5:
|
|
225
|
+
weights = [
|
|
226
|
+
2.25000000000000005551115123125783e-01,
|
|
227
|
+
1.25939180544827139529573400977824e-01,
|
|
228
|
+
1.25939180544827139529573400977824e-01,
|
|
229
|
+
1.25939180544827139529573400977824e-01,
|
|
230
|
+
1.32394152788506191953388224646915e-01,
|
|
231
|
+
1.32394152788506191953388224646915e-01,
|
|
232
|
+
1.32394152788506191953388224646915e-01,
|
|
233
|
+
]
|
|
234
|
+
|
|
235
|
+
coords = [
|
|
236
|
+
Coords(
|
|
237
|
+
3.33333333333333314829616256247391e-01,
|
|
238
|
+
3.33333333333333314829616256247391e-01,
|
|
239
|
+
3.33333333333333314829616256247391e-01,
|
|
240
|
+
),
|
|
241
|
+
Coords(
|
|
242
|
+
1.01286507323456342888334802410100e-01,
|
|
243
|
+
1.01286507323456342888334802410100e-01,
|
|
244
|
+
7.97426985353087314223330395179801e-01,
|
|
245
|
+
),
|
|
246
|
+
Coords(
|
|
247
|
+
1.01286507323456342888334802410100e-01,
|
|
248
|
+
7.97426985353087314223330395179801e-01,
|
|
249
|
+
1.01286507323456342888334802410100e-01,
|
|
250
|
+
),
|
|
251
|
+
Coords(
|
|
252
|
+
7.97426985353087314223330395179801e-01,
|
|
253
|
+
1.01286507323456342888334802410100e-01,
|
|
254
|
+
1.01286507323456342888334802410100e-01,
|
|
255
|
+
),
|
|
256
|
+
Coords(
|
|
257
|
+
4.70142064105115109473587153843255e-01,
|
|
258
|
+
4.70142064105115109473587153843255e-01,
|
|
259
|
+
5.97158717897697810528256923134904e-02,
|
|
260
|
+
),
|
|
261
|
+
Coords(
|
|
262
|
+
4.70142064105115109473587153843255e-01,
|
|
263
|
+
5.97158717897697810528256923134904e-02,
|
|
264
|
+
4.70142064105115109473587153843255e-01,
|
|
265
|
+
),
|
|
266
|
+
Coords(
|
|
267
|
+
5.97158717897697810528256923134904e-02,
|
|
268
|
+
4.70142064105115109473587153843255e-01,
|
|
269
|
+
4.70142064105115109473587153843255e-01,
|
|
270
|
+
),
|
|
271
|
+
]
|
|
272
|
+
elif order <= 6:
|
|
273
|
+
weights = [
|
|
274
|
+
5.08449063702068326797700592578622e-02,
|
|
275
|
+
5.08449063702068326797700592578622e-02,
|
|
276
|
+
5.08449063702068326797700592578622e-02,
|
|
277
|
+
1.16786275726379396022736045779311e-01,
|
|
278
|
+
1.16786275726379396022736045779311e-01,
|
|
279
|
+
1.16786275726379396022736045779311e-01,
|
|
280
|
+
8.28510756183735846969184990484791e-02,
|
|
281
|
+
8.28510756183735846969184990484791e-02,
|
|
282
|
+
8.28510756183735846969184990484791e-02,
|
|
283
|
+
8.28510756183735846969184990484791e-02,
|
|
284
|
+
8.28510756183735846969184990484791e-02,
|
|
285
|
+
8.28510756183735846969184990484791e-02,
|
|
286
|
+
]
|
|
287
|
+
|
|
288
|
+
coords = [
|
|
289
|
+
Coords(
|
|
290
|
+
6.30890144915022266225435032538371e-02,
|
|
291
|
+
6.30890144915022266225435032538371e-02,
|
|
292
|
+
8.73821971016995546754912993492326e-01,
|
|
293
|
+
),
|
|
294
|
+
Coords(
|
|
295
|
+
6.30890144915022266225435032538371e-02,
|
|
296
|
+
8.73821971016995546754912993492326e-01,
|
|
297
|
+
6.30890144915022266225435032538371e-02,
|
|
298
|
+
),
|
|
299
|
+
Coords(
|
|
300
|
+
8.73821971016995546754912993492326e-01,
|
|
301
|
+
6.30890144915022266225435032538371e-02,
|
|
302
|
+
6.30890144915022266225435032538371e-02,
|
|
303
|
+
),
|
|
304
|
+
Coords(
|
|
305
|
+
2.49286745170910428726074314909056e-01,
|
|
306
|
+
2.49286745170910428726074314909056e-01,
|
|
307
|
+
5.01426509658179142547851370181888e-01,
|
|
308
|
+
),
|
|
309
|
+
Coords(
|
|
310
|
+
2.49286745170910428726074314909056e-01,
|
|
311
|
+
5.01426509658179142547851370181888e-01,
|
|
312
|
+
2.49286745170910428726074314909056e-01,
|
|
313
|
+
),
|
|
314
|
+
Coords(
|
|
315
|
+
5.01426509658179142547851370181888e-01,
|
|
316
|
+
2.49286745170910428726074314909056e-01,
|
|
317
|
+
2.49286745170910428726074314909056e-01,
|
|
318
|
+
),
|
|
319
|
+
Coords(
|
|
320
|
+
5.31450498448169383891581674106419e-02,
|
|
321
|
+
3.10352451033784393352732422499685e-01,
|
|
322
|
+
6.36502499121398668258109410089673e-01,
|
|
323
|
+
),
|
|
324
|
+
Coords(
|
|
325
|
+
5.31450498448169383891581674106419e-02,
|
|
326
|
+
6.36502499121398668258109410089673e-01,
|
|
327
|
+
3.10352451033784393352732422499685e-01,
|
|
328
|
+
),
|
|
329
|
+
Coords(
|
|
330
|
+
3.10352451033784393352732422499685e-01,
|
|
331
|
+
5.31450498448169383891581674106419e-02,
|
|
332
|
+
6.36502499121398668258109410089673e-01,
|
|
333
|
+
),
|
|
334
|
+
Coords(
|
|
335
|
+
3.10352451033784393352732422499685e-01,
|
|
336
|
+
6.36502499121398668258109410089673e-01,
|
|
337
|
+
5.31450498448169383891581674106419e-02,
|
|
338
|
+
),
|
|
339
|
+
Coords(
|
|
340
|
+
6.36502499121398668258109410089673e-01,
|
|
341
|
+
5.31450498448169383891581674106419e-02,
|
|
342
|
+
3.10352451033784393352732422499685e-01,
|
|
343
|
+
),
|
|
344
|
+
Coords(
|
|
345
|
+
6.36502499121398668258109410089673e-01,
|
|
346
|
+
3.10352451033784393352732422499685e-01,
|
|
347
|
+
5.31450498448169383891581674106419e-02,
|
|
348
|
+
),
|
|
349
|
+
]
|
|
350
|
+
else:
|
|
351
|
+
# Order 8
|
|
352
|
+
|
|
353
|
+
weights = [
|
|
354
|
+
1.44315607677787172136163462710101e-01,
|
|
355
|
+
9.50916342672846193195823616406415e-02,
|
|
356
|
+
9.50916342672846193195823616406415e-02,
|
|
357
|
+
9.50916342672846193195823616406415e-02,
|
|
358
|
+
1.03217370534718244634575512463925e-01,
|
|
359
|
+
1.03217370534718244634575512463925e-01,
|
|
360
|
+
1.03217370534718244634575512463925e-01,
|
|
361
|
+
3.24584976231980792960030157701112e-02,
|
|
362
|
+
3.24584976231980792960030157701112e-02,
|
|
363
|
+
3.24584976231980792960030157701112e-02,
|
|
364
|
+
2.72303141744349927466650740370824e-02,
|
|
365
|
+
2.72303141744349927466650740370824e-02,
|
|
366
|
+
2.72303141744349927466650740370824e-02,
|
|
367
|
+
2.72303141744349927466650740370824e-02,
|
|
368
|
+
2.72303141744349927466650740370824e-02,
|
|
369
|
+
2.72303141744349927466650740370824e-02,
|
|
370
|
+
]
|
|
371
|
+
|
|
372
|
+
coords = [
|
|
373
|
+
Coords(
|
|
374
|
+
3.33333333333333314829616256247391e-01,
|
|
375
|
+
3.33333333333333314829616256247391e-01,
|
|
376
|
+
3.33333333333333314829616256247391e-01,
|
|
377
|
+
),
|
|
378
|
+
Coords(
|
|
379
|
+
4.59292588292723125142913431773195e-01,
|
|
380
|
+
4.59292588292723125142913431773195e-01,
|
|
381
|
+
8.14148234145537497141731364536099e-02,
|
|
382
|
+
),
|
|
383
|
+
Coords(
|
|
384
|
+
4.59292588292723125142913431773195e-01,
|
|
385
|
+
8.14148234145537497141731364536099e-02,
|
|
386
|
+
4.59292588292723125142913431773195e-01,
|
|
387
|
+
),
|
|
388
|
+
Coords(
|
|
389
|
+
8.14148234145537497141731364536099e-02,
|
|
390
|
+
4.59292588292723125142913431773195e-01,
|
|
391
|
+
4.59292588292723125142913431773195e-01,
|
|
392
|
+
),
|
|
393
|
+
Coords(
|
|
394
|
+
1.70569307751760212976677166807349e-01,
|
|
395
|
+
1.70569307751760212976677166807349e-01,
|
|
396
|
+
6.58861384496479574046645666385302e-01,
|
|
397
|
+
),
|
|
398
|
+
Coords(
|
|
399
|
+
1.70569307751760212976677166807349e-01,
|
|
400
|
+
6.58861384496479574046645666385302e-01,
|
|
401
|
+
1.70569307751760212976677166807349e-01,
|
|
402
|
+
),
|
|
403
|
+
Coords(
|
|
404
|
+
6.58861384496479574046645666385302e-01,
|
|
405
|
+
1.70569307751760212976677166807349e-01,
|
|
406
|
+
1.70569307751760212976677166807349e-01,
|
|
407
|
+
),
|
|
408
|
+
Coords(
|
|
409
|
+
5.05472283170309566457945038564503e-02,
|
|
410
|
+
5.05472283170309566457945038564503e-02,
|
|
411
|
+
8.98905543365938086708410992287099e-01,
|
|
412
|
+
),
|
|
413
|
+
Coords(
|
|
414
|
+
5.05472283170309566457945038564503e-02,
|
|
415
|
+
8.98905543365938086708410992287099e-01,
|
|
416
|
+
5.05472283170309566457945038564503e-02,
|
|
417
|
+
),
|
|
418
|
+
Coords(
|
|
419
|
+
8.98905543365938086708410992287099e-01,
|
|
420
|
+
5.05472283170309566457945038564503e-02,
|
|
421
|
+
5.05472283170309566457945038564503e-02,
|
|
422
|
+
),
|
|
423
|
+
Coords(
|
|
424
|
+
8.39477740995758781039626228448469e-03,
|
|
425
|
+
2.63112829634638112352718053443823e-01,
|
|
426
|
+
7.28492392955404355348036915529519e-01,
|
|
427
|
+
),
|
|
428
|
+
Coords(
|
|
429
|
+
8.39477740995758781039626228448469e-03,
|
|
430
|
+
7.28492392955404355348036915529519e-01,
|
|
431
|
+
2.63112829634638112352718053443823e-01,
|
|
432
|
+
),
|
|
433
|
+
Coords(
|
|
434
|
+
2.63112829634638112352718053443823e-01,
|
|
435
|
+
8.39477740995758781039626228448469e-03,
|
|
436
|
+
7.28492392955404355348036915529519e-01,
|
|
437
|
+
),
|
|
438
|
+
Coords(
|
|
439
|
+
2.63112829634638112352718053443823e-01,
|
|
440
|
+
7.28492392955404355348036915529519e-01,
|
|
441
|
+
8.39477740995758781039626228448469e-03,
|
|
442
|
+
),
|
|
443
|
+
Coords(
|
|
444
|
+
7.28492392955404355348036915529519e-01,
|
|
445
|
+
8.39477740995758781039626228448469e-03,
|
|
446
|
+
2.63112829634638112352718053443823e-01,
|
|
447
|
+
),
|
|
448
|
+
Coords(
|
|
449
|
+
7.28492392955404355348036915529519e-01,
|
|
450
|
+
2.63112829634638112352718053443823e-01,
|
|
451
|
+
8.39477740995758781039626228448469e-03,
|
|
452
|
+
),
|
|
453
|
+
]
|
|
454
|
+
|
|
455
|
+
return coords, weights
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
class Tetrahedron(Element):
|
|
459
|
+
dimension = 3
|
|
460
|
+
|
|
461
|
+
@staticmethod
|
|
462
|
+
def measure() -> float:
|
|
463
|
+
return 1.0 / 6.0
|
|
464
|
+
|
|
465
|
+
@staticmethod
|
|
466
|
+
def instantiate_quadrature(order: int, family: Polynomial):
|
|
467
|
+
if family is not None:
|
|
468
|
+
# Duffy transformation from square to triangle
|
|
469
|
+
point_count = _point_count_from_order(order=order + 1, family=family)
|
|
470
|
+
gauss_1d, weights_1d = quadrature_1d(point_count=point_count, family=family)
|
|
471
|
+
|
|
472
|
+
coords = [
|
|
473
|
+
Coords(x, y * (1.0 - x), z * (1.0 - x) * (1.0 - y))
|
|
474
|
+
for x in gauss_1d
|
|
475
|
+
for y in gauss_1d
|
|
476
|
+
for z in gauss_1d
|
|
477
|
+
]
|
|
478
|
+
|
|
479
|
+
# Scale weight by 6.0 so that they sum up to 1
|
|
480
|
+
weights = [
|
|
481
|
+
6.0 * wx * wy * wz * (1.0 - x) * (1.0 - x) * (1.0 - y)
|
|
482
|
+
for x, wx in zip(gauss_1d, weights_1d)
|
|
483
|
+
for y, wy in zip(gauss_1d, weights_1d)
|
|
484
|
+
for wz in weights_1d
|
|
485
|
+
]
|
|
486
|
+
|
|
487
|
+
return coords, weights
|
|
488
|
+
|
|
489
|
+
# Shunn and Ham 2012
|
|
490
|
+
# "Symmetric quadrature rules for tetrahedra based on a cubic close-packed lattice arrangement"
|
|
491
|
+
# https://doi.org/10.1016/j.cam.2012.03.032
|
|
492
|
+
|
|
493
|
+
# TODO: add Witherden and Vincent 2015,
|
|
494
|
+
|
|
495
|
+
if order <= 1:
|
|
496
|
+
weights = [1.0]
|
|
497
|
+
coords = [Coords(1.0 / 4.0, 1.0 / 4.0, 1.0 / 4.0)]
|
|
498
|
+
elif order <= 2:
|
|
499
|
+
weights = [1.0 / 4.0, 1.0 / 4.0, 1.0 / 4.0, 1.0 / 4.0]
|
|
500
|
+
coords = [
|
|
501
|
+
Coords(0.1381966011250110, 0.1381966011250110, 0.1381966011250110),
|
|
502
|
+
Coords(0.5854101966249680, 0.1381966011250110, 0.1381966011250110),
|
|
503
|
+
Coords(0.1381966011250110, 0.5854101966249680, 0.1381966011250110),
|
|
504
|
+
Coords(0.1381966011250110, 0.1381966011250110, 0.5854101966249680),
|
|
505
|
+
]
|
|
506
|
+
elif order <= 3:
|
|
507
|
+
weights = [
|
|
508
|
+
0.0476331348432089,
|
|
509
|
+
0.0476331348432089,
|
|
510
|
+
0.0476331348432089,
|
|
511
|
+
0.0476331348432089,
|
|
512
|
+
0.1349112434378610,
|
|
513
|
+
0.1349112434378610,
|
|
514
|
+
0.1349112434378610,
|
|
515
|
+
0.1349112434378610,
|
|
516
|
+
0.1349112434378610,
|
|
517
|
+
0.1349112434378610,
|
|
518
|
+
]
|
|
519
|
+
|
|
520
|
+
coords = [
|
|
521
|
+
Coords(0.0738349017262234, 0.0738349017262234, 0.0738349017262234),
|
|
522
|
+
Coords(0.7784952948213300, 0.0738349017262234, 0.0738349017262234),
|
|
523
|
+
Coords(0.0738349017262234, 0.7784952948213300, 0.0738349017262234),
|
|
524
|
+
Coords(0.0738349017262234, 0.0738349017262234, 0.7784952948213300),
|
|
525
|
+
Coords(0.4062443438840510, 0.0937556561159491, 0.0937556561159491),
|
|
526
|
+
Coords(0.0937556561159491, 0.4062443438840510, 0.0937556561159491),
|
|
527
|
+
Coords(0.0937556561159491, 0.0937556561159491, 0.4062443438840510),
|
|
528
|
+
Coords(0.4062443438840510, 0.4062443438840510, 0.0937556561159491),
|
|
529
|
+
Coords(0.4062443438840510, 0.0937556561159491, 0.4062443438840510),
|
|
530
|
+
Coords(0.0937556561159491, 0.4062443438840510, 0.4062443438840510),
|
|
531
|
+
]
|
|
532
|
+
elif order <= 4:
|
|
533
|
+
weights = [
|
|
534
|
+
0.0070670747944695,
|
|
535
|
+
0.0070670747944695,
|
|
536
|
+
0.0070670747944695,
|
|
537
|
+
0.0070670747944695,
|
|
538
|
+
0.0469986689718877,
|
|
539
|
+
0.0469986689718877,
|
|
540
|
+
0.0469986689718877,
|
|
541
|
+
0.0469986689718877,
|
|
542
|
+
0.0469986689718877,
|
|
543
|
+
0.0469986689718877,
|
|
544
|
+
0.0469986689718877,
|
|
545
|
+
0.0469986689718877,
|
|
546
|
+
0.0469986689718877,
|
|
547
|
+
0.0469986689718877,
|
|
548
|
+
0.0469986689718877,
|
|
549
|
+
0.0469986689718877,
|
|
550
|
+
0.1019369182898680,
|
|
551
|
+
0.1019369182898680,
|
|
552
|
+
0.1019369182898680,
|
|
553
|
+
0.1019369182898680,
|
|
554
|
+
]
|
|
555
|
+
|
|
556
|
+
coords = [
|
|
557
|
+
Coords(0.0323525947272439, 0.0323525947272439, 0.0323525947272439),
|
|
558
|
+
Coords(0.9029422158182680, 0.0323525947272439, 0.0323525947272439),
|
|
559
|
+
Coords(0.0323525947272439, 0.9029422158182680, 0.0323525947272439),
|
|
560
|
+
Coords(0.0323525947272439, 0.0323525947272439, 0.9029422158182680),
|
|
561
|
+
Coords(0.6165965330619370, 0.0603604415251421, 0.0603604415251421),
|
|
562
|
+
Coords(0.2626825838877790, 0.0603604415251421, 0.0603604415251421),
|
|
563
|
+
Coords(0.0603604415251421, 0.6165965330619370, 0.0603604415251421),
|
|
564
|
+
Coords(0.0603604415251421, 0.2626825838877790, 0.0603604415251421),
|
|
565
|
+
Coords(0.0603604415251421, 0.0603604415251421, 0.6165965330619370),
|
|
566
|
+
Coords(0.0603604415251421, 0.0603604415251421, 0.2626825838877790),
|
|
567
|
+
Coords(0.2626825838877790, 0.6165965330619370, 0.0603604415251421),
|
|
568
|
+
Coords(0.6165965330619370, 0.2626825838877790, 0.0603604415251421),
|
|
569
|
+
Coords(0.2626825838877790, 0.0603604415251421, 0.6165965330619370),
|
|
570
|
+
Coords(0.6165965330619370, 0.0603604415251421, 0.2626825838877790),
|
|
571
|
+
Coords(0.0603604415251421, 0.2626825838877790, 0.6165965330619370),
|
|
572
|
+
Coords(0.0603604415251421, 0.6165965330619370, 0.2626825838877790),
|
|
573
|
+
Coords(0.3097693042728620, 0.3097693042728620, 0.0706920871814129),
|
|
574
|
+
Coords(0.3097693042728620, 0.0706920871814129, 0.3097693042728620),
|
|
575
|
+
Coords(0.0706920871814129, 0.3097693042728620, 0.3097693042728620),
|
|
576
|
+
Coords(0.3097693042728620, 0.3097693042728620, 0.3097693042728620),
|
|
577
|
+
]
|
|
578
|
+
|
|
579
|
+
elif order <= 5:
|
|
580
|
+
weights = [
|
|
581
|
+
0.0021900463965388,
|
|
582
|
+
0.0021900463965388,
|
|
583
|
+
0.0021900463965388,
|
|
584
|
+
0.0021900463965388,
|
|
585
|
+
0.0143395670177665,
|
|
586
|
+
0.0143395670177665,
|
|
587
|
+
0.0143395670177665,
|
|
588
|
+
0.0143395670177665,
|
|
589
|
+
0.0143395670177665,
|
|
590
|
+
0.0143395670177665,
|
|
591
|
+
0.0143395670177665,
|
|
592
|
+
0.0143395670177665,
|
|
593
|
+
0.0143395670177665,
|
|
594
|
+
0.0143395670177665,
|
|
595
|
+
0.0143395670177665,
|
|
596
|
+
0.0143395670177665,
|
|
597
|
+
0.0250305395686746,
|
|
598
|
+
0.0250305395686746,
|
|
599
|
+
0.0250305395686746,
|
|
600
|
+
0.0250305395686746,
|
|
601
|
+
0.0250305395686746,
|
|
602
|
+
0.0250305395686746,
|
|
603
|
+
0.0479839333057554,
|
|
604
|
+
0.0479839333057554,
|
|
605
|
+
0.0479839333057554,
|
|
606
|
+
0.0479839333057554,
|
|
607
|
+
0.0479839333057554,
|
|
608
|
+
0.0479839333057554,
|
|
609
|
+
0.0479839333057554,
|
|
610
|
+
0.0479839333057554,
|
|
611
|
+
0.0479839333057554,
|
|
612
|
+
0.0479839333057554,
|
|
613
|
+
0.0479839333057554,
|
|
614
|
+
0.0479839333057554,
|
|
615
|
+
0.0931745731195340,
|
|
616
|
+
]
|
|
617
|
+
|
|
618
|
+
coords = [
|
|
619
|
+
Coords(0.0267367755543735, 0.0267367755543735, 0.0267367755543735),
|
|
620
|
+
Coords(0.9197896733368800, 0.0267367755543735, 0.0267367755543735),
|
|
621
|
+
Coords(0.0267367755543735, 0.9197896733368800, 0.0267367755543735),
|
|
622
|
+
Coords(0.0267367755543735, 0.0267367755543735, 0.9197896733368800),
|
|
623
|
+
Coords(0.7477598884818090, 0.0391022406356488, 0.0391022406356488),
|
|
624
|
+
Coords(0.1740356302468940, 0.0391022406356488, 0.0391022406356488),
|
|
625
|
+
Coords(0.0391022406356488, 0.7477598884818090, 0.0391022406356488),
|
|
626
|
+
Coords(0.0391022406356488, 0.1740356302468940, 0.0391022406356488),
|
|
627
|
+
Coords(0.0391022406356488, 0.0391022406356488, 0.7477598884818090),
|
|
628
|
+
Coords(0.0391022406356488, 0.0391022406356488, 0.1740356302468940),
|
|
629
|
+
Coords(0.1740356302468940, 0.7477598884818090, 0.0391022406356488),
|
|
630
|
+
Coords(0.7477598884818090, 0.1740356302468940, 0.0391022406356488),
|
|
631
|
+
Coords(0.1740356302468940, 0.0391022406356488, 0.7477598884818090),
|
|
632
|
+
Coords(0.7477598884818090, 0.0391022406356488, 0.1740356302468940),
|
|
633
|
+
Coords(0.0391022406356488, 0.1740356302468940, 0.7477598884818090),
|
|
634
|
+
Coords(0.0391022406356488, 0.7477598884818090, 0.1740356302468940),
|
|
635
|
+
Coords(0.4547545999844830, 0.0452454000155172, 0.0452454000155172),
|
|
636
|
+
Coords(0.0452454000155172, 0.4547545999844830, 0.0452454000155172),
|
|
637
|
+
Coords(0.0452454000155172, 0.0452454000155172, 0.4547545999844830),
|
|
638
|
+
Coords(0.4547545999844830, 0.4547545999844830, 0.0452454000155172),
|
|
639
|
+
Coords(0.4547545999844830, 0.0452454000155172, 0.4547545999844830),
|
|
640
|
+
Coords(0.0452454000155172, 0.4547545999844830, 0.4547545999844830),
|
|
641
|
+
Coords(0.2232010379623150, 0.2232010379623150, 0.0504792790607720),
|
|
642
|
+
Coords(0.5031186450145980, 0.2232010379623150, 0.0504792790607720),
|
|
643
|
+
Coords(0.2232010379623150, 0.5031186450145980, 0.0504792790607720),
|
|
644
|
+
Coords(0.2232010379623150, 0.0504792790607720, 0.2232010379623150),
|
|
645
|
+
Coords(0.5031186450145980, 0.0504792790607720, 0.2232010379623150),
|
|
646
|
+
Coords(0.2232010379623150, 0.0504792790607720, 0.5031186450145980),
|
|
647
|
+
Coords(0.0504792790607720, 0.2232010379623150, 0.2232010379623150),
|
|
648
|
+
Coords(0.0504792790607720, 0.5031186450145980, 0.2232010379623150),
|
|
649
|
+
Coords(0.0504792790607720, 0.2232010379623150, 0.5031186450145980),
|
|
650
|
+
Coords(0.5031186450145980, 0.2232010379623150, 0.2232010379623150),
|
|
651
|
+
Coords(0.2232010379623150, 0.5031186450145980, 0.2232010379623150),
|
|
652
|
+
Coords(0.2232010379623150, 0.2232010379623150, 0.5031186450145980),
|
|
653
|
+
Coords(0.2500000000000000, 0.2500000000000000, 0.2500000000000000),
|
|
654
|
+
]
|
|
655
|
+
elif order <= 6:
|
|
656
|
+
weights = [
|
|
657
|
+
0.0010373112336140,
|
|
658
|
+
0.0010373112336140,
|
|
659
|
+
0.0010373112336140,
|
|
660
|
+
0.0010373112336140,
|
|
661
|
+
0.0096016645399480,
|
|
662
|
+
0.0096016645399480,
|
|
663
|
+
0.0096016645399480,
|
|
664
|
+
0.0096016645399480,
|
|
665
|
+
0.0096016645399480,
|
|
666
|
+
0.0096016645399480,
|
|
667
|
+
0.0096016645399480,
|
|
668
|
+
0.0096016645399480,
|
|
669
|
+
0.0096016645399480,
|
|
670
|
+
0.0096016645399480,
|
|
671
|
+
0.0096016645399480,
|
|
672
|
+
0.0096016645399480,
|
|
673
|
+
0.0164493976798232,
|
|
674
|
+
0.0164493976798232,
|
|
675
|
+
0.0164493976798232,
|
|
676
|
+
0.0164493976798232,
|
|
677
|
+
0.0164493976798232,
|
|
678
|
+
0.0164493976798232,
|
|
679
|
+
0.0164493976798232,
|
|
680
|
+
0.0164493976798232,
|
|
681
|
+
0.0164493976798232,
|
|
682
|
+
0.0164493976798232,
|
|
683
|
+
0.0164493976798232,
|
|
684
|
+
0.0164493976798232,
|
|
685
|
+
0.0153747766513310,
|
|
686
|
+
0.0153747766513310,
|
|
687
|
+
0.0153747766513310,
|
|
688
|
+
0.0153747766513310,
|
|
689
|
+
0.0153747766513310,
|
|
690
|
+
0.0153747766513310,
|
|
691
|
+
0.0153747766513310,
|
|
692
|
+
0.0153747766513310,
|
|
693
|
+
0.0153747766513310,
|
|
694
|
+
0.0153747766513310,
|
|
695
|
+
0.0153747766513310,
|
|
696
|
+
0.0153747766513310,
|
|
697
|
+
0.0293520118375230,
|
|
698
|
+
0.0293520118375230,
|
|
699
|
+
0.0293520118375230,
|
|
700
|
+
0.0293520118375230,
|
|
701
|
+
0.0293520118375230,
|
|
702
|
+
0.0293520118375230,
|
|
703
|
+
0.0293520118375230,
|
|
704
|
+
0.0293520118375230,
|
|
705
|
+
0.0293520118375230,
|
|
706
|
+
0.0293520118375230,
|
|
707
|
+
0.0293520118375230,
|
|
708
|
+
0.0293520118375230,
|
|
709
|
+
0.0366291366405108,
|
|
710
|
+
0.0366291366405108,
|
|
711
|
+
0.0366291366405108,
|
|
712
|
+
0.0366291366405108,
|
|
713
|
+
]
|
|
714
|
+
|
|
715
|
+
coords = [
|
|
716
|
+
Coords(0.0149520651530592, 0.0149520651530592, 0.0149520651530592),
|
|
717
|
+
Coords(0.9551438045408220, 0.0149520651530592, 0.0149520651530592),
|
|
718
|
+
Coords(0.0149520651530592, 0.9551438045408220, 0.0149520651530592),
|
|
719
|
+
Coords(0.0149520651530592, 0.0149520651530592, 0.9551438045408220),
|
|
720
|
+
Coords(0.1518319491659370, 0.0340960211962615, 0.0340960211962615),
|
|
721
|
+
Coords(0.7799760084415400, 0.0340960211962615, 0.0340960211962615),
|
|
722
|
+
Coords(0.0340960211962615, 0.1518319491659370, 0.0340960211962615),
|
|
723
|
+
Coords(0.0340960211962615, 0.7799760084415400, 0.0340960211962615),
|
|
724
|
+
Coords(0.0340960211962615, 0.0340960211962615, 0.1518319491659370),
|
|
725
|
+
Coords(0.0340960211962615, 0.0340960211962615, 0.7799760084415400),
|
|
726
|
+
Coords(0.7799760084415400, 0.1518319491659370, 0.0340960211962615),
|
|
727
|
+
Coords(0.1518319491659370, 0.7799760084415400, 0.0340960211962615),
|
|
728
|
+
Coords(0.7799760084415400, 0.0340960211962615, 0.1518319491659370),
|
|
729
|
+
Coords(0.1518319491659370, 0.0340960211962615, 0.7799760084415400),
|
|
730
|
+
Coords(0.0340960211962615, 0.7799760084415400, 0.1518319491659370),
|
|
731
|
+
Coords(0.0340960211962615, 0.1518319491659370, 0.7799760084415400),
|
|
732
|
+
Coords(0.5526556431060170, 0.0462051504150017, 0.0462051504150017),
|
|
733
|
+
Coords(0.3549340560639790, 0.0462051504150017, 0.0462051504150017),
|
|
734
|
+
Coords(0.0462051504150017, 0.5526556431060170, 0.0462051504150017),
|
|
735
|
+
Coords(0.0462051504150017, 0.3549340560639790, 0.0462051504150017),
|
|
736
|
+
Coords(0.0462051504150017, 0.0462051504150017, 0.5526556431060170),
|
|
737
|
+
Coords(0.0462051504150017, 0.0462051504150017, 0.3549340560639790),
|
|
738
|
+
Coords(0.3549340560639790, 0.5526556431060170, 0.0462051504150017),
|
|
739
|
+
Coords(0.5526556431060170, 0.3549340560639790, 0.0462051504150017),
|
|
740
|
+
Coords(0.3549340560639790, 0.0462051504150017, 0.5526556431060170),
|
|
741
|
+
Coords(0.5526556431060170, 0.0462051504150017, 0.3549340560639790),
|
|
742
|
+
Coords(0.0462051504150017, 0.3549340560639790, 0.5526556431060170),
|
|
743
|
+
Coords(0.0462051504150017, 0.5526556431060170, 0.3549340560639790),
|
|
744
|
+
Coords(0.2281904610687610, 0.2281904610687610, 0.0055147549744775),
|
|
745
|
+
Coords(0.5381043228880020, 0.2281904610687610, 0.0055147549744775),
|
|
746
|
+
Coords(0.2281904610687610, 0.5381043228880020, 0.0055147549744775),
|
|
747
|
+
Coords(0.2281904610687610, 0.0055147549744775, 0.2281904610687610),
|
|
748
|
+
Coords(0.5381043228880020, 0.0055147549744775, 0.2281904610687610),
|
|
749
|
+
Coords(0.2281904610687610, 0.0055147549744775, 0.5381043228880020),
|
|
750
|
+
Coords(0.0055147549744775, 0.2281904610687610, 0.2281904610687610),
|
|
751
|
+
Coords(0.0055147549744775, 0.5381043228880020, 0.2281904610687610),
|
|
752
|
+
Coords(0.0055147549744775, 0.2281904610687610, 0.5381043228880020),
|
|
753
|
+
Coords(0.5381043228880020, 0.2281904610687610, 0.2281904610687610),
|
|
754
|
+
Coords(0.2281904610687610, 0.5381043228880020, 0.2281904610687610),
|
|
755
|
+
Coords(0.2281904610687610, 0.2281904610687610, 0.5381043228880020),
|
|
756
|
+
Coords(0.3523052600879940, 0.3523052600879940, 0.0992057202494530),
|
|
757
|
+
Coords(0.1961837595745600, 0.3523052600879940, 0.0992057202494530),
|
|
758
|
+
Coords(0.3523052600879940, 0.1961837595745600, 0.0992057202494530),
|
|
759
|
+
Coords(0.3523052600879940, 0.0992057202494530, 0.3523052600879940),
|
|
760
|
+
Coords(0.1961837595745600, 0.0992057202494530, 0.3523052600879940),
|
|
761
|
+
Coords(0.3523052600879940, 0.0992057202494530, 0.1961837595745600),
|
|
762
|
+
Coords(0.0992057202494530, 0.3523052600879940, 0.3523052600879940),
|
|
763
|
+
Coords(0.0992057202494530, 0.1961837595745600, 0.3523052600879940),
|
|
764
|
+
Coords(0.0992057202494530, 0.3523052600879940, 0.1961837595745600),
|
|
765
|
+
Coords(0.1961837595745600, 0.3523052600879940, 0.3523052600879940),
|
|
766
|
+
Coords(0.3523052600879940, 0.1961837595745600, 0.3523052600879940),
|
|
767
|
+
Coords(0.3523052600879940, 0.3523052600879940, 0.1961837595745600),
|
|
768
|
+
Coords(0.1344783347929940, 0.1344783347929940, 0.1344783347929940),
|
|
769
|
+
Coords(0.5965649956210170, 0.1344783347929940, 0.1344783347929940),
|
|
770
|
+
Coords(0.1344783347929940, 0.5965649956210170, 0.1344783347929940),
|
|
771
|
+
Coords(0.1344783347929940, 0.1344783347929940, 0.5965649956210170),
|
|
772
|
+
]
|
|
773
|
+
else:
|
|
774
|
+
raise NotImplementedError
|
|
775
|
+
|
|
776
|
+
return coords, weights
|