quadrature rules library
Project description
Quadrature rules
The online encylopedia of quadrature rules is a reference website that lists a number of quadrature rules.
Quadrature rules are sets of points and weights that are used to approximate integrals. If ${p_0,\dots,p_{n-1}}\subset\mathbb{R}^d$ and ${w_0,\dots,w_{n-1}}\subset\mathbb{R}$ are the points and weights (repectively) of the quadrature rule for a single integral, then:
$$\int f(x),\mathrm{d}x \approx \sum_{i=0}^{n-1}f(p_i)w_i$$
Website
Before building the online encylopedia of quadrature rules, you must first install qrtools from the python directory:
cd python
python3 -m pip install .
The online encylopedia of quadrature rules website can then be built by running:
cd website
python3 build.py
Libraries
All of the quadrature rules included in the online encylopedia of quadrature rules are included in the quadraturerules library, which is available in the following languages:
| Language | Badges |
|---|---|
| C | |
| C++ | |
| Fortran | |
| FORTRAN 77 | |
| Julia | |
| Python | |
| Rust |
Before building any of the libraries, you must first install qrtools from the python directory:
cd python
python3 -m pip install .
You can then build the libraries using the build.py script in the library directory. For example, to build the python library, you can run:
cd library
python build.py python
and to build the rust library, you can run:
cd library
python build.py rust
Python library
The quadraturerules Python library is available on PyPI. It can be installed by running:
python -m pip install quadraturerules
Usage
The library's function single_integral_quadrature can be used to get the points and weights
of quadrature rules for a single integral. For example the following snippet will create an
order 3 Xiao--Gimbutas rule on a triangle:
from quadraturerules import Domain, QuadratureRule, single_integral_quadrature
points, weights = single_integral_quadrature(
QuadratureRule.XiaoGimbutas,
Domain.Triangle,
3,
)
Note that the points returned by the library are represented using barycentric coordinates.
Generating the library
The Python quadraturerules library can be generated from the templates in the online encyclopedia of quadrature rules GitHub repo. First clone the repo and move into the library directory:
git clone https://github.com/quadraturerules/quadraturerules.git
cd quadraturerules/library
The Python library can then be generated by running:
python build.py python
This will create a directory called python.build containing the Python source code.
Tests can then be run by moving into this folder and using pytest:
cd python.build
python -m pytest test/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file quadraturerules-0.9.0.tar.gz.
File metadata
- Download URL: quadraturerules-0.9.0.tar.gz
- Upload date:
- Size: 1.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee5680f7c66b449ab40fd6fa46a03593a94915b0a37b8088bafe4a6db284ff9f
|
|
| MD5 |
cbf3acc8f5100554f29a9815935f221e
|
|
| BLAKE2b-256 |
256acc916253484122d663d4ea95e9d7926f281437174adc17967b1da7a9f11c
|
Provenance
The following attestation bundles were made for quadraturerules-0.9.0.tar.gz:
Publisher:
release.yml on quadraturerules/quadraturerules
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
quadraturerules-0.9.0.tar.gz -
Subject digest:
ee5680f7c66b449ab40fd6fa46a03593a94915b0a37b8088bafe4a6db284ff9f - Sigstore transparency entry: 458440157
- Sigstore integration time:
-
Permalink:
quadraturerules/quadraturerules@4171e5e12eca41c7801a2f9bee28be329b698636 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/quadraturerules
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4171e5e12eca41c7801a2f9bee28be329b698636 -
Trigger Event:
push
-
Statement type:
File details
Details for the file quadraturerules-0.9.0-py3-none-any.whl.
File metadata
- Download URL: quadraturerules-0.9.0-py3-none-any.whl
- Upload date:
- Size: 1.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cbf8a347447b7e2679c12a26f577d11314d337ba01f55e75670d44bcfa75fa56
|
|
| MD5 |
b7ee221393621bdfd6fc56512a79d689
|
|
| BLAKE2b-256 |
c77b1a55b773697fd74945cfafe6d3178436f975db3bfd6a6acc73274b895895
|
Provenance
The following attestation bundles were made for quadraturerules-0.9.0-py3-none-any.whl:
Publisher:
release.yml on quadraturerules/quadraturerules
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
quadraturerules-0.9.0-py3-none-any.whl -
Subject digest:
cbf8a347447b7e2679c12a26f577d11314d337ba01f55e75670d44bcfa75fa56 - Sigstore transparency entry: 458440166
- Sigstore integration time:
-
Permalink:
quadraturerules/quadraturerules@4171e5e12eca41c7801a2f9bee28be329b698636 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/quadraturerules
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4171e5e12eca41c7801a2f9bee28be329b698636 -
Trigger Event:
push
-
Statement type: